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: Removed Feature.enabled?(:ci_pipeline_destroy_two_level_batching) conditional and the old perform_fast_destroy fallback path.
  • spec/models/ci/pipeline_spec.rb: Removed the when ci_pipeline_destroy_two_level_batching is disabled test context.
  • Deleted config/feature_flags/gitlab_com_derisk/ci_pipeline_destroy_two_level_batching.yml.

References

Screenshots or screen recordings

N/A — backend-only change.

How to set up and validate locally

  1. 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
  2. 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.

Merge request reports

Loading