diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-11 00:14:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2024-01-11 00:14:41 +0300 |
commit | 853e0ceb61507ce55521776c84bc77b4e802c66e (patch) | |
tree | 97b0a26e438d6ef1579ebe7f65d4886f5dc7594d | |
parent | 9dbe80c7d52d682aaf431790d9011d7c2912b85c (diff) |
Add latest changes from gitlab-org/gitlab@master
40 files changed, 399 insertions, 128 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb29a7bb930..7998dbd8b96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -186,6 +186,7 @@ variables: CHROME_VERSION: "119" DOCKER_VERSION: "24.0.5" RUBYGEMS_VERSION: "3.4" + BUNDLER_VERSION: "2.5" GO_VERSION: "1.20" RUST_VERSION: "1.73" diff --git a/.gitlab/ci/preflight.gitlab-ci.yml b/.gitlab/ci/preflight.gitlab-ci.yml index f4038d48366..426d36b24f4 100644 --- a/.gitlab/ci/preflight.gitlab-ci.yml +++ b/.gitlab/ci/preflight.gitlab-ci.yml @@ -5,7 +5,7 @@ needs: [] .qa-preflight-job: - image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION} + image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION} extends: - .preflight-job-base - .qa-cache diff --git a/.gitlab/ci/qa-common/main.gitlab-ci.yml b/.gitlab/ci/qa-common/main.gitlab-ci.yml index 6ce47a62b00..1895c857410 100644 --- a/.gitlab/ci/qa-common/main.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/main.gitlab-ci.yml @@ -36,7 +36,7 @@ stages: .ruby-image: # Because this pipeline template can be included directly in other projects, # image path and registry needs to be defined explicitly - image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3 + image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION} .bundler-variables: variables: diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index a77a8bfd252..2aea64583da 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -1,5 +1,5 @@ .qa-job-base: - image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION} + image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION} extends: - .default-retry - .qa-cache @@ -27,6 +27,7 @@ variables: - CHROME_VERSION - RUBY_VERSION + - BUNDLER_VERSION - DOCKER_VERSION - DEBIAN_VERSION - REGISTRY_GROUP diff --git a/.gitlab/ci/review-apps/qa.gitlab-ci.yml b/.gitlab/ci/review-apps/qa.gitlab-ci.yml index 8ea51fd89ea..1aa2272492e 100644 --- a/.gitlab/ci/review-apps/qa.gitlab-ci.yml +++ b/.gitlab/ci/review-apps/qa.gitlab-ci.yml @@ -15,7 +15,7 @@ review-qa-smoke: - .bundle-base - .default-retry - .rules:qa-smoke - image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 + image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 stage: qa needs: [review-deploy] variables: diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index d2bbc22625c..99ff65180c1 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -97,6 +97,7 @@ start-review-app-pipeline: - DEBIAN_VERSION - DOCKER_VERSION - CHROME_VERSION + - BUNDLER_VERSION # These variables are set in the pipeline schedules. # They need to be explicitly passed on to the child pipeline. diff --git a/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml b/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml index 5e7da62bc7e..186025eff71 100644 --- a/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml +++ b/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml @@ -42,7 +42,7 @@ include: - !reference [.rules:test:manual, rules] .gdk-qa-base: - image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 + image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 extends: - .qa-cache - .default-retry @@ -367,7 +367,7 @@ gem 'gitlab-http', path: 'gems/gitlab-http' # rubocop:todo Gemfile/MissingFeatur gem 'premailer-rails', '~> 1.10.3' # rubocop:todo Gemfile/MissingFeatureCategory -gem 'gitlab-labkit', '~> 0.34.0' # rubocop:todo Gemfile/MissingFeatureCategory +gem 'gitlab-labkit', '~> 0.35.0' # rubocop:todo Gemfile/MissingFeatureCategory gem 'thrift', '>= 0.16.0' # rubocop:todo Gemfile/MissingFeatureCategory # I18n @@ -559,7 +559,7 @@ gem 'kas-grpc', '~> 0.3.0', feature_category: :deployment_management gem 'grpc', '~> 1.58.0' # rubocop:todo Gemfile/MissingFeatureCategory -gem 'google-protobuf', '~> 3.25', '>= 3.25.1' # rubocop:todo Gemfile/MissingFeatureCategory +gem 'google-protobuf', '~> 3.25', '>= 3.25.2' # rubocop:todo Gemfile/MissingFeatureCategory gem 'toml-rb', '~> 2.2.0' # rubocop:todo Gemfile/MissingFeatureCategory diff --git a/Gemfile.checksum b/Gemfile.checksum index d716dd03c62..1e0c8b60a46 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -217,7 +217,7 @@ {"name":"gitlab-glfm-markdown","version":"0.0.10","platform":"ruby","checksum":"0310b60304d0a7e6c1bf79f0e6b9ab3cf44befd79a1a9897264f4b4072c17459"}, {"name":"gitlab-glfm-markdown","version":"0.0.10","platform":"x86_64-darwin","checksum":"5f5b054cdf8a514ff3fae96b9a86a16933d67ef90f25381a47f769ee96b30a4f"}, {"name":"gitlab-glfm-markdown","version":"0.0.10","platform":"x86_64-linux","checksum":"ce623675f0206d62520384fdd49f2aab9f4586c4f5cbb74362f390bda73dec97"}, -{"name":"gitlab-labkit","version":"0.34.0","platform":"ruby","checksum":"ca5c504201390cd07ba1029e6ca3059f4e2e6005eb121ba8a103af1e166a3ecd"}, +{"name":"gitlab-labkit","version":"0.35.0","platform":"ruby","checksum":"26ff06aa4e34ee7b01ead44cc56d01e45822845da70408ca35ff3b20e3c84679"}, {"name":"gitlab-license","version":"2.3.0","platform":"ruby","checksum":"60cae3871c46607dde58994faf761c6755adc61133a92e5ab59ab26a8b9b4157"}, {"name":"gitlab-mail_room","version":"0.0.24","platform":"ruby","checksum":"c7bf3df73dbcc024bc98dbf72514520ac2ff2b6d0124de496279fe56c13c3cb3"}, {"name":"gitlab-markup","version":"1.9.0","platform":"ruby","checksum":"7eda045a08ec2d110084252fa13a8c9eac8bdac0e302035ca7db4b82bcbd7ed4"}, @@ -249,16 +249,16 @@ {"name":"google-cloud-errors","version":"1.3.0","platform":"ruby","checksum":"450b681e24c089a20721a01acc4408bb4a7b0df28c175aaab488da917480d64b"}, {"name":"google-cloud-profiler-v2","version":"0.4.0","platform":"ruby","checksum":"53fc2ab175d08f54233c644310d47798feac996220916815c4fb44c937b5d3e3"}, {"name":"google-cloud-storage","version":"1.45.0","platform":"ruby","checksum":"f280abda4e608f9e91433f9dd907be4a45cdbf251ffeb275d713548e515c6300"}, -{"name":"google-protobuf","version":"3.25.1","platform":"aarch64-linux","checksum":"ac359f7dff48444fee35b1720d5fe4c3a15e1ce1d1cf2b01720e78e0c3c60e59"}, -{"name":"google-protobuf","version":"3.25.1","platform":"arm64-darwin","checksum":"9db6f8a7185d0109934db2f68defff7cba36b0e5816eb3b7aff8c35c61ac4cb5"}, -{"name":"google-protobuf","version":"3.25.1","platform":"java","checksum":"e02d624fafa42ddd27770ab3824d90fd5833dfc22e5778f4b72f5e33823795cf"}, -{"name":"google-protobuf","version":"3.25.1","platform":"ruby","checksum":"e740e099193f8dc4db638326e23868d6c799dbd5ae2fd7565e78d1530cc6d1a3"}, -{"name":"google-protobuf","version":"3.25.1","platform":"x64-mingw-ucrt","checksum":"33f9ef7fb931d4f9226bf7c5e6dc7965d71be65202ddab5f918e11d2b094c247"}, -{"name":"google-protobuf","version":"3.25.1","platform":"x64-mingw32","checksum":"61aad72c3db95719d39d371127124667f2bf136f09050fe74ca9c5e7b84b70de"}, -{"name":"google-protobuf","version":"3.25.1","platform":"x86-linux","checksum":"621ea865943efb085810dd76f35913aa9a8aff24ea358fd96b58291d9067f2a1"}, -{"name":"google-protobuf","version":"3.25.1","platform":"x86-mingw32","checksum":"94974547d65cf72fa5474dc43e18148d6478f3271fa81531c8333940b07779fd"}, -{"name":"google-protobuf","version":"3.25.1","platform":"x86_64-darwin","checksum":"48324e6f17f4a6b478d9f6c844e333ef4d88d82558c44ef87c588adba3a5ff40"}, -{"name":"google-protobuf","version":"3.25.1","platform":"x86_64-linux","checksum":"956d89256ed61cd0407a4e635a2286b8d478ca98075f4f398c30f91b765e9c54"}, +{"name":"google-protobuf","version":"3.25.2","platform":"aarch64-linux","checksum":"d2b18fbcb816d72d0c1c7d874fa618eaf61e2fc26c86462c32dc4dbf7ec20065"}, +{"name":"google-protobuf","version":"3.25.2","platform":"arm64-darwin","checksum":"c1dab355ff82accc23f5ce047c077f04babd2d84ff6ec1cf5d2cf56689554eee"}, +{"name":"google-protobuf","version":"3.25.2","platform":"java","checksum":"f379c7384d4d42a85746b2c735be9d5ea43e204c174a7d3d42460cd44236e93a"}, +{"name":"google-protobuf","version":"3.25.2","platform":"ruby","checksum":"9c2e6121d768f812f50b78cb6f26056f2af6bab92af793d376b772126e26500b"}, +{"name":"google-protobuf","version":"3.25.2","platform":"x64-mingw-ucrt","checksum":"45e1c1ed343fd0e0742f4fd75b1ce0ec88725f8f41ba2fe14bd710a9d37d9006"}, +{"name":"google-protobuf","version":"3.25.2","platform":"x64-mingw32","checksum":"d2b64779a8dfa689dbb2c9afe1d5da02a5d31225168d456a42af33e3838d59e3"}, +{"name":"google-protobuf","version":"3.25.2","platform":"x86-linux","checksum":"741d2504d66872b0b2bd6f5f76337ea0ea41b4d480da1a7632787a2c20d2fefc"}, +{"name":"google-protobuf","version":"3.25.2","platform":"x86-mingw32","checksum":"1be544c9a6c8b099739cb5ad43009bb7a692b7e422c8b0c80cb4a8ffcba8d44a"}, +{"name":"google-protobuf","version":"3.25.2","platform":"x86_64-darwin","checksum":"8865652e25d56e4caa51d441348d55ff5fd7c20e751b6b72dc39b4303c394b40"}, +{"name":"google-protobuf","version":"3.25.2","platform":"x86_64-linux","checksum":"95dec88caf1caab1aa3810c9e5d98fbbb6359d27024d13403b0583b592436cd4"}, {"name":"googleapis-common-protos","version":"1.4.0","platform":"ruby","checksum":"da2380fb5ab1563580816c74e8d684ac17512c3654c829a3ee84f6d6139de382"}, {"name":"googleapis-common-protos-types","version":"1.5.0","platform":"ruby","checksum":"5769cf7376abc86ef7f5897a4aaca1d5c5a3c49ddabeddd2c251fcf8155f858b"}, {"name":"googleauth","version":"1.3.0","platform":"ruby","checksum":"51dd7362353cf1e90a2d01e1fb94321ae3926c776d4dc4a79db65230217ffcc2"}, diff --git a/Gemfile.lock b/Gemfile.lock index 6d3c3146da5..47f05f0cb39 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -696,13 +696,13 @@ GEM mime-types gitlab-glfm-markdown (0.0.10) rb_sys (~> 0.9.86) - gitlab-labkit (0.34.0) + gitlab-labkit (0.35.0) actionpack (>= 5.0.0, < 8.0.0) activesupport (>= 5.0.0, < 8.0.0) grpc (>= 1.37) jaeger-client (~> 1.1.0) opentracing (~> 0.4) - pg_query (~> 4.2.3) + pg_query (>= 4.2.3, < 6.0) redis (> 3.0.0, < 6.0.0) gitlab-license (2.3.0) gitlab-mail_room (0.0.24) @@ -801,7 +801,7 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - google-protobuf (3.25.1) + google-protobuf (3.25.2) googleapis-common-protos (1.4.0) google-protobuf (~> 3.14) googleapis-common-protos-types (~> 1.2) @@ -1896,7 +1896,7 @@ DEPENDENCIES gitlab-glfm-markdown (~> 0.0.10) gitlab-housekeeper! gitlab-http! - gitlab-labkit (~> 0.34.0) + gitlab-labkit (~> 0.35.0) gitlab-license (~> 2.3) gitlab-mail_room (~> 0.0.24) gitlab-markup (~> 1.9.0) @@ -1926,7 +1926,7 @@ DEPENDENCIES google-apis-sqladmin_v1beta4 (~> 0.41.0) google-apis-storage_v1 (~> 0.29) google-cloud-storage (~> 1.45.0) - google-protobuf (~> 3.25, >= 3.25.1) + google-protobuf (~> 3.25, >= 3.25.2) gpgme (~> 2.0.23) grape (~> 2.0.0) grape-entity (~> 0.10.0) diff --git a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue index 19fdcc31b17..ccafec0fb7a 100644 --- a/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue +++ b/app/assets/javascripts/ci/ci_variable_list/components/ci_variable_drawer.vue @@ -496,8 +496,8 @@ export default { v-model="variable.value" :spellcheck="false" class="gl-border-none gl-font-monospace!" - rows="3" - max-rows="10" + rows="5" + :no-resize="false" data-testid="ci-variable-value" /> <p diff --git a/app/assets/javascripts/notes/components/notes_app.vue b/app/assets/javascripts/notes/components/notes_app.vue index 2524b9efdb6..86f93ee425e 100644 --- a/app/assets/javascripts/notes/components/notes_app.vue +++ b/app/assets/javascripts/notes/components/notes_app.vue @@ -1,6 +1,7 @@ <script> // eslint-disable-next-line no-restricted-imports import { mapGetters, mapActions } from 'vuex'; +import { v4 as uuidv4 } from 'uuid'; import highlightCurrentUser from '~/behaviors/markdown/highlight_current_user'; import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue'; import OrderedLayout from '~/vue_shared/components/ordered_layout.vue'; @@ -39,6 +40,11 @@ export default { AiSummary: () => import('ee_component/notes/components/ai_summary.vue'), }, mixins: [glFeatureFlagsMixin()], + provide() { + return { + summarizeClientSubscriptionId: uuidv4(), + }; + }, props: { noteableData: { type: Object, diff --git a/app/finders/groups/accepting_project_shares_finder.rb b/app/finders/groups/accepting_project_shares_finder.rb index c85e5a0f538..cf20292318e 100644 --- a/app/finders/groups/accepting_project_shares_finder.rb +++ b/app/finders/groups/accepting_project_shares_finder.rb @@ -42,7 +42,12 @@ module Groups # rubocop: disable CodeReuse/Finder def groups_with_guest_access_plus - GroupsFinder.new(current_user, min_access_level: Gitlab::Access::GUEST).execute + groups = GroupsFinder.new(current_user, min_access_level: Gitlab::Access::GUEST).execute + + # We move the result into a materialized CTE to improve query performance during text search. + union_query = ::Group.from_union([groups]) + cte = Gitlab::SQL::CTE.new(:my_union_cte, union_query) + Group.with(cte.to_arel).from(cte.alias_to(Group.arel_table)) # rubocop: disable CodeReuse/ActiveRecord -- CTE use end # rubocop: enable CodeReuse/Finder diff --git a/app/graphql/types/permission_types/issue.rb b/app/graphql/types/permission_types/issue.rb index a76dc88adfc..65586b384be 100644 --- a/app/graphql/types/permission_types/issue.rb +++ b/app/graphql/types/permission_types/issue.rb @@ -8,7 +8,7 @@ module Types abilities :read_issue, :admin_issue, :update_issue, :reopen_issue, :read_design, :create_design, :destroy_design, - :create_note, :update_design + :create_note, :update_design, :admin_issue_relation end end end diff --git a/app/models/users/callout.rb b/app/models/users/callout.rb index 06e2f85ddb3..8d330e4eb6e 100644 --- a/app/models/users/callout.rb +++ b/app/models/users/callout.rb @@ -80,7 +80,8 @@ module Users new_nav_for_everyone_callout: 78, code_suggestions_ga_non_owner_alert: 79, # EE-only duo_chat_callout: 80, # EE-only - code_suggestions_ga_owner_alert: 81 # EE-only + code_suggestions_ga_owner_alert: 81, # EE-only + product_analytics_dashboard_feedback: 82 # EE-only } validates :feature_name, diff --git a/app/serializers/admin/abuse_report_details_entity.rb b/app/serializers/admin/abuse_report_details_entity.rb index 81a054cb115..414517dc77e 100644 --- a/app/serializers/admin/abuse_report_details_entity.rb +++ b/app/serializers/admin/abuse_report_details_entity.rb @@ -17,12 +17,6 @@ module Admin admin_user_path(report.user) end - expose :plan do |report| - if Gitlab::CurrentSettings.current_application_settings.try(:should_check_namespace_plan?) - report.user.namespace&.actual_plan&.title - end - end - expose :verification_state do expose :email do |report| report.user.confirmed? @@ -91,3 +85,5 @@ module Admin end end end + +Admin::AbuseReportDetailsEntity.prepend_mod_with('Admin::AbuseReportDetailsEntity') diff --git a/app/views/layouts/header/_super_sidebar_logged_out.haml b/app/views/layouts/header/_super_sidebar_logged_out.haml index fc63400e011..9b0424ea478 100644 --- a/app/views/layouts/header/_super_sidebar_logged_out.haml +++ b/app/views/layouts/header/_super_sidebar_logged_out.haml @@ -2,7 +2,7 @@ %a.gl-sr-only.gl-accessibility{ href: "#content-body" } Skip to content .container-fluid %nav.header-logged-out-nav.gl-display-flex.gl-gap-3.gl-justify-content-space-between{ 'aria-label': s_('LoggedOutMarketingHeader|Explore GitLab') } - .header-logged-out-logo.gl-display-flex.gl-align-items-center + .header-logged-out-logo.gl-display-flex.gl-align-items-center.gl-gap-3 %span.gl-sr-only GitLab = link_to root_path, title: _('Homepage'), id: 'logo', class: 'has-tooltip', aria: { label: _('Homepage') }, **tracking_attrs('main_navigation', 'click_gitlab_logo_link', 'navigation_top') do = brand_header_logo diff --git a/config/feature_flags/development/bulk_create_scan_result_policies.yml b/config/feature_flags/development/bulk_create_scan_result_policies.yml new file mode 100644 index 00000000000..35a1c5a6deb --- /dev/null +++ b/config/feature_flags/development/bulk_create_scan_result_policies.yml @@ -0,0 +1,8 @@ +--- +name: bulk_create_scan_result_policies +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139163 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/435958 +milestone: '16.8' +type: development +group: group::security policies +default_enabled: false diff --git a/config/feature_flags/gitlab_com_derisk/allow_members_to_see_invited_groups_in_access_dropdowns.yml b/config/feature_flags/gitlab_com_derisk/allow_members_to_see_invited_groups_in_access_dropdowns.yml new file mode 100644 index 00000000000..5f394ef3fd3 --- /dev/null +++ b/config/feature_flags/gitlab_com_derisk/allow_members_to_see_invited_groups_in_access_dropdowns.yml @@ -0,0 +1,9 @@ +--- +name: allow_members_to_see_invited_groups_in_access_dropdowns +feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/345140 +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/140927 +rollout_issue_url: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/17364 +milestone: '16.8' +group: group::source code +type: gitlab_com_derisk +default_enabled: false diff --git a/db/docs/batched_background_migrations/backfill_issue_search_data_namespace_id.yml b/db/docs/batched_background_migrations/backfill_issue_search_data_namespace_id.yml new file mode 100644 index 00000000000..5f4ac80ff65 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_issue_search_data_namespace_id.yml @@ -0,0 +1,8 @@ +--- +migration_job_name: BackfillIssueSearchDataNamespaceId +description: Backfills issue_search_data.namespace_id from issues.namespace_id. This will be used for repartitioning the table. +feature_category: team_planning +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128010 +milestone: '16.8' +queued_migration_version: 20240105144908 +finalize_after: '2024-02-22' diff --git a/db/post_migrate/20240105120320_disable_fastupdate_on_issue_search_data.rb b/db/post_migrate/20240105120320_disable_fastupdate_on_issue_search_data.rb new file mode 100644 index 00000000000..b7271fa5f51 --- /dev/null +++ b/db/post_migrate/20240105120320_disable_fastupdate_on_issue_search_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +class DisableFastupdateOnIssueSearchData < Gitlab::Database::Migration[2.2] + milestone '16.8' + + disable_ddl_transaction! + + NUM_PARTITIONS = 64 + + def up + each_index_name do |index_name| + with_lock_retries do + execute <<~SQL + ALTER INDEX #{index_name} SET ( fastupdate = false ) ; + SQL + end + end + end + + def down + each_index_name do |index_name| + with_lock_retries do + execute <<~SQL + ALTER INDEX #{index_name} RESET ( fastupdate ) ; + SQL + end + end + end + + private + + def each_index_name + NUM_PARTITIONS.times do |partition| + yield "gitlab_partitions_static.issue_search_data_#{format('%02d', partition)}_search_vector_idx" + end + end +end diff --git a/db/post_migrate/20240105144908_queue_backfill_issue_search_data_namespace_id.rb b/db/post_migrate/20240105144908_queue_backfill_issue_search_data_namespace_id.rb new file mode 100644 index 00000000000..f12041e613f --- /dev/null +++ b/db/post_migrate/20240105144908_queue_backfill_issue_search_data_namespace_id.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class QueueBackfillIssueSearchDataNamespaceId < Gitlab::Database::Migration[2.2] + milestone '16.8' + + MIGRATION = "BackfillIssueSearchDataNamespaceId" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 1_000 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :issues, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :issues, :id, []) + end +end diff --git a/db/post_migrate/20240109165047_add_index_project_id_component_version_id_id_on_sbom_occurrences.rb b/db/post_migrate/20240109165047_add_index_project_id_component_version_id_id_on_sbom_occurrences.rb new file mode 100644 index 00000000000..123d665f625 --- /dev/null +++ b/db/post_migrate/20240109165047_add_index_project_id_component_version_id_id_on_sbom_occurrences.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexProjectIdComponentVersionIdIdOnSbomOccurrences < Gitlab::Database::Migration[2.2] + INDEX_NAME = 'index_sbom_occurr_on_project_id_and_component_version_id_and_id' + + disable_ddl_transaction! + milestone '16.8' + + def up + add_concurrent_index :sbom_occurrences, [:project_id, :component_version_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_occurrence, INDEX_NAME + end +end diff --git a/db/schema_migrations/20240105120320 b/db/schema_migrations/20240105120320 new file mode 100644 index 00000000000..0c06c3ce42a --- /dev/null +++ b/db/schema_migrations/20240105120320 @@ -0,0 +1 @@ +f56668c85ef90efb1c4ef4e959ed23803670c164c557baa0bc3dc1241d55f002
\ No newline at end of file diff --git a/db/schema_migrations/20240105144908 b/db/schema_migrations/20240105144908 new file mode 100644 index 00000000000..5183b5b9aac --- /dev/null +++ b/db/schema_migrations/20240105144908 @@ -0,0 +1 @@ +a86ea4736f6f0357c78535111468a273e61b742d5b5b3ddc09fe5177e1bc77c8
\ No newline at end of file diff --git a/db/schema_migrations/20240109165047 b/db/schema_migrations/20240109165047 new file mode 100644 index 00000000000..245a4a009aa --- /dev/null +++ b/db/schema_migrations/20240109165047 @@ -0,0 +1 @@ +026e113720d6920cefc0ad6b894930ce486abe043568d6dde1d047b679dd8b44
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 8c77da4afc5..46631ec83c1 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -31548,259 +31548,259 @@ CREATE INDEX issue_search_data_00_issue_id_idx ON gitlab_partitions_static.issue CREATE INDEX index_issue_search_data_on_search_vector ON ONLY issue_search_data USING gin (search_vector); -CREATE INDEX issue_search_data_00_search_vector_idx ON gitlab_partitions_static.issue_search_data_00 USING gin (search_vector); +CREATE INDEX issue_search_data_00_search_vector_idx ON gitlab_partitions_static.issue_search_data_00 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_01_issue_id_idx ON gitlab_partitions_static.issue_search_data_01 USING btree (issue_id); -CREATE INDEX issue_search_data_01_search_vector_idx ON gitlab_partitions_static.issue_search_data_01 USING gin (search_vector); +CREATE INDEX issue_search_data_01_search_vector_idx ON gitlab_partitions_static.issue_search_data_01 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_02_issue_id_idx ON gitlab_partitions_static.issue_search_data_02 USING btree (issue_id); -CREATE INDEX issue_search_data_02_search_vector_idx ON gitlab_partitions_static.issue_search_data_02 USING gin (search_vector); +CREATE INDEX issue_search_data_02_search_vector_idx ON gitlab_partitions_static.issue_search_data_02 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_03_issue_id_idx ON gitlab_partitions_static.issue_search_data_03 USING btree (issue_id); -CREATE INDEX issue_search_data_03_search_vector_idx ON gitlab_partitions_static.issue_search_data_03 USING gin (search_vector); +CREATE INDEX issue_search_data_03_search_vector_idx ON gitlab_partitions_static.issue_search_data_03 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_04_issue_id_idx ON gitlab_partitions_static.issue_search_data_04 USING btree (issue_id); -CREATE INDEX issue_search_data_04_search_vector_idx ON gitlab_partitions_static.issue_search_data_04 USING gin (search_vector); +CREATE INDEX issue_search_data_04_search_vector_idx ON gitlab_partitions_static.issue_search_data_04 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_05_issue_id_idx ON gitlab_partitions_static.issue_search_data_05 USING btree (issue_id); -CREATE INDEX issue_search_data_05_search_vector_idx ON gitlab_partitions_static.issue_search_data_05 USING gin (search_vector); +CREATE INDEX issue_search_data_05_search_vector_idx ON gitlab_partitions_static.issue_search_data_05 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_06_issue_id_idx ON gitlab_partitions_static.issue_search_data_06 USING btree (issue_id); -CREATE INDEX issue_search_data_06_search_vector_idx ON gitlab_partitions_static.issue_search_data_06 USING gin (search_vector); +CREATE INDEX issue_search_data_06_search_vector_idx ON gitlab_partitions_static.issue_search_data_06 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_07_issue_id_idx ON gitlab_partitions_static.issue_search_data_07 USING btree (issue_id); -CREATE INDEX issue_search_data_07_search_vector_idx ON gitlab_partitions_static.issue_search_data_07 USING gin (search_vector); +CREATE INDEX issue_search_data_07_search_vector_idx ON gitlab_partitions_static.issue_search_data_07 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_08_issue_id_idx ON gitlab_partitions_static.issue_search_data_08 USING btree (issue_id); -CREATE INDEX issue_search_data_08_search_vector_idx ON gitlab_partitions_static.issue_search_data_08 USING gin (search_vector); +CREATE INDEX issue_search_data_08_search_vector_idx ON gitlab_partitions_static.issue_search_data_08 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_09_issue_id_idx ON gitlab_partitions_static.issue_search_data_09 USING btree (issue_id); -CREATE INDEX issue_search_data_09_search_vector_idx ON gitlab_partitions_static.issue_search_data_09 USING gin (search_vector); +CREATE INDEX issue_search_data_09_search_vector_idx ON gitlab_partitions_static.issue_search_data_09 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_10_issue_id_idx ON gitlab_partitions_static.issue_search_data_10 USING btree (issue_id); -CREATE INDEX issue_search_data_10_search_vector_idx ON gitlab_partitions_static.issue_search_data_10 USING gin (search_vector); +CREATE INDEX issue_search_data_10_search_vector_idx ON gitlab_partitions_static.issue_search_data_10 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_11_issue_id_idx ON gitlab_partitions_static.issue_search_data_11 USING btree (issue_id); -CREATE INDEX issue_search_data_11_search_vector_idx ON gitlab_partitions_static.issue_search_data_11 USING gin (search_vector); +CREATE INDEX issue_search_data_11_search_vector_idx ON gitlab_partitions_static.issue_search_data_11 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_12_issue_id_idx ON gitlab_partitions_static.issue_search_data_12 USING btree (issue_id); -CREATE INDEX issue_search_data_12_search_vector_idx ON gitlab_partitions_static.issue_search_data_12 USING gin (search_vector); +CREATE INDEX issue_search_data_12_search_vector_idx ON gitlab_partitions_static.issue_search_data_12 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_13_issue_id_idx ON gitlab_partitions_static.issue_search_data_13 USING btree (issue_id); -CREATE INDEX issue_search_data_13_search_vector_idx ON gitlab_partitions_static.issue_search_data_13 USING gin (search_vector); +CREATE INDEX issue_search_data_13_search_vector_idx ON gitlab_partitions_static.issue_search_data_13 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_14_issue_id_idx ON gitlab_partitions_static.issue_search_data_14 USING btree (issue_id); -CREATE INDEX issue_search_data_14_search_vector_idx ON gitlab_partitions_static.issue_search_data_14 USING gin (search_vector); +CREATE INDEX issue_search_data_14_search_vector_idx ON gitlab_partitions_static.issue_search_data_14 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_15_issue_id_idx ON gitlab_partitions_static.issue_search_data_15 USING btree (issue_id); -CREATE INDEX issue_search_data_15_search_vector_idx ON gitlab_partitions_static.issue_search_data_15 USING gin (search_vector); +CREATE INDEX issue_search_data_15_search_vector_idx ON gitlab_partitions_static.issue_search_data_15 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_16_issue_id_idx ON gitlab_partitions_static.issue_search_data_16 USING btree (issue_id); -CREATE INDEX issue_search_data_16_search_vector_idx ON gitlab_partitions_static.issue_search_data_16 USING gin (search_vector); +CREATE INDEX issue_search_data_16_search_vector_idx ON gitlab_partitions_static.issue_search_data_16 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_17_issue_id_idx ON gitlab_partitions_static.issue_search_data_17 USING btree (issue_id); -CREATE INDEX issue_search_data_17_search_vector_idx ON gitlab_partitions_static.issue_search_data_17 USING gin (search_vector); +CREATE INDEX issue_search_data_17_search_vector_idx ON gitlab_partitions_static.issue_search_data_17 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_18_issue_id_idx ON gitlab_partitions_static.issue_search_data_18 USING btree (issue_id); -CREATE INDEX issue_search_data_18_search_vector_idx ON gitlab_partitions_static.issue_search_data_18 USING gin (search_vector); +CREATE INDEX issue_search_data_18_search_vector_idx ON gitlab_partitions_static.issue_search_data_18 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_19_issue_id_idx ON gitlab_partitions_static.issue_search_data_19 USING btree (issue_id); -CREATE INDEX issue_search_data_19_search_vector_idx ON gitlab_partitions_static.issue_search_data_19 USING gin (search_vector); +CREATE INDEX issue_search_data_19_search_vector_idx ON gitlab_partitions_static.issue_search_data_19 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_20_issue_id_idx ON gitlab_partitions_static.issue_search_data_20 USING btree (issue_id); -CREATE INDEX issue_search_data_20_search_vector_idx ON gitlab_partitions_static.issue_search_data_20 USING gin (search_vector); +CREATE INDEX issue_search_data_20_search_vector_idx ON gitlab_partitions_static.issue_search_data_20 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_21_issue_id_idx ON gitlab_partitions_static.issue_search_data_21 USING btree (issue_id); -CREATE INDEX issue_search_data_21_search_vector_idx ON gitlab_partitions_static.issue_search_data_21 USING gin (search_vector); +CREATE INDEX issue_search_data_21_search_vector_idx ON gitlab_partitions_static.issue_search_data_21 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_22_issue_id_idx ON gitlab_partitions_static.issue_search_data_22 USING btree (issue_id); -CREATE INDEX issue_search_data_22_search_vector_idx ON gitlab_partitions_static.issue_search_data_22 USING gin (search_vector); +CREATE INDEX issue_search_data_22_search_vector_idx ON gitlab_partitions_static.issue_search_data_22 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_23_issue_id_idx ON gitlab_partitions_static.issue_search_data_23 USING btree (issue_id); -CREATE INDEX issue_search_data_23_search_vector_idx ON gitlab_partitions_static.issue_search_data_23 USING gin (search_vector); +CREATE INDEX issue_search_data_23_search_vector_idx ON gitlab_partitions_static.issue_search_data_23 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_24_issue_id_idx ON gitlab_partitions_static.issue_search_data_24 USING btree (issue_id); -CREATE INDEX issue_search_data_24_search_vector_idx ON gitlab_partitions_static.issue_search_data_24 USING gin (search_vector); +CREATE INDEX issue_search_data_24_search_vector_idx ON gitlab_partitions_static.issue_search_data_24 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_25_issue_id_idx ON gitlab_partitions_static.issue_search_data_25 USING btree (issue_id); -CREATE INDEX issue_search_data_25_search_vector_idx ON gitlab_partitions_static.issue_search_data_25 USING gin (search_vector); +CREATE INDEX issue_search_data_25_search_vector_idx ON gitlab_partitions_static.issue_search_data_25 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_26_issue_id_idx ON gitlab_partitions_static.issue_search_data_26 USING btree (issue_id); -CREATE INDEX issue_search_data_26_search_vector_idx ON gitlab_partitions_static.issue_search_data_26 USING gin (search_vector); +CREATE INDEX issue_search_data_26_search_vector_idx ON gitlab_partitions_static.issue_search_data_26 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_27_issue_id_idx ON gitlab_partitions_static.issue_search_data_27 USING btree (issue_id); -CREATE INDEX issue_search_data_27_search_vector_idx ON gitlab_partitions_static.issue_search_data_27 USING gin (search_vector); +CREATE INDEX issue_search_data_27_search_vector_idx ON gitlab_partitions_static.issue_search_data_27 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_28_issue_id_idx ON gitlab_partitions_static.issue_search_data_28 USING btree (issue_id); -CREATE INDEX issue_search_data_28_search_vector_idx ON gitlab_partitions_static.issue_search_data_28 USING gin (search_vector); +CREATE INDEX issue_search_data_28_search_vector_idx ON gitlab_partitions_static.issue_search_data_28 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_29_issue_id_idx ON gitlab_partitions_static.issue_search_data_29 USING btree (issue_id); -CREATE INDEX issue_search_data_29_search_vector_idx ON gitlab_partitions_static.issue_search_data_29 USING gin (search_vector); +CREATE INDEX issue_search_data_29_search_vector_idx ON gitlab_partitions_static.issue_search_data_29 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_30_issue_id_idx ON gitlab_partitions_static.issue_search_data_30 USING btree (issue_id); -CREATE INDEX issue_search_data_30_search_vector_idx ON gitlab_partitions_static.issue_search_data_30 USING gin (search_vector); +CREATE INDEX issue_search_data_30_search_vector_idx ON gitlab_partitions_static.issue_search_data_30 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_31_issue_id_idx ON gitlab_partitions_static.issue_search_data_31 USING btree (issue_id); -CREATE INDEX issue_search_data_31_search_vector_idx ON gitlab_partitions_static.issue_search_data_31 USING gin (search_vector); +CREATE INDEX issue_search_data_31_search_vector_idx ON gitlab_partitions_static.issue_search_data_31 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_32_issue_id_idx ON gitlab_partitions_static.issue_search_data_32 USING btree (issue_id); -CREATE INDEX issue_search_data_32_search_vector_idx ON gitlab_partitions_static.issue_search_data_32 USING gin (search_vector); +CREATE INDEX issue_search_data_32_search_vector_idx ON gitlab_partitions_static.issue_search_data_32 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_33_issue_id_idx ON gitlab_partitions_static.issue_search_data_33 USING btree (issue_id); -CREATE INDEX issue_search_data_33_search_vector_idx ON gitlab_partitions_static.issue_search_data_33 USING gin (search_vector); +CREATE INDEX issue_search_data_33_search_vector_idx ON gitlab_partitions_static.issue_search_data_33 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_34_issue_id_idx ON gitlab_partitions_static.issue_search_data_34 USING btree (issue_id); -CREATE INDEX issue_search_data_34_search_vector_idx ON gitlab_partitions_static.issue_search_data_34 USING gin (search_vector); +CREATE INDEX issue_search_data_34_search_vector_idx ON gitlab_partitions_static.issue_search_data_34 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_35_issue_id_idx ON gitlab_partitions_static.issue_search_data_35 USING btree (issue_id); -CREATE INDEX issue_search_data_35_search_vector_idx ON gitlab_partitions_static.issue_search_data_35 USING gin (search_vector); +CREATE INDEX issue_search_data_35_search_vector_idx ON gitlab_partitions_static.issue_search_data_35 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_36_issue_id_idx ON gitlab_partitions_static.issue_search_data_36 USING btree (issue_id); -CREATE INDEX issue_search_data_36_search_vector_idx ON gitlab_partitions_static.issue_search_data_36 USING gin (search_vector); +CREATE INDEX issue_search_data_36_search_vector_idx ON gitlab_partitions_static.issue_search_data_36 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_37_issue_id_idx ON gitlab_partitions_static.issue_search_data_37 USING btree (issue_id); -CREATE INDEX issue_search_data_37_search_vector_idx ON gitlab_partitions_static.issue_search_data_37 USING gin (search_vector); +CREATE INDEX issue_search_data_37_search_vector_idx ON gitlab_partitions_static.issue_search_data_37 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_38_issue_id_idx ON gitlab_partitions_static.issue_search_data_38 USING btree (issue_id); -CREATE INDEX issue_search_data_38_search_vector_idx ON gitlab_partitions_static.issue_search_data_38 USING gin (search_vector); +CREATE INDEX issue_search_data_38_search_vector_idx ON gitlab_partitions_static.issue_search_data_38 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_39_issue_id_idx ON gitlab_partitions_static.issue_search_data_39 USING btree (issue_id); -CREATE INDEX issue_search_data_39_search_vector_idx ON gitlab_partitions_static.issue_search_data_39 USING gin (search_vector); +CREATE INDEX issue_search_data_39_search_vector_idx ON gitlab_partitions_static.issue_search_data_39 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_40_issue_id_idx ON gitlab_partitions_static.issue_search_data_40 USING btree (issue_id); -CREATE INDEX issue_search_data_40_search_vector_idx ON gitlab_partitions_static.issue_search_data_40 USING gin (search_vector); +CREATE INDEX issue_search_data_40_search_vector_idx ON gitlab_partitions_static.issue_search_data_40 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_41_issue_id_idx ON gitlab_partitions_static.issue_search_data_41 USING btree (issue_id); -CREATE INDEX issue_search_data_41_search_vector_idx ON gitlab_partitions_static.issue_search_data_41 USING gin (search_vector); +CREATE INDEX issue_search_data_41_search_vector_idx ON gitlab_partitions_static.issue_search_data_41 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_42_issue_id_idx ON gitlab_partitions_static.issue_search_data_42 USING btree (issue_id); -CREATE INDEX issue_search_data_42_search_vector_idx ON gitlab_partitions_static.issue_search_data_42 USING gin (search_vector); +CREATE INDEX issue_search_data_42_search_vector_idx ON gitlab_partitions_static.issue_search_data_42 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_43_issue_id_idx ON gitlab_partitions_static.issue_search_data_43 USING btree (issue_id); -CREATE INDEX issue_search_data_43_search_vector_idx ON gitlab_partitions_static.issue_search_data_43 USING gin (search_vector); +CREATE INDEX issue_search_data_43_search_vector_idx ON gitlab_partitions_static.issue_search_data_43 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_44_issue_id_idx ON gitlab_partitions_static.issue_search_data_44 USING btree (issue_id); -CREATE INDEX issue_search_data_44_search_vector_idx ON gitlab_partitions_static.issue_search_data_44 USING gin (search_vector); +CREATE INDEX issue_search_data_44_search_vector_idx ON gitlab_partitions_static.issue_search_data_44 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_45_issue_id_idx ON gitlab_partitions_static.issue_search_data_45 USING btree (issue_id); -CREATE INDEX issue_search_data_45_search_vector_idx ON gitlab_partitions_static.issue_search_data_45 USING gin (search_vector); +CREATE INDEX issue_search_data_45_search_vector_idx ON gitlab_partitions_static.issue_search_data_45 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_46_issue_id_idx ON gitlab_partitions_static.issue_search_data_46 USING btree (issue_id); -CREATE INDEX issue_search_data_46_search_vector_idx ON gitlab_partitions_static.issue_search_data_46 USING gin (search_vector); +CREATE INDEX issue_search_data_46_search_vector_idx ON gitlab_partitions_static.issue_search_data_46 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_47_issue_id_idx ON gitlab_partitions_static.issue_search_data_47 USING btree (issue_id); -CREATE INDEX issue_search_data_47_search_vector_idx ON gitlab_partitions_static.issue_search_data_47 USING gin (search_vector); +CREATE INDEX issue_search_data_47_search_vector_idx ON gitlab_partitions_static.issue_search_data_47 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_48_issue_id_idx ON gitlab_partitions_static.issue_search_data_48 USING btree (issue_id); -CREATE INDEX issue_search_data_48_search_vector_idx ON gitlab_partitions_static.issue_search_data_48 USING gin (search_vector); +CREATE INDEX issue_search_data_48_search_vector_idx ON gitlab_partitions_static.issue_search_data_48 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_49_issue_id_idx ON gitlab_partitions_static.issue_search_data_49 USING btree (issue_id); -CREATE INDEX issue_search_data_49_search_vector_idx ON gitlab_partitions_static.issue_search_data_49 USING gin (search_vector); +CREATE INDEX issue_search_data_49_search_vector_idx ON gitlab_partitions_static.issue_search_data_49 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_50_issue_id_idx ON gitlab_partitions_static.issue_search_data_50 USING btree (issue_id); -CREATE INDEX issue_search_data_50_search_vector_idx ON gitlab_partitions_static.issue_search_data_50 USING gin (search_vector); +CREATE INDEX issue_search_data_50_search_vector_idx ON gitlab_partitions_static.issue_search_data_50 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_51_issue_id_idx ON gitlab_partitions_static.issue_search_data_51 USING btree (issue_id); -CREATE INDEX issue_search_data_51_search_vector_idx ON gitlab_partitions_static.issue_search_data_51 USING gin (search_vector); +CREATE INDEX issue_search_data_51_search_vector_idx ON gitlab_partitions_static.issue_search_data_51 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_52_issue_id_idx ON gitlab_partitions_static.issue_search_data_52 USING btree (issue_id); -CREATE INDEX issue_search_data_52_search_vector_idx ON gitlab_partitions_static.issue_search_data_52 USING gin (search_vector); +CREATE INDEX issue_search_data_52_search_vector_idx ON gitlab_partitions_static.issue_search_data_52 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_53_issue_id_idx ON gitlab_partitions_static.issue_search_data_53 USING btree (issue_id); -CREATE INDEX issue_search_data_53_search_vector_idx ON gitlab_partitions_static.issue_search_data_53 USING gin (search_vector); +CREATE INDEX issue_search_data_53_search_vector_idx ON gitlab_partitions_static.issue_search_data_53 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_54_issue_id_idx ON gitlab_partitions_static.issue_search_data_54 USING btree (issue_id); -CREATE INDEX issue_search_data_54_search_vector_idx ON gitlab_partitions_static.issue_search_data_54 USING gin (search_vector); +CREATE INDEX issue_search_data_54_search_vector_idx ON gitlab_partitions_static.issue_search_data_54 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_55_issue_id_idx ON gitlab_partitions_static.issue_search_data_55 USING btree (issue_id); -CREATE INDEX issue_search_data_55_search_vector_idx ON gitlab_partitions_static.issue_search_data_55 USING gin (search_vector); +CREATE INDEX issue_search_data_55_search_vector_idx ON gitlab_partitions_static.issue_search_data_55 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_56_issue_id_idx ON gitlab_partitions_static.issue_search_data_56 USING btree (issue_id); -CREATE INDEX issue_search_data_56_search_vector_idx ON gitlab_partitions_static.issue_search_data_56 USING gin (search_vector); +CREATE INDEX issue_search_data_56_search_vector_idx ON gitlab_partitions_static.issue_search_data_56 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_57_issue_id_idx ON gitlab_partitions_static.issue_search_data_57 USING btree (issue_id); -CREATE INDEX issue_search_data_57_search_vector_idx ON gitlab_partitions_static.issue_search_data_57 USING gin (search_vector); +CREATE INDEX issue_search_data_57_search_vector_idx ON gitlab_partitions_static.issue_search_data_57 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_58_issue_id_idx ON gitlab_partitions_static.issue_search_data_58 USING btree (issue_id); -CREATE INDEX issue_search_data_58_search_vector_idx ON gitlab_partitions_static.issue_search_data_58 USING gin (search_vector); +CREATE INDEX issue_search_data_58_search_vector_idx ON gitlab_partitions_static.issue_search_data_58 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_59_issue_id_idx ON gitlab_partitions_static.issue_search_data_59 USING btree (issue_id); -CREATE INDEX issue_search_data_59_search_vector_idx ON gitlab_partitions_static.issue_search_data_59 USING gin (search_vector); +CREATE INDEX issue_search_data_59_search_vector_idx ON gitlab_partitions_static.issue_search_data_59 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_60_issue_id_idx ON gitlab_partitions_static.issue_search_data_60 USING btree (issue_id); -CREATE INDEX issue_search_data_60_search_vector_idx ON gitlab_partitions_static.issue_search_data_60 USING gin (search_vector); +CREATE INDEX issue_search_data_60_search_vector_idx ON gitlab_partitions_static.issue_search_data_60 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_61_issue_id_idx ON gitlab_partitions_static.issue_search_data_61 USING btree (issue_id); -CREATE INDEX issue_search_data_61_search_vector_idx ON gitlab_partitions_static.issue_search_data_61 USING gin (search_vector); +CREATE INDEX issue_search_data_61_search_vector_idx ON gitlab_partitions_static.issue_search_data_61 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_62_issue_id_idx ON gitlab_partitions_static.issue_search_data_62 USING btree (issue_id); -CREATE INDEX issue_search_data_62_search_vector_idx ON gitlab_partitions_static.issue_search_data_62 USING gin (search_vector); +CREATE INDEX issue_search_data_62_search_vector_idx ON gitlab_partitions_static.issue_search_data_62 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX issue_search_data_63_issue_id_idx ON gitlab_partitions_static.issue_search_data_63 USING btree (issue_id); -CREATE INDEX issue_search_data_63_search_vector_idx ON gitlab_partitions_static.issue_search_data_63 USING gin (search_vector); +CREATE INDEX issue_search_data_63_search_vector_idx ON gitlab_partitions_static.issue_search_data_63 USING gin (search_vector) WITH (fastupdate='false'); CREATE INDEX index_on_namespace_descendants_outdated ON ONLY namespace_descendants USING btree (namespace_id) WHERE (outdated_at IS NOT NULL); @@ -35160,6 +35160,8 @@ CREATE UNIQUE INDEX index_sbom_component_versions_on_component_id_and_version ON CREATE UNIQUE INDEX index_sbom_components_on_component_type_name_and_purl_type ON sbom_components USING btree (name, purl_type, component_type); +CREATE INDEX index_sbom_occurr_on_project_id_and_component_version_id_and_id ON sbom_occurrences USING btree (project_id, component_version_id, id); + CREATE INDEX index_sbom_occurrences_for_input_file_path_search ON sbom_occurrences USING btree (project_id, component_id, input_file_path); CREATE INDEX index_sbom_occurrences_on_component_id_and_id ON sbom_occurrences USING btree (component_id, id); diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md index 62c03dccd85..0e6c0620aa2 100644 --- a/doc/api/graphql/reference/index.md +++ b/doc/api/graphql/reference/index.md @@ -18725,6 +18725,7 @@ Check permissions for the current user on an epic. | Name | Type | Description | | ---- | ---- | ----------- | | <a id="epicpermissionsadminepic"></a>`adminEpic` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_epic` on this resource. | +| <a id="epicpermissionsadminepicrelation"></a>`adminEpicRelation` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_epic_relation` on this resource. | | <a id="epicpermissionsawardemoji"></a>`awardEmoji` | [`Boolean!`](#boolean) | If `true`, the user can perform `award_emoji` on this resource. | | <a id="epicpermissionscreateepic"></a>`createEpic` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_epic` on this resource. | | <a id="epicpermissionscreatenote"></a>`createNote` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_note` on this resource. | @@ -21131,6 +21132,7 @@ Check permissions for the current user on a issue. | Name | Type | Description | | ---- | ---- | ----------- | | <a id="issuepermissionsadminissue"></a>`adminIssue` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_issue` on this resource. | +| <a id="issuepermissionsadminissuerelation"></a>`adminIssueRelation` | [`Boolean!`](#boolean) | If `true`, the user can perform `admin_issue_relation` on this resource. | | <a id="issuepermissionscreatedesign"></a>`createDesign` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_design` on this resource. | | <a id="issuepermissionscreatenote"></a>`createNote` | [`Boolean!`](#boolean) | If `true`, the user can perform `create_note` on this resource. | | <a id="issuepermissionsdestroydesign"></a>`destroyDesign` | [`Boolean!`](#boolean) | If `true`, the user can perform `destroy_design` on this resource. | @@ -31796,6 +31798,7 @@ Name of the feature that the callout is for. | <a id="usercalloutfeaturenameenumpipeline_needs_banner"></a>`PIPELINE_NEEDS_BANNER` | Callout feature name for pipeline_needs_banner. | | <a id="usercalloutfeaturenameenumpipeline_needs_hover_tip"></a>`PIPELINE_NEEDS_HOVER_TIP` | Callout feature name for pipeline_needs_hover_tip. | | <a id="usercalloutfeaturenameenumpreview_user_over_limit_free_plan_alert"></a>`PREVIEW_USER_OVER_LIMIT_FREE_PLAN_ALERT` | Callout feature name for preview_user_over_limit_free_plan_alert. | +| <a id="usercalloutfeaturenameenumproduct_analytics_dashboard_feedback"></a>`PRODUCT_ANALYTICS_DASHBOARD_FEEDBACK` | Callout feature name for product_analytics_dashboard_feedback. | | <a id="usercalloutfeaturenameenumprofile_personal_access_token_expiry"></a>`PROFILE_PERSONAL_ACCESS_TOKEN_EXPIRY` | Callout feature name for profile_personal_access_token_expiry. | | <a id="usercalloutfeaturenameenumproject_quality_summary_feedback"></a>`PROJECT_QUALITY_SUMMARY_FEEDBACK` | Callout feature name for project_quality_summary_feedback. | | <a id="usercalloutfeaturenameenumproject_repository_limit_alert_alert_threshold"></a>`PROJECT_REPOSITORY_LIMIT_ALERT_ALERT_THRESHOLD` | Callout feature name for project_repository_limit_alert_alert_threshold. | diff --git a/doc/ci/index.md b/doc/ci/index.md index 69a5394dfb5..429db0beede 100644 --- a/doc/ci/index.md +++ b/doc/ci/index.md @@ -21,7 +21,7 @@ If you're new to GitLab CI/CD, start by reviewing some of the commonly used term To use GitLab CI/CD, you start with a `.gitlab-ci.yml` file at the root of your project which contains the configuration for your CI/CD pipeline. This file follows the YAML format -and has its own special syntax. +and has its own syntax. You can name this file anything you want, but `.gitlab-ci.yml` is the most common name. @@ -38,7 +38,7 @@ In the `.gitlab-ci.yml` file, you can define: - [Create your first `.gitlab-ci.yml` file](quick_start/index.md). - View all the possible keywords that you can use in the `.gitlab-ci.yml` file in - the [CI/CD YAML syntax reference](../index.md). + the [CI/CD YAML syntax reference](../ci/yaml/index.md). - Use the [pipeline editor](pipeline_editor/index.md) to edit or [visualize](pipeline_editor/index.md#visualize-ci-configuration) your CI/CD configuration. diff --git a/doc/user/project/ml/experiment_tracking/mlflow_client.md b/doc/user/project/ml/experiment_tracking/mlflow_client.md index 35972f0ad7f..1522fd8e4fc 100644 --- a/doc/user/project/ml/experiment_tracking/mlflow_client.md +++ b/doc/user/project/ml/experiment_tracking/mlflow_client.md @@ -39,6 +39,9 @@ To use MLflow client compatibility from a local environment: 1. If the training code contains the call to `mlflow.set_tracking_uri()`, remove it. +In the model registry, you can copy the tracking URI from the overflow menu in the top right +by selecting the vertical ellipsis (**{ellipsis_v}**). + ## Model experiments When running the training code, MLflow client can be used to create experiments, runs, @@ -141,11 +144,22 @@ description = 'Model version description' model_version = client.create_model_version(model_name, source="", description=description) ``` +If the version parameter is not passed, it will be auto-incremented from the latest uploaded +version. You can set the version by passing a tag during model version creation. The version +must follow [SemVer](https://semver.org/) format. + +```python +client = MlflowClient() +model_name = '<your_model_name>' +version = '<your_version>' +tags = { "gitlab.version" = version } +client.create_model)version(model_name, version, description=description, tags=tags) +``` + **Notes** - Argument `run_id` is ignored. Every model version behaves as a Candidate/Run. Creating a mode version from a run is not yet supported. - Argument `source` is ignored. GitLab will create a package location for the model version files. -- Argument `tags` is ignored. - Argument `run_link` is ignored. - Argument `await_creation_for` is ignored. diff --git a/doc/user/project/ml/model_registry/index.md b/doc/user/project/ml/model_registry/index.md index 492ec9940ab..026afc01f22 100644 --- a/doc/user/project/ml/model_registry/index.md +++ b/doc/user/project/ml/model_registry/index.md @@ -29,13 +29,14 @@ at least the [Reporter role](../../../permissions.md#roles) to modify or delete ## Exploring models, model versions and model candidates -Model registry can be accessed on `https/<your-project>-/ml/models`. +To access the model registry, from the left sidebar, select **Deploy > Model registry**. ## Creating machine learning models and model versions Models and model versions can be created using the [MLflow](https://www.mlflow.org/docs/latest/tracking.html) client compatibility. -See [MLflow client compatibility](../experiment_tracking/mlflow_client.md#model-registry) on how to -create and manage models and model versions. +For more information about how to create and manage models and model versions, see [MLflow client compatibility](../experiment_tracking/mlflow_client.md#model-registry). +You can also create models directly on GitLab by selecting **Create Model** +on the Model registry page. ## Upload files, log metrics, log parameters to a model version diff --git a/lib/gitlab/background_migration/backfill_issue_search_data_namespace_id.rb b/lib/gitlab/background_migration/backfill_issue_search_data_namespace_id.rb new file mode 100644 index 00000000000..56d69a549dc --- /dev/null +++ b/lib/gitlab/background_migration/backfill_issue_search_data_namespace_id.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Gitlab + module BackgroundMigration + # Updates issue_search_data.namespace_id with the associated issue's namespace_id + class BackfillIssueSearchDataNamespaceId < BatchedMigrationJob # rubocop:disable Search/NamespacedClass -- This is a migration class + feature_category :team_planning + operation_name :backfill_issue_search_data_namespace_id + + # migrations only version of `issue_search_data` table + class IssueSearchData < ::ApplicationRecord # rubocop:disable Search/NamespacedClass -- Inline class for migration + self.table_name = 'issue_search_data' + end + + def perform + each_sub_batch do |sub_batch| + issues_by_project = sub_batch + .where.not(project_id: nil) + .pluck(:project_id, :namespace_id, :id) + .group_by(&:first) + + issues_by_project.each do |project_id, issues| + namespace_id = issues.first[1] + issue_ids = issues.pluck(2) + + IssueSearchData + .where(issue_id: issue_ids, project_id: project_id) + .update_all(namespace_id: namespace_id) + end + end + end + end + end +end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 5e636cdcc4e..a01fed3b7b4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -37026,6 +37026,9 @@ msgstr "" msgid "ProductAnalytics|Get started with product analytics" msgstr "" +msgid "ProductAnalytics|Help us improve Product Analytics Dashboards by sharing your experience." +msgstr "" + msgid "ProductAnalytics|How many sessions a user has" msgstr "" @@ -37134,6 +37137,9 @@ msgstr "" msgid "ProductAnalytics|Store, query, and visualize quantitative data to get insights into user value." msgstr "" +msgid "ProductAnalytics|Tell us what you think!" +msgstr "" + msgid "ProductAnalytics|The connection string for your Snowplow configurator instance." msgstr "" diff --git a/qa/Dockerfile b/qa/Dockerfile index 9911d2a2930..54ae484e17a 100644 --- a/qa/Dockerfile +++ b/qa/Dockerfile @@ -1,9 +1,10 @@ ARG DOCKER_VERSION=24.0.5 ARG CHROME_VERSION=119 -ARG RUBY_VERSION=3.0 +ARG RUBY_VERSION=3.1 +ARG BUNDLER_VERSION=2.5 ARG QA_BUILD_TARGET=ee -FROM registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 AS foss +FROM registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 AS foss LABEL maintainer="GitLab Quality Department <quality@gitlab.com>" ENV DEBIAN_FRONTEND="noninteractive" diff --git a/scripts/build_qa_image b/scripts/build_qa_image index 23a003e2b01..eab8abd5c5c 100755 --- a/scripts/build_qa_image +++ b/scripts/build_qa_image @@ -87,6 +87,7 @@ docker buildx build \ --build-arg=CHROME_VERSION="${CHROME_VERSION}" \ --build-arg=DOCKER_VERSION="${DOCKER_VERSION}" \ --build-arg=RUBY_VERSION="${RUBY_VERSION}" \ + --build-arg=BUNDLER_VERSION="${BUNDLER_VERSION}" \ --build-arg=QA_BUILD_TARGET="${QA_BUILD_TARGET}" \ --file="${CI_PROJECT_DIR}/qa/Dockerfile" \ --push \ diff --git a/spec/frontend/ci/ci_variable_list/components/ci_variable_drawer_spec.js b/spec/frontend/ci/ci_variable_list/components/ci_variable_drawer_spec.js index 49103e4f7ec..645aaf798d4 100644 --- a/spec/frontend/ci/ci_variable_list/components/ci_variable_drawer_spec.js +++ b/spec/frontend/ci/ci_variable_list/components/ci_variable_drawer_spec.js @@ -113,6 +113,10 @@ describe('CI Variable Drawer', () => { helpPagePath('ci/variables/index', { anchor: 'define-a-cicd-variable-in-the-ui' }), ); }); + + it('value field is resizable', () => { + expect(findValueField().props('noResize')).toBe(false); + }); }); describe('validations', () => { diff --git a/spec/graphql/types/permission_types/issue_spec.rb b/spec/graphql/types/permission_types/issue_spec.rb index 8f43a4a44a0..bf63420aa78 100644 --- a/spec/graphql/types/permission_types/issue_spec.rb +++ b/spec/graphql/types/permission_types/issue_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Types::PermissionTypes::Issue do expected_permissions = [ :read_issue, :admin_issue, :update_issue, :reopen_issue, :read_design, :create_design, :destroy_design, - :create_note, :update_design + :create_note, :update_design, :admin_issue_relation ] expected_permissions.each do |permission| diff --git a/spec/lib/gitlab/background_migration/backfill_issue_search_data_namespace_id_spec.rb b/spec/lib/gitlab/background_migration/backfill_issue_search_data_namespace_id_spec.rb new file mode 100644 index 00000000000..ea5c7086ac2 --- /dev/null +++ b/spec/lib/gitlab/background_migration/backfill_issue_search_data_namespace_id_spec.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Gitlab::BackgroundMigration::BackfillIssueSearchDataNamespaceId, + schema: 20240105144908, feature_category: :team_planning do + let(:namespaces) { table(:namespaces) } + let(:projects) { table(:projects) } + let(:issues) { table(:issues) } + let(:issue_search_data) { table(:issue_search_data) } + let(:issue_type) { table(:work_item_types).find_by!(namespace_id: nil, base_type: 0) } + + let(:namespace_1) { namespaces.create!(name: 'namespace1', type: 'Group', path: 'namespace1') } + let(:namespace_2) { namespaces.create!(name: 'namespace2', type: 'Group', path: 'namespace2') } + + let(:proj_ns_1) { namespaces.create!(name: 'pn1', path: 'pn1', type: 'Project', parent_id: namespace_1.id) } + let(:proj_ns_2) { namespaces.create!(name: 'pn2', path: 'pn2', type: 'Project', parent_id: namespace_2.id) } + + let(:proj_1) do + projects.create!(name: 'proj1', path: 'proj1', namespace_id: namespace_1.id, project_namespace_id: proj_ns_1.id) + end + + let(:proj_2) do + projects.create!(name: 'proj2', path: 'proj2', namespace_id: namespace_2.id, project_namespace_id: proj_ns_2.id) + end + + let(:proj_1_issue_1) do + issues.create!(title: 'issue1', project_id: proj_1.id, namespace_id: proj_ns_1.id, work_item_type_id: issue_type.id) + end + + let(:proj_1_issue_2) do + issues.create!(title: 'issue2', project_id: proj_1.id, namespace_id: proj_ns_1.id, work_item_type_id: issue_type.id) + end + + let(:proj_2_issue_1) do + issues.create!(title: 'issue1', project_id: proj_2.id, namespace_id: proj_ns_2.id, work_item_type_id: issue_type.id) + end + + let(:proj_2_issue_2) do + issues.create!(title: 'issue2', project_id: proj_2.id, namespace_id: proj_ns_2.id, work_item_type_id: issue_type.id) + end + + let!(:proj_1_issue_1_search_data) do + issue_search_data.create!(namespace_id: nil, project_id: proj_1.id, issue_id: proj_1_issue_1.id) + end + + let!(:proj_1_issue_2_search_data) do + issue_search_data.create!(namespace_id: nil, project_id: proj_1.id, issue_id: proj_1_issue_2.id) + end + + let!(:proj_2_issue_1_search_data) do + issue_search_data.create!(namespace_id: nil, project_id: proj_2.id, issue_id: proj_2_issue_1.id) + end + + let!(:proj_2_issue_2_search_data) do + issue_search_data.create!(namespace_id: nil, project_id: proj_2.id, issue_id: proj_2_issue_2.id) + end + + let(:migration) do + described_class.new( + start_id: proj_1_issue_1.id, + end_id: proj_2_issue_2.id, + batch_table: :issues, + batch_column: :id, + sub_batch_size: 2, + pause_ms: 2, + connection: ApplicationRecord.connection + ) + end + + it 'backfills namespace_id for the specified records' do + migration.perform + + [proj_1_issue_1, proj_1_issue_2, proj_2_issue_1, proj_2_issue_2].each do |issue| + expect(issue_search_data.find_by_issue_id(issue.id).namespace_id).to eq(issue.namespace_id) + end + end +end diff --git a/spec/migrations/20240105144908_queue_backfill_issue_search_data_namespace_id_spec.rb b/spec/migrations/20240105144908_queue_backfill_issue_search_data_namespace_id_spec.rb new file mode 100644 index 00000000000..461a6897051 --- /dev/null +++ b/spec/migrations/20240105144908_queue_backfill_issue_search_data_namespace_id_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe QueueBackfillIssueSearchDataNamespaceId, feature_category: :team_planning do + let!(:batched_migration) { described_class::MIGRATION } + + it 'schedules a new batched migration' do + reversible_migration do |migration| + migration.before -> { + expect(batched_migration).not_to have_scheduled_batched_migration + } + + migration.after -> { + expect(batched_migration).to have_scheduled_batched_migration( + table_name: :issues, + column_name: :id, + interval: described_class::DELAY_INTERVAL, + batch_size: described_class::BATCH_SIZE, + sub_batch_size: described_class::SUB_BATCH_SIZE + ) + } + end + end +end diff --git a/spec/serializers/admin/abuse_report_details_entity_spec.rb b/spec/serializers/admin/abuse_report_details_entity_spec.rb index 9260cfc0799..8b18c64ac88 100644 --- a/spec/serializers/admin/abuse_report_details_entity_spec.rb +++ b/spec/serializers/admin/abuse_report_details_entity_spec.rb @@ -29,7 +29,7 @@ RSpec.describe Admin::AbuseReportDetailsEntity, feature_category: :insider_threa it 'correctly exposes `user`', :aggregate_failures do user_hash = entity_hash[:user] - expect(user_hash.keys).to match_array([ + expect(user_hash.keys).to include( :name, :username, :avatar_url, @@ -38,7 +38,6 @@ RSpec.describe Admin::AbuseReportDetailsEntity, feature_category: :insider_threa :last_activity_on, :path, :admin_path, - :plan, :verification_state, :past_closed_reports, :similar_open_reports, @@ -47,7 +46,7 @@ RSpec.describe Admin::AbuseReportDetailsEntity, feature_category: :insider_threa :snippets_count, :groups_count, :notes_count - ]) + ) expect(user_hash[:verification_state].keys).to match_array([ :email, @@ -127,22 +126,5 @@ RSpec.describe Admin::AbuseReportDetailsEntity, feature_category: :insider_threa :path ]) end - - describe 'users plan' do - it 'does not include the plan' do - expect(entity_hash[:user][:plan]).to be_nil - end - - context 'when on .com', :saas, if: Gitlab.ee? do - before do - stub_ee_application_setting(should_check_namespace_plan: true) - create(:gitlab_subscription, :bronze, namespace: user.namespace) - end - - it 'includes the plan' do - expect(entity_hash[:user][:plan]).to eq('Bronze') - end - end - end end end |