Remove mark_mergeability_checking_in_worker feature flag

Removes the mark_mergeability_checking_in_worker feature flag. It has been enabled for 100% of projects on GitLab.com since 2026-09-28 with no regressions, so the checking merge status is now always written by MergeRequestMergeabilityCheckWorker instead of during the GET request that enqueues it.

Detailed context for AI agents

What does this MR do and why?

  • MergeRequests::MergeabilityCheckService#async_execute no longer calls merge_request.mark_as_checking before enqueuing the worker. The merge request stays unchecked until the job runs, so the controller GET request that triggers the check does not write to the database.
  • MergeRequestMergeabilityCheckWorker#perform now always calls MergeRequest.batch_mark_as_checking([merge_request.id]) before running the check. This is a guarded UPDATE ... WHERE merge_status IN (unchecked, cannot_be_merged_recheck) so it does not overwrite a verdict written after the record was loaded.
  • Removes the mark_as_checking_in_worker? helper and its comment from the service.
  • Deletes the flag definition config/feature_flags/gitlab_com_derisk/mark_mergeability_checking_in_worker.yml.
  • Removes the three flag-disabled spec contexts in the worker spec, after_create_service_spec.rb and mergeability_check_service_spec.rb. The remaining examples already assert the flag-on behaviour (status left for the worker, hooks fire with unchecked, worker marks checking and does not overwrite a later verdict).

Behaviour kept: the verdict write (mark_as_mergeable / mark_as_unmergeable) in MergeabilityCheckService#execute is unchanged. No schema or data change. The MergeRequest#mark_as_checking instance method is still used by other callers and is left in place.

Rollout history (from the rollout issue): staging and the test project 2026-09-24, gitlab-org/gitlab 2026-09-24, 10% and 25% of projects 2026-09-25, 50% and 100% 2026-09-28. Watched the detect_writes_on_get log entries for Projects::MergeRequests::ContentController#cached_widget and the worker duration dashboard; nothing regressed.

References

Screenshots or screen recordings

Not applicable, backend-only flag removal.

How to set up and validate locally

  1. Open a merge request on GDK and push a new commit to its source branch.
  2. In the Rails console, MergeRequest.last.merge_status reads unchecked until MergeRequestMergeabilityCheckWorker runs, then checking, then can_be_merged or cannot_be_merged.
  3. Loading the MR page with Sidekiq paused leaves the status at unchecked and writes nothing to the database.

Verification

  • bundle exec rspec spec/workers/merge_request_mergeability_check_worker_spec.rb spec/services/merge_requests/mergeability_check_service_spec.rb - 66 examples, 0 failures.
  • bundle exec rspec spec/services/merge_requests/after_create_service_spec.rb - 25 examples, 0 failures.
  • Rubocop clean on all five changed Ruby files.

MR acceptance checklist

Evaluated against the MR acceptance checklist. Flag removal only, no new risk in quality, performance, reliability, security, or maintainability.

Merge request reports

Loading
Loading