summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-14 03:13:26 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-14 03:13:26 +0000
commit6be10e8588cd18091d8302fd52e166a71900f7bc (patch)
tree5e0e785ca56df17982142a9ddde4a471d1a4013c
parent8aea332821a78e83ce93f5b3bac7de5f95a3c7b8 (diff)
downloadgitlab-ce-6be10e8588cd18091d8302fd52e166a71900f7bc.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--GITLAB_KAS_VERSION2
-rw-r--r--app/assets/javascripts/issues/constants.js1
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql4
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql20
-rw-r--r--app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue10
-rw-r--r--app/assets/javascripts/sidebar/constants.js6
-rw-r--r--db/structure.sql10
-rw-r--r--doc/ci/secure_files/index.md4
-rw-r--r--doc/user/admin_area/settings/rate_limit_on_pipelines_creation.md2
-rw-r--r--lib/gitlab/database/tables_truncate.rb28
-rw-r--r--spec/features/issuables/shortcuts_issuable_spec.rb1
-rw-r--r--spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js4
-rw-r--r--spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js9
-rw-r--r--spec/models/integrations/microsoft_teams_spec.rb2
-rw-r--r--spec/services/merge_requests/create_pipeline_service_spec.rb2
-rw-r--r--workhorse/go.mod2
-rw-r--r--workhorse/go.sum8
17 files changed, 81 insertions, 34 deletions
diff --git a/GITLAB_KAS_VERSION b/GITLAB_KAS_VERSION
index c681ac9129e..3a6f2e99e48 100644
--- a/GITLAB_KAS_VERSION
+++ b/GITLAB_KAS_VERSION
@@ -1 +1 @@
-v15.9.0-rc2
+v15.9.0
diff --git a/app/assets/javascripts/issues/constants.js b/app/assets/javascripts/issues/constants.js
index f8d7b0adf3b..c359420a680 100644
--- a/app/assets/javascripts/issues/constants.js
+++ b/app/assets/javascripts/issues/constants.js
@@ -17,6 +17,7 @@ export const IssuableType = {
Epic: 'epic',
MergeRequest: 'merge_request',
Alert: 'alert',
+ TestCase: 'test_case',
};
export const IssueType = {
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql
index 2904857270e..d7456a71aff 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/issue_labels.query.graphql
@@ -1,9 +1,9 @@
#import "~/graphql_shared/fragments/label.fragment.graphql"
-query issueLabels($fullPath: ID!, $iid: String) {
+query issueLabels($fullPath: ID!, $iid: String, $types: [IssueType!]) {
workspace: project(fullPath: $fullPath) {
id
- issuable: issue(iid: $iid) {
+ issuable: issue(iid: $iid, types: $types) {
id
labels {
nodes {
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql
new file mode 100644
index 00000000000..9ff7ce64d3b
--- /dev/null
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql
@@ -0,0 +1,20 @@
+#import "~/graphql_shared/fragments/author.fragment.graphql"
+#import "~/graphql_shared/fragments/label.fragment.graphql"
+
+mutation updateTestCaseLabels($input: UpdateIssueInput!) {
+ updateIssuableLabels: updateIssue(input: $input) {
+ issuable: issue {
+ id
+ updatedAt
+ updatedBy {
+ ...Author
+ }
+ labels {
+ nodes {
+ ...Label
+ }
+ }
+ }
+ errors
+ }
+}
diff --git a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue
index b7b4bbac661..f23648c91a9 100644
--- a/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue
+++ b/app/assets/javascripts/sidebar/components/labels/labels_select_widget/labels_select_root.vue
@@ -161,10 +161,16 @@ export default {
return !isDropdownVariantSidebar(this.variant);
},
variables() {
- return {
+ const queryVariables = {
iid: this.iid,
fullPath: this.fullPath,
};
+
+ if (this.issuableType === IssuableType.TestCase) {
+ queryVariables.types = ['TEST_CASE'];
+ }
+
+ return queryVariables;
},
update(data) {
return data.workspace?.issuable;
@@ -256,6 +262,7 @@ export default {
switch (this.issuableType) {
case IssuableType.Issue:
+ case IssuableType.TestCase:
return updateVariables;
case IssuableType.MergeRequest:
return {
@@ -312,6 +319,7 @@ export default {
switch (this.issuableType) {
case IssuableType.Issue:
+ case IssuableType.TestCase:
return {
...removeVariables,
removeLabelIds: [labelId],
diff --git a/app/assets/javascripts/sidebar/constants.js b/app/assets/javascripts/sidebar/constants.js
index 825a89daf58..976fe524209 100644
--- a/app/assets/javascripts/sidebar/constants.js
+++ b/app/assets/javascripts/sidebar/constants.js
@@ -5,6 +5,7 @@ import userSearchQuery from '~/graphql_shared/queries/users_search.query.graphql
import userSearchWithMRPermissionsQuery from '~/graphql_shared/queries/users_search_with_mr_permissions.graphql';
import { IssuableType, WorkspaceType } from '~/issues/constants';
import updateAlertAssigneesMutation from '~/vue_shared/alert_details/graphql/mutations/alert_set_assignees.mutation.graphql';
+import updateTestCaseLabelsMutation from './components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql';
import epicLabelsQuery from './components/labels/labels_select_widget/graphql/epic_labels.query.graphql';
import updateEpicLabelsMutation from './components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql';
import groupLabelsQuery from './components/labels/labels_select_widget/graphql/group_labels.query.graphql';
@@ -151,6 +152,11 @@ export const issuableLabelsQueries = {
mutation: updateEpicLabelsMutation,
mutationName: 'updateEpic',
},
+ [IssuableType.TestCase]: {
+ issuableQuery: issueLabelsQuery,
+ mutation: updateTestCaseLabelsMutation,
+ mutationName: 'updateTestCaseLabels',
+ },
};
export const dateTypes = {
diff --git a/db/structure.sql b/db/structure.sql
index f0098dbcb95..43b16388c1d 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -261,16 +261,16 @@ BEGIN
END;
$$;
-CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
+CREATE FUNCTION trigger_428d92773fe7() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
NEW."note_id_convert_to_bigint" := NEW."note_id";
RETURN NEW;
END;
-$$;
+$$;
-CREATE FUNCTION trigger_428d92773fe7() RETURNS trigger
+CREATE FUNCTION trigger_482bac5ec48a() RETURNS trigger
LANGUAGE plpgsql
AS $$
BEGIN
@@ -33610,12 +33610,12 @@ CREATE TRIGGER trigger_3207b8d0d6f3 BEFORE INSERT OR UPDATE ON ci_build_needs FO
CREATE TRIGGER trigger_3dc62927cae8 BEFORE INSERT OR UPDATE ON design_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_3dc62927cae8();
+CREATE TRIGGER trigger_428d92773fe7 BEFORE INSERT OR UPDATE ON timelogs FOR EACH ROW EXECUTE FUNCTION trigger_428d92773fe7();
+
CREATE TRIGGER trigger_482bac5ec48a BEFORE INSERT OR UPDATE ON system_note_metadata FOR EACH ROW EXECUTE FUNCTION trigger_482bac5ec48a();
CREATE TRIGGER trigger_775287b6d67a BEFORE INSERT OR UPDATE ON note_diff_files FOR EACH ROW EXECUTE FUNCTION trigger_775287b6d67a();
-CREATE TRIGGER trigger_428d92773fe7 BEFORE INSERT OR UPDATE ON timelogs FOR EACH ROW EXECUTE FUNCTION trigger_428d92773fe7();
-
CREATE TRIGGER trigger_7f4fcd5aa322 BEFORE INSERT OR UPDATE ON sent_notifications FOR EACH ROW EXECUTE FUNCTION trigger_7f4fcd5aa322();
CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfc6e47be8cc();
diff --git a/doc/ci/secure_files/index.md b/doc/ci/secure_files/index.md
index 32bc4f2d758..10baa57cabb 100644
--- a/doc/ci/secure_files/index.md
+++ b/doc/ci/secure_files/index.md
@@ -28,10 +28,6 @@ Secure files can be [downloaded and used by CI/CD jobs](#use-secure-files-in-cic
by using the [download-secure-files](https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files)
tool.
-NOTE:
-This feature is in active development and is likely to change, potentially in a breaking way.
-Additional features and capabilities are planned.
-
## Add a secure file to a project
To add a secure file to a project:
diff --git a/doc/user/admin_area/settings/rate_limit_on_pipelines_creation.md b/doc/user/admin_area/settings/rate_limit_on_pipelines_creation.md
index 820f7eaf854..152ef535ff8 100644
--- a/doc/user/admin_area/settings/rate_limit_on_pipelines_creation.md
+++ b/doc/user/admin_area/settings/rate_limit_on_pipelines_creation.md
@@ -16,7 +16,7 @@ the eleventh request is blocked. Access to the endpoint is allowed again after o
This limit is:
-- Applied independently per project, user, and commit.
+- Applied to the number of pipelines created for the same combination of project, commit, and user.
- Not applied per IP address.
- Disabled by default.
diff --git a/lib/gitlab/database/tables_truncate.rb b/lib/gitlab/database/tables_truncate.rb
index daef0402742..a6430d1758b 100644
--- a/lib/gitlab/database/tables_truncate.rb
+++ b/lib/gitlab/database/tables_truncate.rb
@@ -71,17 +71,25 @@ module Gitlab
@connection ||= Gitlab::Database.database_base_models[database_name].connection
end
+ def remove_schema_name(table_with_schema)
+ ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
+ .extract_schema_qualified_name(table_with_schema)
+ .identifier
+ end
+
+ def disable_locks_on_table(table)
+ sql_statement = "SELECT set_config('lock_writes.#{table}', 'false', false)"
+ logger&.info(sql_statement)
+ connection.execute(sql_statement) unless dry_run
+ end
+
def truncate_tables_in_batches(tables_sorted)
truncated_tables = []
tables_sorted.flatten.each do |table|
- table_name_without_schema = ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
- .extract_schema_qualified_name(table)
- .identifier
+ table_name_without_schema = remove_schema_name(table)
- sql_statement = "SELECT set_config('lock_writes.#{table_name_without_schema}', 'false', false)"
- logger&.info(sql_statement)
- connection.execute(sql_statement) unless dry_run
+ disable_locks_on_table(table_name_without_schema)
# Temporarily unlocking writes on the attached partitions of the table.
# Because in some cases they might have been locked for writes as well, when they used to be
@@ -89,13 +97,7 @@ module Gitlab
Gitlab::Database::SharedModel.using_connection(connection) do
table_partitions = Gitlab::Database::PostgresPartition.for_parent_table(table_name_without_schema)
table_partitions.each do |table_partition|
- partition_name_without_schema = ActiveRecord::ConnectionAdapters::PostgreSQL::Utils
- .extract_schema_qualified_name(table_partition.identifier)
- .identifier
-
- sql_statement = "SELECT set_config('lock_writes.#{partition_name_without_schema}', 'false', false)"
- logger&.info(sql_statement)
- connection.execute(sql_statement) unless dry_run
+ disable_locks_on_table(remove_schema_name(table_partition.identifier))
end
end
end
diff --git a/spec/features/issuables/shortcuts_issuable_spec.rb b/spec/features/issuables/shortcuts_issuable_spec.rb
index 0190111b2f0..06387c14ee2 100644
--- a/spec/features/issuables/shortcuts_issuable_spec.rb
+++ b/spec/features/issuables/shortcuts_issuable_spec.rb
@@ -11,6 +11,7 @@ RSpec.describe 'Blob shortcuts', :js, feature_category: :team_planning do
before do
project.add_developer(user)
+
sign_in(user)
end
diff --git a/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js b/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js
index 2995c268966..b5656ef3a7b 100644
--- a/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js
+++ b/spec/frontend/sidebar/components/labels/labels_select_widget/labels_select_root_spec.js
@@ -14,6 +14,7 @@ import updateIssueLabelsMutation from '~/boards/graphql/issue_set_labels.mutatio
import updateMergeRequestLabelsMutation from '~/sidebar/queries/update_merge_request_labels.mutation.graphql';
import issuableLabelsSubscription from 'ee_else_ce/sidebar/queries/issuable_labels.subscription.graphql';
import updateEpicLabelsMutation from '~/sidebar/components/labels/labels_select_widget/graphql/epic_update_labels.mutation.graphql';
+import updateTestCaseLabelsMutation from '~/sidebar/components/labels/labels_select_widget/graphql/update_test_case_labels.mutation.graphql';
import LabelsSelectRoot from '~/sidebar/components/labels/labels_select_widget/labels_select_root.vue';
import {
mockConfig,
@@ -37,6 +38,7 @@ const updateLabelsMutation = {
[IssuableType.Issue]: updateIssueLabelsMutation,
[IssuableType.MergeRequest]: updateMergeRequestLabelsMutation,
[IssuableType.Epic]: updateEpicLabelsMutation,
+ [IssuableType.TestCase]: updateTestCaseLabelsMutation,
};
describe('LabelsSelectRoot', () => {
@@ -214,6 +216,7 @@ describe('LabelsSelectRoot', () => {
${IssuableType.Issue}
${IssuableType.MergeRequest}
${IssuableType.Epic}
+ ${IssuableType.TestCase}
`('when updating labels for $issuableType', ({ issuableType }) => {
const label = { id: 'gid://gitlab/ProjectLabel/2' };
@@ -228,6 +231,7 @@ describe('LabelsSelectRoot', () => {
it('updates labels correctly after successful mutation', async () => {
createComponent({ issuableType });
+
await nextTick();
findDropdownContents().vm.$emit('setLabels', [label]);
await waitForPromises();
diff --git a/spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js b/spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js
index 48530a0261f..5d5a7e9a200 100644
--- a/spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js
+++ b/spec/frontend/sidebar/components/labels/labels_select_widget/mock_data.js
@@ -174,6 +174,15 @@ export const updateLabelsMutationResponse = {
updateIssuableLabels: {
errors: [],
issuable: {
+ updatedAt: '2023-02-10T22:26:49Z',
+ updatedBy: {
+ id: 'gid://gitlab/User/1',
+ avatarUrl: 'avatar/url',
+ name: 'John Smith',
+ username: 'jsmith',
+ webUrl: 'http://gdk.test:3000/jsmith',
+ __typename: 'UserCore',
+ },
__typename: 'Issue',
id: '1',
labels: {
diff --git a/spec/models/integrations/microsoft_teams_spec.rb b/spec/models/integrations/microsoft_teams_spec.rb
index c61cc732372..fa8900497d7 100644
--- a/spec/models/integrations/microsoft_teams_spec.rb
+++ b/spec/models/integrations/microsoft_teams_spec.rb
@@ -194,7 +194,7 @@ RSpec.describe Integrations::MicrosoftTeams do
end
describe 'Pipeline events' do
- let_it_be_with_reload(:project) { create(:project, :repository) }
+ let_it_be_with_refind(:project) { create(:project, :repository) }
let(:pipeline) do
create(:ci_pipeline,
diff --git a/spec/services/merge_requests/create_pipeline_service_spec.rb b/spec/services/merge_requests/create_pipeline_service_spec.rb
index 7984fff3031..f11e3d0d1df 100644
--- a/spec/services/merge_requests/create_pipeline_service_spec.rb
+++ b/spec/services/merge_requests/create_pipeline_service_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
RSpec.describe MergeRequests::CreatePipelineService, :clean_gitlab_redis_cache do
include ProjectForksHelper
- let_it_be(:project, reload: true) { create(:project, :repository) }
+ let_it_be(:project, refind: true) { create(:project, :repository) }
let_it_be(:user) { create(:user) }
let(:service) { described_class.new(project: project, current_user: actor, params: params) }
diff --git a/workhorse/go.mod b/workhorse/go.mod
index 25369798400..6e397a75019 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -6,7 +6,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.6.1
github.com/BurntSushi/toml v1.2.1
github.com/FZambia/sentinel v1.1.1
- github.com/alecthomas/chroma/v2 v2.4.0
+ github.com/alecthomas/chroma/v2 v2.5.0
github.com/aws/aws-sdk-go v1.44.199
github.com/disintegration/imaging v1.6.2
github.com/getsentry/raven-go v0.2.0
diff --git a/workhorse/go.sum b/workhorse/go.sum
index 838e40a4cc3..5e1d22d2fa1 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -509,10 +509,10 @@ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUW
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
-github.com/alecthomas/assert/v2 v2.2.0 h1:f6L/b7KE2bfA+9O4FL3CM/xJccDEwPVYd5fALBiuwvw=
-github.com/alecthomas/chroma/v2 v2.4.0 h1:Loe2ZjT5x3q1bcWwemqyqEi8p11/IV/ncFCeLYDpWC4=
-github.com/alecthomas/chroma/v2 v2.4.0/go.mod h1:6kHzqF5O6FUSJzBXW7fXELjb+e+7OXW4UpoPqMO7IBQ=
-github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
+github.com/alecthomas/assert/v2 v2.2.1 h1:XivOgYcduV98QCahG8T5XTezV5bylXe+lBxLG2K2ink=
+github.com/alecthomas/chroma/v2 v2.5.0 h1:CQCdj1BiBV17sD4Bd32b/Bzuiq/EqoNTrnIhyQAZ+Rk=
+github.com/alecthomas/chroma/v2 v2.5.0/go.mod h1:yrkMI9807G1ROx13fhe1v6PN2DDeaR73L3d+1nmYQtw=
+github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=