Skip to content

Fetch source branch in danger-review job when on fork

Why is this change being made?

Merge trains now respect squash and rebase settings of projects. This makes the merge train ref more representative of the actual merged result, but it also means that when a merge request is either squashed or rebased, a new commit is created instead of the for the squashed or rebased result. Consequently, the source commit SHA only exists in the source project and we need to explicitly fetch it from there in order to work with it.

Example failure https://gitlab.com/gitlab-com/www-gitlab-com/-/jobs/5124418511 in !129518 (merged)

Author and Reviewer Checklist

Please verify the check list and ensure to tick them off before the MR is merged.

  • Provided a concise title for this Merge Request (MR)
  • Added a description to this MR explaining the reasons for the proposed change, per say why, not just what
    • Copy/paste the Slack conversation to document it for later, or upload screenshots. Verify that no confidential data is added, and the content is SAFE
  • Assign reviewers for this MR to the correct Directly Responsible Individual/s (DRI)
    • If the DRI for the page/s being updated isn’t immediately clear, then assign it to one of the people listed in the Maintained by section on the page being edited
    • If your manager does not have merge rights, please ask someone to merge it AFTER it has been approved by your manager in #mr-buddies
    • The when to get approval handbook section explains the workflow in more detail
  • For transparency, share this MR with the audience that will be impacted.
    • Team: For changes that affect your direct team, share in your group Slack channel
    • Department: If the update affects your department, share the MR in your department Slack channel
    • Company: If the update affects all (or the majority of) GitLab team members, post an update in #whats-happening-at-gitlab linking to this MR

Edited by Hordur Freyr Yngvason

Merge request reports