Skip to content

Fetch the source branch in danger-review job

Nao Hashizume requested to merge nh/fix-merge-train-pipeline-from-fork into master

What does this MR do?

This MR allows Danger to find commits in MRs from forks when those commits are not automatically fetched. This happens under following the condition @rymai described in gitlab-org/gitlab-development-kit!3338 (comment 1559159021):

  1. The merge train pipeline first squash the original commits, then merge them into the current merge train (or main if the merge train is empty)
  2. The Danger job tries to look at the original commits (it probably gets the list of commits from the MR API?), but they aren't present/fetched since they were squashed in the first step

Related to triage-ops#1401 (closed)

Testing

I've tested the ci/danger-review.yml in this branch at triage-ops!2430 (closed) (MR from a fork), and here's an example of a successful danger-review job: https://gitlab.com/gitlab-org/quality/triage-ops/-/jobs/5096233182.

Check-list

Edited by Nao Hashizume

Merge request reports