diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-11-04 16:12:39 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2019-11-12 17:09:39 +0300 |
commit | fe034b448531ac5695ef53b383430b93f84fc52e (patch) | |
tree | f5307d7b333685e35c55a1305dddf6a8e81c8b2b /danger | |
parent | e9f9183a3228241d3b4ab352425d3d68890fcf02 (diff) |
Add reviewer suggestions to MRs
This would be a round robin way of getting a reviewer. Minimal
implementation, to see if it works.
Diffstat (limited to 'danger')
-rw-r--r-- | danger/assignees/Dangerfile | 15 | ||||
-rw-r--r-- | danger/labels/Dangerfile | 2 | ||||
-rw-r--r-- | danger/merge_request/Dangerfile | 8 |
3 files changed, 19 insertions, 6 deletions
diff --git a/danger/assignees/Dangerfile b/danger/assignees/Dangerfile new file mode 100644 index 000000000..048c31b04 --- /dev/null +++ b/danger/assignees/Dangerfile @@ -0,0 +1,15 @@ +if gitlab.mr_json["assignees"].none? + warn "This merge request does not have any assignee yet. Setting an assignee clarifies who needs to take action on the merge request at any given time." + + suggestions = (GITALY_TEAM - [gitlab.mr_author]).sample(2) + + case suggestions.size + when 0 + when 1 + message "Suggested maintainer: @#{suggestions.first}" + else + message "Suggested maintainers: @#{suggestions.first}, and @#{suggestions.last}" + end +end + +# vim: ft=ruby diff --git a/danger/labels/Dangerfile b/danger/labels/Dangerfile index a2a442946..e46d50114 100644 --- a/danger/labels/Dangerfile +++ b/danger/labels/Dangerfile @@ -11,8 +11,6 @@ def changelog_entry end required_labels = %w[devops::create] - -GITALY_TEAM = %w[8bitlife jacobvosmaer-gitlab johncai pokstad1 zj-gitlab] required_labels << "group::gitaly" if GITALY_TEAM.include?(gitlab.mr_author) TYPE_TO_LABEL = { diff --git a/danger/merge_request/Dangerfile b/danger/merge_request/Dangerfile index c69204936..38cb859b0 100644 --- a/danger/merge_request/Dangerfile +++ b/danger/merge_request/Dangerfile @@ -6,12 +6,12 @@ if gitlab.mr_body.empty? fail("Please provide a merge request description") end -unless gitlab.mr_json["assignee"] - warn "This merge request does not have any assignee yet. Setting an assignee clarifies who needs to take action on the merge request at any given time." -end - if gitlab.mr_title.length > 72 warn "The title of this merge requests it too long" end +unless gitlab.mr_json["force_remove_source_branch"] + warn "The source branch can be removed after the merge request is merged, please consider setting this option" +end + # vim: ft=ruby |