Skip to content

Draft: Use #source_branch_sha for MergeRequest#actual_head_pipeline

What does this MR do and why?

The previous use of diff_head_sha meant that changes could be pushed and merged without a pipeline as long as the previous pipeline had passed and the merge request diff had not been processed yet.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Perform the following steps in your GDK, with and without the changes in this MR:

  1. Navigate to a project.
  2. Make sure Merge requests > Pipelines must succeed is enabled
  3. Navigate to a merge request (open a new one if needed)
  4. Make sure it has a green pipeline for the latest commit
  5. Run gdk stop rails-background-jobs to prevent merge request diffs from processing
  6. Push a new commit to the source branch of the merge request
  7. Observe that:
    • Without these changes, the merge request remains mergeable
    • With these changes, the merge request is no longer mergeable

Merge request reports