Remove async_keep_around_refs_for_merge_request_diffs flag

What does this MR do?

Removes the async_keep_around_refs_for_merge_request_diffs gitlab_com_derisk feature flag and makes asynchronous keep-around ref creation the behavior for the model callbacks. The importer path stays synchronous.

When the flag was enabled, keep-around refs for MergeRequestDiff, MergeRequest, Note, and DiffNote were created via MergeRequests::KeepAroundRefsWorker instead of synchronously in after_save/after_create callbacks, reducing idle-in-transaction time. This MR removes the flag and the now-dead synchronous callback paths, keeping the async worker path.

Changes

  • Remove the feature flag definition and all Feature.enabled? checks.
  • Remove the synchronous after_save keep-around callbacks and the now-dead sync methods (sync_keep_around_commits, MergeRequestDiff#keep_around_commits, Note#keep_around_commit).
  • Drop the flag guards from the enqueue_keep_around_commit(s) methods so they always enqueue the worker.
  • Keep MergeRequest#keep_around_commit (synchronous) for the importer: imports bypass the after_commit enqueue callback (skipped while importing?), so the importer calls it directly to keep the merge commit around.
  • Collapse the specs to the single, always-async callback behavior and add importer coverage.

References

Edited by Marc Shaw

Merge request reports

Loading