Remove auto_merge_abort_uses_target_project feature flag

What does this MR do and why?

This MR removes the auto_merge_abort_uses_target_project feature flag. The flag is type gitlab_com_derisk and was default_enabled: false. The rollout is complete on GitLab.com and the rollout issue is closed.

The flag fixed a bug with merge requests opened from a fork. When auto-merge or a merge train was pending and got aborted, the "aborted the automatic merge" system note was never saved. RefreshService and UnlinkForkService run with the source (fork) project. The note was built against that project. Note validation rejects a note whose project does not match the target project of the merge request. The abort itself still happened, but the note was lost without an error.

Changes:

  • MergeRequests::BaseService#abort_auto_merge now always passes merge_request.target_project to AutoMergeService.
  • The feature flag YAML file is deleted.
  • The "when the flag is disabled" spec contexts are deleted from spec/services/merge_requests/post_merge_service_spec.rb and spec/services/merge_requests/refresh_service_spec.rb.

The flag was off by default. Removing it ships the fix to self-managed and Dedicated for the first time. This is a user-facing change, so the changelog type is fixed.

References

Screenshots or screen recordings

Not applicable. This MR has no UI changes.

How to set up and validate locally

  1. Run the two service specs:
    bundle exec rspec spec/services/merge_requests/post_merge_service_spec.rb spec/services/merge_requests/refresh_service_spec.rb
  2. Both specs pass locally.

To check the behavior by hand:

  1. Fork a project and open a merge request from the fork to the target project.
  2. Set auto-merge on the merge request.
  3. Push a new commit to the source branch to abort auto-merge.
  4. The merge request now shows the "aborted the automatic merge" system note.

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.

The flag rollout is complete. The only production change is that the abort path always uses the target project.

Merge request reports

Loading
Loading