Remove ci_pipeline_destroy_two_level_batching feature flag
What does this MR do and why?
Removes the ci_pipeline_destroy_two_level_batching feature flag, making two-level batching the default and only code path for pipeline job artifact destruction.
The feature flag was rolled out to 100% on production and verified. Pipeline deletion now always uses Ci::Pipelines::DestroyAssociationsService which batches builds via a CTE-wrapped query in groups of 100, then destroys artifacts per build batch — avoiding statement timeouts on pipelines with many builds.
Changes
-
app/models/ci/pipeline.rb: RemovedFeature.enabled?(:ci_pipeline_destroy_two_level_batching)conditional and the oldperform_fast_destroyfallback path. -
spec/models/ci/pipeline_spec.rb: Removed thewhen ci_pipeline_destroy_two_level_batching is disabledtest context. -
Deleted
config/feature_flags/gitlab_com_derisk/ci_pipeline_destroy_two_level_batching.yml.
References
- Feature issue: #582836 (closed)
- Rollout issue: #593102 (closed)
- Original MR: !225515 (merged)
Screenshots or screen recordings
N/A — backend-only change.
How to set up and validate locally
-
Open a Rails console:
pipeline = Ci::Pipeline.last service = Ci::Pipelines::DestroyAssociationsService.new(pipeline) # Verify the service is instantiated without feature flag checks service.respond_to?(:destroy_records) # => true -
Verify no remaining references:
git grep "ci_pipeline_destroy_two_level_batching" # Should return no results
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.