Skip CI finished builds backfill when ClickHouse is not configured
What does this MR do and why?
Skips the BackfillCiFinishedBuildsToClickHouse batched background migration on instances where ClickHouse is not configured.
Problem: The backfill migration (!222415 (merged)) creates sync events in p_ci_finished_build_ch_sync_events for the last 180 days of CI finished builds. On self-hosted instances without ClickHouse configured, these sync events are created but never processed — the CiFinishedBuildsSyncWorker already guards against this via CiFinishedBuildsSyncService.enabled? which checks Gitlab::ClickHouse.configured?. Unlike the real-time sync (which preserves only 30 days and is lightweight), this backfill upserts 180 days of records unnecessarily.
Solution: Add a Gitlab::ClickHouse.configured? check at the start of the perform method in the EE migration class. This follows the same pattern used by the downstream CiFinishedBuildsSyncService and ensures the backfill is a no-op on instances without ClickHouse.
Since this is a runtime class change (not persisted in the DB), no re-queue of the BBM is needed — the change takes effect on the next batch execution.
References
- Original backfill MR: !222415 (merged)
- Discussion: !222415 (comment 3201375956)
- Related issue: #585179 (closed)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.