diff --git a/db/docs/batched_background_migrations/backfill_root_namespace_cluster_agent_mappings.yml b/db/docs/batched_background_migrations/backfill_root_namespace_cluster_agent_mappings.yml index cbacdd74ba48a707e97a0ca1d510e7297421ad14..295511602225603c9b8a5cc9efeb2f3d21dee5b7 100644 --- a/db/docs/batched_background_migrations/backfill_root_namespace_cluster_agent_mappings.yml +++ b/db/docs/batched_background_migrations/backfill_root_namespace_cluster_agent_mappings.yml @@ -7,4 +7,4 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/159051 milestone: '17.2' queued_migration_version: 20240711035245 # Replace with the approximate date you think it's best to ensure the completion of this BBM. -finalized_by: # version of the migration that finalized this BBM +finalized_by: 20241023210409 diff --git a/db/post_migrate/20241023210409_finalize_backfill_root_namespace_cluster_agent_mappings.rb b/db/post_migrate/20241023210409_finalize_backfill_root_namespace_cluster_agent_mappings.rb new file mode 100644 index 0000000000000000000000000000000000000000..453e31cc7c23ce057d1ae773a75fc6af456f1569 --- /dev/null +++ b/db/post_migrate/20241023210409_finalize_backfill_root_namespace_cluster_agent_mappings.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class FinalizeBackfillRootNamespaceClusterAgentMappings < Gitlab::Database::Migration[2.2] + milestone '17.6' + MIGRATION = 'BackfillRootNamespaceClusterAgentMappings' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main_cell + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :remote_development_agent_configs, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/schema_migrations/20241023210409 b/db/schema_migrations/20241023210409 new file mode 100644 index 0000000000000000000000000000000000000000..89be1ad38d18413ebb97a7bb91943d2d67d75857 --- /dev/null +++ b/db/schema_migrations/20241023210409 @@ -0,0 +1 @@ +2f1567d2e69137fd8569367e58e61f0e4b81daa0baa131d2bbea3fbdc2f501eb \ No newline at end of file diff --git a/ee/spec/lib/ee/gitlab/background_migration/backfill_root_namespace_cluster_agent_mappings_spec.rb b/ee/spec/lib/ee/gitlab/background_migration/backfill_root_namespace_cluster_agent_mappings_spec.rb index 0cf715ccc009b0a04a64b0e11be2e55c95e91d17..d9f72d6cf1b3f6c3d95f0d88f09b0048b4ecc730 100644 --- a/ee/spec/lib/ee/gitlab/background_migration/backfill_root_namespace_cluster_agent_mappings_spec.rb +++ b/ee/spec/lib/ee/gitlab/background_migration/backfill_root_namespace_cluster_agent_mappings_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::BackgroundMigration::BackfillRootNamespaceClusterAgentMappings, :migration, - feature_category: :workspaces do + schema: 20241023210409, feature_category: :workspaces do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:cluster_agents) { table(:cluster_agents) }