diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2019-02-27 16:39:31 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2019-03-11 12:42:19 +0300 |
commit | 87d19300e3394192d6872243ba8939f2e7ce1ec9 (patch) | |
tree | 74ac760289d57413369fc87a37720ecb27bb4158 /danger/single_codebase | |
parent | a89df58527aae693438001ab0800363e7a7d6b07 (diff) |
Set specific reviewers for single codebase effort
This extends Danger so it informs MR authors that single codebase merge
requests need to be approved by a specific group of engineers.
Co-authored-by: Yorick Peterse <yorickpeterse@gmail.com>
Diffstat (limited to 'danger/single_codebase')
-rw-r--r-- | danger/single_codebase/Dangerfile | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/danger/single_codebase/Dangerfile b/danger/single_codebase/Dangerfile new file mode 100644 index 00000000000..a5938cd6783 --- /dev/null +++ b/danger/single_codebase/Dangerfile @@ -0,0 +1,56 @@ +def mention_single_codebase_approvers + frontend_maintainers = %w(@filipa @iamphill) + backend_maintainers = %w(@rspeicher @rymai @yorickpeterse @godfat) + + rows = [] + users = [] + + if gitlab.mr_labels.include?('frontend') + frontend_maintainer = frontend_maintainers.sample + + rows << "| ~frontend | `#{frontend_maintainer}`" + users << frontend_maintainer + end + + if gitlab.mr_labels.include?('backend') + backend_maintainer = backend_maintainers.sample + + rows << "| ~backend | `#{backend_maintainer}`" + users << backend_maintainer + end + + if rows.empty? + backup_maintainer = backend_maintainers.sample + + rows << "| ~frontend / ~backend | `#{backup_maintainer}`" + users << backup_maintainer + end + + markdown(<<~MARKDOWN.strip) + ## Single codebase changes + + This merge request contains changes related to the work of moving towards a + [single codebase](https://gitlab.com/groups/gitlab-org/-/epics/802) for + Community Edition and Enterprise Edition. These changes will need to be + reviewed and approved by the following engineers: + + | Category | Reviewer + |----------|--------- + #{rows.join("\n")} + + To make sure this happens, please follow these steps: + + 1. Add all of the mentioned users to the list of merge request approvals. + 2. Assign the merge request to the first person in the above list. + + If you are a reviewer, please follow these steps: + + 1. Review the merge request. If it is good to go, approve it. + 2. Once approved, assign to the next person in the above list. If you are + the last person in the list, merge the merge request. + MARKDOWN +end + +if gitlab.mr_labels.include?('single codebase') + mention_single_codebase_approvers +end |