diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /danger/roulette | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'danger/roulette')
-rw-r--r-- | danger/roulette/Dangerfile | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile index b46220d7886..06d2929cd54 100644 --- a/danger/roulette/Dangerfile +++ b/danger/roulette/Dangerfile @@ -40,16 +40,21 @@ for them. MARKDOWN OPTIONAL_REVIEW_TEMPLATE = '%{role} review is optional for %{category}' -NOT_AVAILABLE_TEMPLATE = 'No %{role} available' +NOT_AVAILABLE_TEMPLATES = { + default: 'No %{role} available', + product_intelligence: "No engineer is available for automated assignment, please reach out to `#g_product_intelligence` slack channel or mention `@gitlab-org/growth/product-intelligence/engineers` for assistance." +}.freeze + +def note_for_spins_role(spins, role, category) + template = NOT_AVAILABLE_TEMPLATES[category] || NOT_AVAILABLE_TEMPLATES[:default] -def note_for_spins_role(spins, role) spins.each do |spin| note = note_for_spin_role(spin, role) return note if note end - NOT_AVAILABLE_TEMPLATE % { role: role } + template % { role: role } end def note_for_spin_role(spin, role) @@ -61,8 +66,8 @@ def note_for_spin_role(spin, role) end def markdown_row_for_spins(category, spins_array) - reviewer_note = note_for_spins_role(spins_array, :reviewer) - maintainer_note = note_for_spins_role(spins_array, :maintainer) + maintainer_note = note_for_spins_role(spins_array, :maintainer, category) + reviewer_note = note_for_spins_role(spins_array, :reviewer, category) "| #{helper.label_for_category(category)} | #{reviewer_note} | #{maintainer_note} |" end @@ -73,10 +78,17 @@ changes = project_helper.changes_by_category changes.delete(:none) # To reinstate roulette for documentation, remove this line. changes.delete(:docs) -categories = changes.keys - [:unknown] +# No special review for changelog needed and changelog was never a label. +changes.delete(:changelog) +# No special review for feature flags needed. +changes.delete(:feature_flag) +categories = Set.new(changes.keys - [:unknown]) # Ensure to spin for database reviewer/maintainer when ~database is applied (e.g. to review SQL queries) -categories << :database if helper.mr_labels.include?('database') && !categories.include?(:database) +categories << :database if helper.mr_labels.include?('database') + +# Ensure to spin for Product Intelligence reviewer when ~"product intelligence::review pending" is applied +categories << :product_intelligence if helper.mr_labels.include?("product intelligence::review pending") if changes.any? project = project_helper.project_name |