From e352e3797d68e5a7d744025ae6dc45f0197ef9c3 Mon Sep 17 00:00:00 2001 From: gdk Date: Sun, 14 Dec 2025 23:33:29 +0000 Subject: [PATCH] Finalize BBM BackfillArchivedAndTraversalIdsToVulnerabilityStatistics This migration was finished at `2025-07-03 09:41: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 2000965 --database main ``` The last time this background migration was triggered was in [db/post_migrate/20250630065826_requeue_backfill_archived_and_traversal_ids_to_vulnerability_statistics_v2.rb](https://gitlab.com/gitlab-org/gitlab/-/blob/master/db/post_migrate/20250630065826_requeue_backfill_archived_and_traversal_ids_to_vulnerability_statistics_v2.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/21682061) 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 --- ...versal_ids_to_vulnerability_statistics.yml | 5 +++-- ...raversal_ids_to_vulnerability_statistic.rb | 21 +++++++++++++++++++ db/schema_migrations/20251214233315 | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 db/post_migrate/20251214233315_finalize_hk_backfill_archived_and_traversal_ids_to_vulnerability_statistic.rb create mode 100644 db/schema_migrations/20251214233315 diff --git a/db/docs/batched_background_migrations/backfill_archived_and_traversal_ids_to_vulnerability_statistics.yml b/db/docs/batched_background_migrations/backfill_archived_and_traversal_ids_to_vulnerability_statistics.yml index 12bfcf1f4107c3..981c82c30c0387 100644 --- a/db/docs/batched_background_migrations/backfill_archived_and_traversal_ids_to_vulnerability_statistics.yml +++ b/db/docs/batched_background_migrations/backfill_archived_and_traversal_ids_to_vulnerability_statistics.yml @@ -1,8 +1,9 @@ --- migration_job_name: BackfillArchivedAndTraversalIdsToVulnerabilityStatistics -description: Backfill project.archived and project.namespace.traversal_ids values to the denormalized columns of the same name on vulnerability_statistics +description: Backfill project.archived and project.namespace.traversal_ids values + to the denormalized columns of the same name on vulnerability_statistics feature_category: vulnerability_management introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177993 milestone: '18.2' queued_migration_version: 20250630065826 -finalized_by: # version of the migration that finalized this BBM +finalized_by: '20251214233315' diff --git a/db/post_migrate/20251214233315_finalize_hk_backfill_archived_and_traversal_ids_to_vulnerability_statistic.rb b/db/post_migrate/20251214233315_finalize_hk_backfill_archived_and_traversal_ids_to_vulnerability_statistic.rb new file mode 100644 index 00000000000000..9f83dc3f5fd774 --- /dev/null +++ b/db/post_migrate/20251214233315_finalize_hk_backfill_archived_and_traversal_ids_to_vulnerability_statistic.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class FinalizeHkBackfillArchivedAndTraversalIdsToVulnerabilityStatistic < Gitlab::Database::Migration[2.3] + milestone '18.7' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_sec + + def up + ensure_batched_background_migration_is_finished( + job_class_name: 'BackfillArchivedAndTraversalIdsToVulnerabilityStatistics', + table_name: :vulnerability_statistics, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down; end +end diff --git a/db/schema_migrations/20251214233315 b/db/schema_migrations/20251214233315 new file mode 100644 index 00000000000000..981e6123a33606 --- /dev/null +++ b/db/schema_migrations/20251214233315 @@ -0,0 +1 @@ +30a0c1b34a1e4adc83bc48212fb335aac6ee79a598b572fd841e30bd0cbcaa59 \ No newline at end of file -- GitLab