summaryrefslogtreecommitdiff
path: root/danger/roulette/Dangerfile
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2019-07-19 17:33:48 +0000
committerNick Thomas <nick@gitlab.com>2019-07-19 17:33:48 +0000
commit34a5f77e770765f278ade00a33ef846e2e1ce3d3 (patch)
tree11f08d25e84c62a2c0f42247f71f76f1ab016012 /danger/roulette/Dangerfile
parent325360444253cf630ae3bfb6cae47a1e6e612c79 (diff)
downloadgitlab-ce-34a5f77e770765f278ade00a33ef846e2e1ce3d3.tar.gz
Document database review process
See https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/6069
Diffstat (limited to 'danger/roulette/Dangerfile')
-rw-r--r--danger/roulette/Dangerfile15
1 files changed, 4 insertions, 11 deletions
diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile
index 6718e218233..19a5076778c 100644
--- a/danger/roulette/Dangerfile
+++ b/danger/roulette/Dangerfile
@@ -55,22 +55,15 @@ def spin_for_category(team, project, category, branch_name)
"| #{helper.label_for_category(category)} | #{reviewer&.markdown_name || NO_REVIEWER} | #{maintainer&.markdown_name || NO_MAINTAINER} |"
end
-def build_list(items)
- list = items.map { |filename| "* `#{filename}`" }.join("\n")
-
- if items.size > 10
- "\n<details>\n\n#{list}\n\n</details>"
- else
- list
- end
-end
-
changes = helper.changes_by_category
# Ignore any files that are known but uncategorized. Prompt for any unknown files
changes.delete(:none)
categories = changes.keys - [:unknown]
+# Ensure to spin for database reviewer/maintainer when ~database is applied (e.g. to review SQL queries)
+categories << :database if gitlab.mr_labels.include?('database') && !categories.include?(:database)
+
# Single codebase MRs are reviewed using a slightly different process, so we
# disable the review roulette for such MRs.
# CSS Clean up MRs are reviewed using a slightly different process, so we
@@ -95,5 +88,5 @@ if changes.any? && !gitlab.mr_labels.include?('single codebase') && !gitlab.mr_l
markdown(MESSAGE)
markdown(CATEGORY_TABLE_HEADER + rows.join("\n")) unless rows.empty?
- markdown(UNKNOWN_FILES_MESSAGE + build_list(unknown)) unless unknown.empty?
+ markdown(UNKNOWN_FILES_MESSAGE + helper.markdown_list(unknown)) unless unknown.empty?
end