From 017bb7f2ba173211a05137f575a0ba8e83d0ee55 Mon Sep 17 00:00:00 2001 From: gdk Date: Thu, 17 Jul 2025 23:23:13 +0000 Subject: [PATCH] Finalize BBM RemoveOrphanedVulnerabilityNotesBatchedMigration This migration was finished at `2025-05-14 08:59:02 UTC`, you can confirm the status using our [batched background migration chatops commands](https://docs.gitlab.com/ee/development/database/batched_background_migrations.html#monitor-the-progress-and-status-of-a-batched-background-migration). To confirm it is finished you can run: ``` /chatops run batched_background_migrations status 2000895 --database main ``` The last time this background migration was triggered was in [db/post_migrate/20250304184254_queue_remove_orphaned_vulnerability_notes_batched_migration.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/post_migrate/20250304184254_queue_remove_orphaned_vulnerability_notes_batched_migration.rb) You can read more about the process for finalizing batched background migrations in https://docs.gitlab.com/ee/development/database/batched_background_migrations.html . As part of our process we want to ensure all batched background migrations have had at least one [required stop](https://docs.gitlab.com/ee/development/database/required_stops.html) to process the migration. Therefore we can finalize any batched background migration that was added before the last required stop. This change was generated by [gitlab-housekeeper](https://gitlab.com/gitlab-org/gitlab/-/tree/master/gems/gitlab-housekeeper) in [CI](https://ops.gitlab.net/gitlab-com/database-team/gitlab-com-database-testing/-/jobs/19363183) using the `Keeps::OverdueFinalizeBackgroundMigration` keep. To provide feedback on your experience with `gitlab-housekeeper` please create an issue with the label ~"GitLab Housekeeper" and consider pinging the author of this keep. Changelog: other --- ..._vulnerability_notes_batched_migration.yml | 2 +- ...d_vulnerability_notes_batched_migration.rb | 21 +++++++++++++++++++ db/schema_migrations/20250717232258 | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 db/post_migrate/20250717232258_finalize_hk_remove_orphaned_vulnerability_notes_batched_migration.rb create mode 100644 db/schema_migrations/20250717232258 diff --git a/db/docs/batched_background_migrations/remove_orphaned_vulnerability_notes_batched_migration.yml b/db/docs/batched_background_migrations/remove_orphaned_vulnerability_notes_batched_migration.yml index b2b5c223f909db..469683d58f24a0 100644 --- a/db/docs/batched_background_migrations/remove_orphaned_vulnerability_notes_batched_migration.yml +++ b/db/docs/batched_background_migrations/remove_orphaned_vulnerability_notes_batched_migration.yml @@ -5,4 +5,4 @@ feature_category: vulnerability_management introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/180624 milestone: '17.10' queued_migration_version: 20250304184254 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20250717232258' diff --git a/db/post_migrate/20250717232258_finalize_hk_remove_orphaned_vulnerability_notes_batched_migration.rb b/db/post_migrate/20250717232258_finalize_hk_remove_orphaned_vulnerability_notes_batched_migration.rb new file mode 100644 index 00000000000000..bd76e5c9eab830 --- /dev/null +++ b/db/post_migrate/20250717232258_finalize_hk_remove_orphaned_vulnerability_notes_batched_migration.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeHkRemoveOrphanedVulnerabilityNotesBatchedMigration < Gitlab::Database::Migration[2.3] + milestone '18.3' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'RemoveOrphanedVulnerabilityNotesBatchedMigration', + table_name: :notes, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20250717232258 b/db/schema_migrations/20250717232258 new file mode 100644 index 00000000000000..68dfea34fe0f44 --- /dev/null +++ b/db/schema_migrations/20250717232258 @@ -0,0 +1 @@ +24973c46f159fd0721e5ddcabafdef14d2df6ea6f6e8ed801a6ab90a61057011 \ No newline at end of file -- GitLab