From ebfc70c3dfdcdfa3aeec2913d7fcdf81a0bfdaa8 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 6 Mar 2024 18:10:52 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/global.gitlab-ci.yml | 2 +- .rubocop_todo/layout/line_length.yml | 1 - .../rspec/factory_bot/avoid_create.yml | 1 - .rubocop_todo/rspec/feature_category.yml | 1 - .../get_pipeline_header_data.query.graphql | 1 + .../header/pipeline_details_header.vue | 6 +- .../comment_templates/components/form.vue | 7 +- .../javascripts/comment_templates/index.js | 5 + .../comment_templates/pages/edit.vue | 6 +- .../comment_templates/pages/index.vue | 8 +- .../gl_dropdown_filter.js | 17 ++-- app/assets/javascripts/entrypoints/main.js | 2 +- app/assets/javascripts/entrypoints/main_ee.js | 2 +- app/assets/javascripts/entrypoints/main_jh.js | 2 +- .../pages/profiles/comment_templates/index.js | 2 + .../javascripts/persistent_user_callouts.js | 1 - app/assets/javascripts/run_modules.js | 55 +++++++++-- app/assets/javascripts/users_select/index.js | 3 + .../concerns/protected_branch_access.rb | 7 ++ app/models/concerns/protected_ref.rb | 2 +- app/models/concerns/protected_ref_access.rb | 22 +++-- .../protected_ref_deploy_key_access.rb | 2 +- app/models/container_repository.rb | 23 ++++- app/models/users/callout.rb | 2 +- .../comment_templates/index.html.haml | 12 +-- .../shared/comment_templates/_page.html.haml | 13 +++ .../fetch_tags_from_registry_api.yml | 9 ++ .../settings/usage_statistics.md | 2 +- doc/api/database_migrations.md | 2 +- doc/api/graphql/reference/index.md | 1 - doc/api/instance_clusters.md | 2 +- doc/api/product_analytics.md | 6 +- doc/api/search_admin.md | 2 +- doc/api/sidekiq_metrics.md | 2 +- doc/ci/components/index.md | 60 +++++++----- doc/development/ai_features/duo_chat.md | 3 +- doc/development/geo/api.md | 2 +- doc/development/internal_api/index.md | 2 +- doc/development/testing_guide/flaky_tests.md | 8 ++ doc/integration/alicloud.md | 2 +- doc/integration/auth0.md | 2 +- doc/integration/azure.md | 2 +- doc/integration/bitbucket.md | 2 +- doc/integration/ding_talk.md | 2 +- doc/integration/facebook.md | 2 +- doc/integration/github.md | 2 +- doc/integration/gitlab.md | 2 +- doc/integration/gitpod.md | 2 +- doc/integration/google.md | 2 +- doc/integration/index.md | 4 - doc/integration/oauth2_generic.md | 2 +- doc/integration/oauth_provider.md | 4 +- doc/integration/omniauth.md | 2 +- doc/integration/openid_connect_provider.md | 2 +- doc/integration/salesforce.md | 2 +- doc/integration/saml.md | 2 +- doc/integration/twitter.md | 2 +- doc/security/crime_vulnerability.md | 2 +- .../responding_to_security_incidents.md | 40 -------- doc/security/ssh_keys_restrictions.md | 2 +- doc/security/two_factor_authentication.md | 2 +- doc/solutions/cloud/aws/gitaly_sre_for_aws.md | 2 +- .../cloud/aws/gitlab_single_box_on_aws.md | 2 +- doc/subscriptions/gitlab_dedicated/index.md | 4 + doc/user/analytics/analytics_dashboards.md | 8 +- .../offline_deployments/index.md | 2 +- doc/user/group/issues_analytics/index.md | 4 +- doc/user/group/saml_sso/troubleshooting.md | 6 ++ doc/user/instance/clusters/index.md | 2 +- doc/user/packages/debian_repository/index.md | 2 +- doc/user/profile/comment_templates.md | 4 +- doc/user/search/index.md | 2 +- lib/backup/manager.rb | 13 +-- lib/backup/targets/database.rb | 55 +++-------- lib/backup/targets/target.rb | 6 -- lib/backup/tasks/artifacts.rb | 10 +- lib/backup/tasks/builds.rb | 8 +- lib/backup/tasks/ci_secure_files.rb | 10 +- lib/backup/tasks/database.rb | 36 ++++++- lib/backup/tasks/lfs.rb | 8 +- lib/backup/tasks/packages.rb | 10 +- lib/backup/tasks/pages.rb | 11 +-- lib/backup/tasks/registry.rb | 8 +- lib/backup/tasks/repositories.rb | 6 +- lib/backup/tasks/task.rb | 61 +++++++----- lib/backup/tasks/terraform_state.rb | 10 +- lib/backup/tasks/uploads.rb | 10 +- lib/gitlab/internal_events.rb | 2 +- lib/gitlab/user_access.rb | 2 +- locale/gitlab.pot | 9 -- spec/features/issues/form_spec.rb | 3 +- .../list_users_comment_template_spec.rb | 2 +- .../user_creates_comment_template_spec.rb | 2 +- .../header/pipeline_details_header_spec.js | 12 +++ .../comment_templates/components/form_spec.js | 2 + spec/lib/backup/manager_spec.rb | 13 ++- spec/lib/backup/targets/database_spec.rb | 18 ++-- spec/lib/backup/tasks/database_spec.rb | 45 +++++++++ spec/lib/backup/tasks/task_spec.rb | 42 ++++++++ spec/lib/gitlab/internal_events_spec.rb | 9 +- spec/models/container_repository_spec.rb | 73 +++++++++++++- .../ci/pipeline_schedule_policy_spec.rb | 8 +- .../api/container_repositories_spec.rb | 96 ++++++++++++++++--- .../helpers/user_with_namespace_shim.yml | 1 - spec/support/rspec_order_todo.yml | 1 - .../container_registry_tags_shared_context.rb | 25 +++++ .../protected_branch_access_examples.rb | 46 ++++++++- 107 files changed, 747 insertions(+), 356 deletions(-) create mode 100644 app/views/shared/comment_templates/_page.html.haml create mode 100644 config/feature_flags/gitlab_com_derisk/fetch_tags_from_registry_api.yml create mode 100644 spec/lib/backup/tasks/database_spec.rb create mode 100644 spec/lib/backup/tasks/task_spec.rb create mode 100644 spec/support/shared_contexts/container_registry_tags_shared_context.rb diff --git a/.gitlab/ci/global.gitlab-ci.yml b/.gitlab/ci/global.gitlab-ci.yml index 891bd1aa7a5..06aee1cb022 100644 --- a/.gitlab/ci/global.gitlab-ci.yml +++ b/.gitlab/ci/global.gitlab-ci.yml @@ -302,7 +302,7 @@ .zoekt-services: services: - - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.7 + - name: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:zoekt-ci-image-1.8 alias: zoekt-ci-image .use-pg13: diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index c56dc79a9b4..4f5ab3880e2 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -2213,7 +2213,6 @@ Layout/LineLength: - 'ee/spec/views/projects/security/discover/show.html.haml_spec.rb' - 'ee/spec/views/shared/_mirror_status.html.haml_spec.rb' - 'ee/spec/views/shared/_namespace_user_cap_reached_alert.html.haml_spec.rb' - - 'ee/spec/views/shared/billings/_eoa_bronze_plan_banner.html.haml_spec.rb' - 'ee/spec/views/shared/billings/_trial_status.html.haml_spec.rb' - 'ee/spec/views/shared/credentials_inventory/personal_access_tokens/_personal_access_token.html.haml_spec.rb' - 'ee/spec/views/shared/promotions/_promotion_link_project.html.haml_spec.rb' diff --git a/.rubocop_todo/rspec/factory_bot/avoid_create.yml b/.rubocop_todo/rspec/factory_bot/avoid_create.yml index c6ad9169919..e0c0995b33c 100644 --- a/.rubocop_todo/rspec/factory_bot/avoid_create.yml +++ b/.rubocop_todo/rspec/factory_bot/avoid_create.yml @@ -225,7 +225,6 @@ RSpec/FactoryBot/AvoidCreate: - 'ee/spec/views/shared/_mirror_status.html.haml_spec.rb' - 'ee/spec/views/shared/_mirror_update_button.html.haml_spec.rb' - 'ee/spec/views/shared/_namespace_user_cap_reached_alert.html.haml_spec.rb' - - 'ee/spec/views/shared/billings/_eoa_bronze_plan_banner.html.haml_spec.rb' - 'ee/spec/views/shared/billings/_trial_status.html.haml_spec.rb' - 'ee/spec/views/shared/credentials_inventory/_expiry_date.html.haml_spec.rb' - 'ee/spec/views/shared/credentials_inventory/gpg_keys/_gpg_key.html.haml_spec.rb' diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index 4d93513a08e..aeed39b8464 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -1452,7 +1452,6 @@ RSpec/FeatureCategory: - 'ee/spec/views/shared/billings/_billing_plan.html.haml_spec.rb' - 'ee/spec/views/shared/billings/_billing_plan_actions.html.haml_spec.rb' - 'ee/spec/views/shared/billings/_billing_plans.html.haml_spec.rb' - - 'ee/spec/views/shared/billings/_eoa_bronze_plan_banner.html.haml_spec.rb' - 'ee/spec/views/shared/billings/_trial_status.html.haml_spec.rb' - 'ee/spec/views/shared/credentials_inventory/_expiry_date.html.haml_spec.rb' - 'ee/spec/views/shared/credentials_inventory/gpg_keys/_gpg_key.html.haml_spec.rb' diff --git a/app/assets/javascripts/ci/pipeline_details/header/graphql/queries/get_pipeline_header_data.query.graphql b/app/assets/javascripts/ci/pipeline_details/header/graphql/queries/get_pipeline_header_data.query.graphql index dfcbe87fca1..d0baf890b14 100644 --- a/app/assets/javascripts/ci/pipeline_details/header/graphql/queries/get_pipeline_header_data.query.graphql +++ b/app/assets/javascripts/ci/pipeline_details/header/graphql/queries/get_pipeline_header_data.query.graphql @@ -35,6 +35,7 @@ query getPipelineHeaderData($fullPath: ID!, $iid: ID!) { } commit { id + sha shortId title webPath diff --git a/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue b/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue index 9114397036a..27e1f75f0db 100644 --- a/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue +++ b/app/assets/javascripts/ci/pipeline_details/header/pipeline_details_header.vue @@ -231,6 +231,9 @@ export default { shortId() { return this.pipeline?.commit?.shortId || ''; }, + commitSha() { + return this.pipeline?.commit?.sha || ''; + }, commitPath() { return this.pipeline?.commit?.webPath || ''; }, @@ -462,9 +465,10 @@ export default {
diff --git a/app/assets/javascripts/comment_templates/components/form.vue b/app/assets/javascripts/comment_templates/components/form.vue index 2de776a134a..8c68a680462 100644 --- a/app/assets/javascripts/comment_templates/components/form.vue +++ b/app/assets/javascripts/comment_templates/components/form.vue @@ -18,7 +18,11 @@ export default { MarkdownEditor, }, mixins: [InternalEvents.mixin()], - inject: ['createMutation', 'updateMutation'], + inject: { + namespaceId: { default: undefined }, + createMutation: { required: true }, + updateMutation: { required: true }, + }, props: { id: { type: String, @@ -93,6 +97,7 @@ export default { .mutate({ mutation: this.id ? this.updateMutation : this.createMutation, variables: { + namespaceId: this.namespaceId, id: this.id, name: this.updateCommentTemplate.name, content: this.updateCommentTemplate.content, diff --git a/app/assets/javascripts/comment_templates/index.js b/app/assets/javascripts/comment_templates/index.js index 62d526f06bd..a111dda1624 100644 --- a/app/assets/javascripts/comment_templates/index.js +++ b/app/assets/javascripts/comment_templates/index.js @@ -6,6 +6,8 @@ import routes from './routes'; import App from './components/app.vue'; export const initCommentTemplates = ({ + savedReplyType, + path, fetchAllQuery, fetchSingleQuery, createMutation, @@ -31,6 +33,9 @@ export const initCommentTemplates = ({ router, apolloProvider, provide: { + path, + namespaceId: el.dataset.namespaceId, + savedReplyType, fetchAllQuery, fetchSingleQuery, createMutation, diff --git a/app/assets/javascripts/comment_templates/pages/edit.vue b/app/assets/javascripts/comment_templates/pages/edit.vue index eabc667def1..fd125533a44 100644 --- a/app/assets/javascripts/comment_templates/pages/edit.vue +++ b/app/assets/javascripts/comment_templates/pages/edit.vue @@ -5,7 +5,6 @@ import { fetchPolicies } from '~/lib/graphql'; import { createAlert } from '~/alert'; import { __ } from '~/locale'; import { convertToGraphQLId } from '~/graphql_shared/utils'; -import { TYPE_USERS_SAVED_REPLY } from '~/graphql_shared/constants'; import CreateForm from '../components/form.vue'; export default { @@ -21,7 +20,8 @@ export default { }, variables() { return { - id: convertToGraphQLId(TYPE_USERS_SAVED_REPLY, this.$route.params.id), + id: convertToGraphQLId(this.savedReplyType, this.$route.params.id), + path: this.path, }; }, update: (r) => r.object.savedReply, @@ -40,7 +40,7 @@ export default { }, }, }, - inject: ['fetchSingleQuery'], + inject: ['path', 'fetchSingleQuery', 'savedReplyType'], data() { return { savedReply: null, diff --git a/app/assets/javascripts/comment_templates/pages/index.vue b/app/assets/javascripts/comment_templates/pages/index.vue index b6efcad4bd7..29e37b16476 100644 --- a/app/assets/javascripts/comment_templates/pages/index.vue +++ b/app/assets/javascripts/comment_templates/pages/index.vue @@ -15,6 +15,7 @@ export default { update: (r) => r.object?.savedReplies?.nodes, variables() { return { + path: this.path, ...this.pagination, }; }, @@ -37,7 +38,10 @@ export default { CreateForm, List, }, - inject: ['fetchAllQuery'], + inject: { + path: { default: '' }, + fetchAllQuery: { required: true }, + }, data() { return { savedReplies: [], @@ -72,7 +76,7 @@ export default {