Skip to content

Enable danger review for forks

Peter Leitzen requested to merge splattael/gitlab:enable-danger-for-forks into master

What does this MR do?

Due to some limitations Danger bot wasn't enabled repositories which did not set envvar DANGER_GITLAB_API_TOKEN in the CI pipeline which is true for forks e.g. Community contributions. This envvar is needed so Danger bot can comment its results on the MR.

This MR allows Danger bot to be run on forks so Community contributions get early feedback on e.g. git commit messages.

See !57102 (closed) for a fork MR.

Verification

  • MR from fork
    • [-] CI should pass/fail depending on the validity of e.g. git commit message
    • Does not post results to MR
  • MR on GitLab repository/GitLab member triggers pipeline on MR from fork - same
    • CI should pass/fail depending on the validity of e.g. git commit message
    • Does post results to MR

Caveat

Danger won't fail the CI job even if it on git commit errors. See !57097 (comment 541288558) on the why.

Screenshots (strongly suggested)

Type With $DANGER_GITLAB_API_TOKEN (this MR) No $DANGER_GITLAB_API_TOKEN (fork MR) 👈 When CI triggered by GitLab member on MR fork
Danger success https://gitlab.com/gitlab-org/gitlab/-/jobs/1142903869 Screenshot_from_2021-03-31_13-16-17 https://gitlab.com/rettalps/gitlab/-/jobs/1142906200 Screenshot_from_2021-03-31_13-21-10 https://gitlab.com/gitlab-org/gitlab/-/jobs/1142968956 Screenshot_from_2021-03-31_13-36-08
Comment on MR for Screenshot_from_2021-03-31_13-18-28 No comment on MR from GitLab 🤖 Screenshot_from_2021-03-31_13-36-49
Danger failure 🚫 https://gitlab.com/gitlab-org/gitlab/-/jobs/1142939345 Screenshot_from_2021-03-31_13-24-03 https://gitlab.com/rettalps/gitlab/-/jobs/1143018598 Screenshot_from_2021-03-31_14-04-32 https://gitlab.com/gitlab-org/gitlab/-/jobs/1142983337 Screenshot_from_2021-03-31_13-42-16
Comment on MR for 🚫 Screenshot_from_2021-03-31_13-24-40 No comment on MR from GitLab 🤖 Screenshot_from_2021-03-31_13-42-43

Does this MR meet the acceptance criteria?

Conformity

Edited by Peter Leitzen

Merge request reports