Remove prevent_reopen_merge_request_without_branch flag

What does this MR do and why?

This MR removes the prevent_reopen_merge_request_without_branch feature flag and keeps its behavior as the permanent default.

The flag fixed a bug where reopening a closed merge request whose source branch had been deleted (and whose merge request head ref had expired) recreated the diff from a nil source branch SHA. This produced an empty diff that replaced the stored one and became the latest version, silently hiding the commits and changes that were visible while the merge request was closed.

With the fix, reopening a merge request is rejected when the source or target branch no longer exists: the merge request stays closed, no empty diff is created, and an error is returned from the REST API (422), the GraphQL mergeRequestUpdate mutation, and the web controller, with the message "Cannot reopen this merge request because the source or target branch no longer exists." surfaced in the merge request widget.

The flag is default-off and has been fully enabled on GitLab.com, so this MR removes it and makes the fixed behavior permanent for all instances, including self-managed and Dedicated.

References

How to set up and validate locally

No feature flag needs to be enabled; the behavior is now always on.

  1. Create a merge request with a few commits.
  2. Close the merge request.
  3. Delete the source branch.
  4. Try to reopen the merge request from the UI.
  5. Observe that the merge request stays closed and an error is shown: "Cannot reopen this merge request because the source or target branch no longer exists."
  6. Try to reopen the same merge request via the REST API (PUT /projects/:id/merge_requests/:merge_request_iid with state_event=reopen).
  7. Observe a 422 response with the same error message, and that the merge request remains closed.

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
Loading