Skip to content

Commit 6be10e8

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 8aea332 commit 6be10e8

File tree

17 files changed

+81
-34
lines changed

17 files changed

+81
-34
lines changed

GITLAB_KAS_VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v15.9.0-rc2
1+
v15.9.0

app/assets/javascripts/issues/constants.js

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const IssuableType = {
1717
Epic: 'epic',
1818
MergeRequest: 'merge_request',
1919
Alert: 'alert',
20+
TestCase: 'test_case',
2021
};
2122

2223
export const IssueType = {

app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#import "~/graphql_shared/fragments/label.fragment.graphql"
22

3-
query issueLabels($fullPath: ID!, $iid: String) {
3+
query issueLabels($fullPath: ID!, $iid: String, $types: [IssueType!]) {
44
workspace: project(fullPath: $fullPath) {
55
id
6-
issuable: issue(iid: $iid) {
6+
issuable: issue(iid: $iid, types: $types) {
77
id
88
labels {
99
nodes {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#import "~/graphql_shared/fragments/author.fragment.graphql"
2+
#import "~/graphql_shared/fragments/label.fragment.graphql"
3+
4+
mutation updateTestCaseLabels($input: UpdateIssueInput!) {
5+
updateIssuableLabels: updateIssue(input: $input) {
6+
issuable: issue {
7+
id
8+
updatedAt
9+
updatedBy {
10+
...Author
11+
}
12+
labels {
13+
nodes {
14+
...Label
15+
}
16+
}
17+
}
18+
errors
19+
}
20+
}

app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue

+9-1
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,16 @@ export default {
161161
return !isDropdownVariantSidebar(this.variant);
162162
},
163163
variables() {
164-
return {
164+
const queryVariables = {
165165
iid: this.iid,
166166
fullPath: this.fullPath,
167167
};
168+
169+
if (this.issuableType === IssuableType.TestCase) {
170+
queryVariables.types = ['TEST_CASE'];
171+
}
172+
173+
return queryVariables;
168174
},
169175
update(data) {
170176
return data.workspace?.issuable;
@@ -256,6 +262,7 @@ export default {
256262
257263
switch (this.issuableType) {
258264
case IssuableType.Issue:
265+
case IssuableType.TestCase:
259266
return updateVariables;
260267
case IssuableType.MergeRequest:
261268
return {
@@ -312,6 +319,7 @@ export default {
312319
313320
switch (this.issuableType) {
314321
case IssuableType.Issue:
322+
case IssuableType.TestCase:
315323
return {
316324
...removeVariables,
317325
removeLabelIds: [labelId],

app/assets/javascripts/sidebar/constants.js

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import userSearchQuery from '~/graphql_shared/queries/users_search.query.graphql
55
import userSearchWithMRPermissionsQuery from '~/graphql_shared/queries/users_search_with_mr_permissions.graphql';
66
import { IssuableType, WorkspaceType } from '~/issues/constants';
77
import updateAlertAssigneesMutation from '~/vue_shared/alert_details/graphql/mutations/alert_set_assignees.mutation.graphql';
8+
import updateTestCaseLabelsMutation from './components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql';
89
import epicLabelsQuery from './components/labels/labels_select_widget/graphql/epic_labels.query.graphql';
910
import updateEpicLabelsMutation from './components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql';
1011
import groupLabelsQuery from './components/labels/labels_select_widget/graphql/group_labels.query.graphql';
@@ -151,6 +152,11 @@ export const issuableLabelsQueries = {
151152
mutation: updateEpicLabelsMutation,
152153
mutationName: 'updateEpic',
153154
},
155+
[IssuableType.TestCase]: {
156+
issuableQuery: issueLabelsQuery,
157+
mutation: updateTestCaseLabelsMutation,
158+
mutationName: 'updateTestCaseLabels',
159+
},
154160
};
155161

156162
export const dateTypes = {

db/structure.sql

+5-5
Original file line numberDiff line numberDiff line change
@@ -261,16 +261,16 @@ BEGIN
261261
END;
262262
$$;
263263

264-
CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
264+
CREATE FUNCTION trigger_428d92773fe7() RETURNS trigger
265265
LANGUAGE plpgsql
266266
AS $$
267267
BEGIN
268268
NEW."note_id_convert_to_bigint" := NEW."note_id";
269269
RETURN NEW;
270270
END;
271-
$$;
271+
$$;
272272

273-
CREATE FUNCTION trigger_428d92773fe7() RETURNS trigger
273+
CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
274274
LANGUAGE plpgsql
275275
AS $$
276276
BEGIN
@@ -33610,12 +33610,12 @@ CREATE TRIGGER trigger_3207b8d0d6f3 BEFORE INSERT OR UPDATE ON ci_build_needs FO
3361033610

3361133611
CREATE TRIGGER trigger_3dc62927cae8 BEFORE INSERT OR UPDATE ON design_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_3dc62927cae8();
3361233612

33613+
CREATE TRIGGER trigger_428d92773fe7 BEFORE INSERT OR UPDATE ON timelogs FOR EACH ROW EXECUTE FUNCTION trigger_428d92773fe7();
33614+
3361333615
CREATE TRIGGER trigger_482bac5ec48a BEFORE INSERT OR UPDATE ON system_note_metadata FOR EACH ROW EXECUTE FUNCTION trigger_482bac5ec48a();
3361433616

3361533617
CREATE TRIGGER trigger_775287b6d67a BEFORE INSERT OR UPDATE ON note_diff_files FOR EACH ROW EXECUTE FUNCTION trigger_775287b6d67a();
3361633618

33617-
CREATE TRIGGER trigger_428d92773fe7 BEFORE INSERT OR UPDATE ON timelogs FOR EACH ROW EXECUTE FUNCTION trigger_428d92773fe7();
33618-
3361933619
CREATE TRIGGER trigger_7f4fcd5aa322 BEFORE INSERT OR UPDATE ON sent_notifications FOR EACH ROW EXECUTE FUNCTION trigger_7f4fcd5aa322();
3362033620

3362133621
CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfc6e47be8cc();

doc/ci/secure_files/index.md

-4
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ Secure files can be [downloaded and used by CI/CD jobs](#use-secure-files-in-cic
2828
by using the [download-secure-files](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files)
2929
tool.
3030

31-
NOTE:
32-
This feature is in active development and is likely to change, potentially in a breaking way.
33-
Additional features and capabilities are planned.
34-
3531
## Add a secure file to a project
3632

3733
To add a secure file to a project:

doc/user/admin_area/settings/rate_limit_on_pipelines_creation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ the eleventh request is blocked. Access to the endpoint is allowed again after o
1616

1717
This limit is:
1818

19-
- Applied independently per project, user, and commit.
19+
- Applied to the number of pipelines created for the same combination of project, commit, and user.
2020
- Not applied per IP address.
2121
- Disabled by default.
2222

lib/gitlab/database/tables_truncate.rb

+15-13
Original file line numberDiff line numberDiff line change
@@ -71,31 +71,33 @@ def connection
7171
@connection ||= Gitlab::Database.database_base_models[database_name].connection
7272
end
7373

74+
def remove_schema_name(table_with_schema)
75+
ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
76+
.extract_schema_qualified_name(table_with_schema)
77+
.identifier
78+
end
79+
80+
def disable_locks_on_table(table)
81+
sql_statement = "SELECT set_config('lock_writes.#{table}', 'false', false)"
82+
logger&.info(sql_statement)
83+
connection.execute(sql_statement) unless dry_run
84+
end
85+
7486
def truncate_tables_in_batches(tables_sorted)
7587
truncated_tables = []
7688

7789
tables_sorted.flatten.each do |table|
78-
table_name_without_schema = ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
79-
.extract_schema_qualified_name(table)
80-
.identifier
90+
table_name_without_schema = remove_schema_name(table)
8191

82-
sql_statement = "SELECT set_config('lock_writes.#{table_name_without_schema}', 'false', false)"
83-
logger&.info(sql_statement)
84-
connection.execute(sql_statement) unless dry_run
92+
disable_locks_on_table(table_name_without_schema)
8593

8694
# Temporarily unlocking writes on the attached partitions of the table.
8795
# Because in some cases they might have been locked for writes as well, when they used to be
8896
# normal tables before being converted into attached partitions.
8997
Gitlab::Database::SharedModel.using_connection(connection) do
9098
table_partitions = Gitlab::Database::PostgresPartition.for_parent_table(table_name_without_schema)
9199
table_partitions.each do |table_partition|
92-
partition_name_without_schema = ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
93-
.extract_schema_qualified_name(table_partition.identifier)
94-
.identifier
95-
96-
sql_statement = "SELECT set_config('lock_writes.#{partition_name_without_schema}', 'false', false)"
97-
logger&.info(sql_statement)
98-
connection.execute(sql_statement) unless dry_run
100+
disable_locks_on_table(remove_schema_name(table_partition.identifier))
99101
end
100102
end
101103
end

spec/features/issuables/shortcuts_issuable_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
before do
1313
project.add_developer(user)
14+
1415
sign_in(user)
1516
end
1617

spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import updateIssueLabelsMutation from '~/boards/graphql/issue_set_labels.mutatio
1414
import updateMergeRequestLabelsMutation from '~/sidebar/queries/update_merge_request_labels.mutation.graphql';
1515
import issuableLabelsSubscription from 'ee_else_ce/sidebar/queries/issuable_labels.subscription.graphql';
1616
import updateEpicLabelsMutation from '~/sidebar/components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql';
17+
import updateTestCaseLabelsMutation from '~/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql';
1718
import LabelsSelectRoot from '~/sidebar/components/labels/labels_select_widget/labels_select_root.vue';
1819
import {
1920
mockConfig,
@@ -37,6 +38,7 @@ const updateLabelsMutation = {
3738
[IssuableType.Issue]: updateIssueLabelsMutation,
3839
[IssuableType.MergeRequest]: updateMergeRequestLabelsMutation,
3940
[IssuableType.Epic]: updateEpicLabelsMutation,
41+
[IssuableType.TestCase]: updateTestCaseLabelsMutation,
4042
};
4143

4244
describe('LabelsSelectRoot', () => {
@@ -214,6 +216,7 @@ describe('LabelsSelectRoot', () => {
214216
${IssuableType.Issue}
215217
${IssuableType.MergeRequest}
216218
${IssuableType.Epic}
219+
${IssuableType.TestCase}
217220
`('when updating labels for $issuableType', ({ issuableType }) => {
218221
const label = { id: 'gid://gitlab/ProjectLabel/2' };
219222

@@ -228,6 +231,7 @@ describe('LabelsSelectRoot', () => {
228231

229232
it('updates labels correctly after successful mutation', async () => {
230233
createComponent({ issuableType });
234+
231235
await nextTick();
232236
findDropdownContents().vm.$emit('setLabels', [label]);
233237
await waitForPromises();

spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js

+9
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@ export const updateLabelsMutationResponse = {
174174
updateIssuableLabels: {
175175
errors: [],
176176
issuable: {
177+
updatedAt: '2023-02-10T22:26:49Z',
178+
updatedBy: {
179+
id: 'gid://gitlab/User/1',
180+
avatarUrl: 'avatar/url',
181+
name: 'John Smith',
182+
username: 'jsmith',
183+
webUrl: 'http://gdk.test:3000/jsmith',
184+
__typename: 'UserCore',
185+
},
177186
__typename: 'Issue',
178187
id: '1',
179188
labels: {

spec/models/integrations/microsoft_teams_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
end
195195

196196
describe 'Pipeline events' do
197-
let_it_be_with_reload(:project) { create(:project, :repository) }
197+
let_it_be_with_refind(:project) { create(:project, :repository) }
198198

199199
let(:pipeline) do
200200
create(:ci_pipeline,

spec/services/merge_requests/create_pipeline_service_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RSpec.describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_cache do
66
include ProjectForksHelper
77

8-
let_it_be(:project, reload: true) { create(:project, :repository) }
8+
let_it_be(:project, refind: true) { create(:project, :repository) }
99
let_it_be(:user) { create(:user) }
1010

1111
let(:service) { described_class.new(project: project, current_user: actor, params: params) }

workhorse/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
77
github.com/BurntSushi/toml v1.2.1
88
github.com/FZambia/sentinel v1.1.1
9-
github.com/alecthomas/chroma/v2 v2.4.0
9+
github.com/alecthomas/chroma/v2 v2.5.0
1010
github.com/aws/aws-sdk-go v1.44.199
1111
github.com/disintegration/imaging v1.6.2
1212
github.com/getsentry/raven-go v0.2.0

workhorse/go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -509,10 +509,10 @@ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUW
509509
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
510510
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
511511
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
512-
github.com/alecthomas/assert/v2 v2.2.0 h1:f6L/b7KE2bfA+9O4FL3CM/xJccDEwPVYd5fALBiuwvw=
513-
github.com/alecthomas/chroma/v2 v2.4.0 h1:Loe2ZjT5x3q1bcWwemqyqEi8p11/IV/ncFCeLYDpWC4=
514-
github.com/alecthomas/chroma/v2 v2.4.0/go.mod h1:6kHzqF5O6FUSJzBXW7fXELjb+e+7OXW4UpoPqMO7IBQ=
515-
github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
512+
github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
513+
github.com/alecthomas/chroma/v2 v2.5.0 h1:CQCdj1BiBV17sD4Bd32b/Bzuiq/EqoNTrnIhyQAZ+Rk=
514+
github.com/alecthomas/chroma/v2 v2.5.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw=
515+
github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
516516
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
517517
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
518518
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=

0 commit comments

Comments
 (0)