From 1ca053c1f361cb17b2bb2790cdf695c17794d75f Mon Sep 17 00:00:00 2001
From: Paul Slaughter <pslaughter@gitlab.com>
Date: Wed, 6 May 2020 12:07:48 -0500
Subject: [PATCH] Remove gitlab_ui_wg specific Dangerfile

**Why?**
- This might have been necessary when `gitlab-ui`
  was in its early stage. But now it's just confusing.
- Also, it's coupled with a `CSS Cleanup` label
  which isn't used consistently.
- Also, it has hard coded references to people
  regardless of availability.
---
 danger/gitlab_ui_wg/Dangerfile | 62 ----------------------------------
 danger/roulette/Dangerfile     |  4 +--
 lib/gitlab_danger.rb           |  1 -
 3 files changed, 1 insertion(+), 66 deletions(-)
 delete mode 100644 danger/gitlab_ui_wg/Dangerfile

diff --git a/danger/gitlab_ui_wg/Dangerfile b/danger/gitlab_ui_wg/Dangerfile
deleted file mode 100644
index 672b1deecb3ae..0000000000000
--- a/danger/gitlab_ui_wg/Dangerfile
+++ /dev/null
@@ -1,62 +0,0 @@
-FRONTEND_MAINTAINERS = %w[filipa iamphill psimyn sarahghp mishunov].freeze
-UX_MAINTAINERS = %w[tauriedavis rverissimo].freeze
-NO_REVIEWER = 'No reviewer available'.freeze
-
-def mention_single_codebase_approvers
-  canonical_branch_name =
-    roulette.canonical_branch_name(gitlab.mr_json['source_branch'])
-
-  random = roulette.new_random(canonical_branch_name)
-
-  frontend_maintainers = helper.new_teammates(FRONTEND_MAINTAINERS)
-  ux_maintainers = helper.new_teammates(UX_MAINTAINERS)
-
-  rows = []
-
-  if gitlab.mr_labels.include?('frontend')
-    frontend_maintainer =
-      roulette.spin_for_person(frontend_maintainers, random: random)
-
-    rows << "| ~frontend | #{frontend_maintainer&.markdown_name || NO_REVIEWER}"
-  end
-
-  if gitlab.mr_labels.include?('UX')
-    ux_maintainers =
-      roulette.spin_for_person(ux_maintainers, random: random)
-
-    rows << "| ~UX | #{ux_maintainers&.markdown_name || NO_REVIEWER}"
-  end
-
-  if rows.empty?
-    backup_maintainer = frontend_maintainers.sample
-
-    rows << "| ~frontend / ~UX | #{backup_maintainer.markdown_name}"
-  end
-
-  markdown(<<~MARKDOWN.strip)
-    ## GitLab UI Working Group changes
-
-    This merge request contains changes related to the work of [cleaning up CSS and creating
-    reusable components](https://gitlab.com/groups/gitlab-org/-/epics/950).
-    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?('CSS cleanup')
-  mention_single_codebase_approvers
-end
diff --git a/danger/roulette/Dangerfile b/danger/roulette/Dangerfile
index 721ca8ba475f1..d73f6bf4f1030 100644
--- a/danger/roulette/Dangerfile
+++ b/danger/roulette/Dangerfile
@@ -77,9 +77,7 @@ 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)
 
-# CSS Clean up MRs are reviewed using a slightly different process, so we
-# disable the review roulette for such MRs.
-if changes.any? && !gitlab.mr_labels.include?('CSS cleanup')
+if changes.any?
   # Strip leading and trailing CE/EE markers
   canonical_branch_name =
     roulette.canonical_branch_name(gitlab.mr_json['source_branch'])
diff --git a/lib/gitlab_danger.rb b/lib/gitlab_danger.rb
index ebfeb2671e2c2..1c1763454a5a7 100644
--- a/lib/gitlab_danger.rb
+++ b/lib/gitlab_danger.rb
@@ -20,7 +20,6 @@ class GitlabDanger
     changelog
     specs
     roulette
-    gitlab_ui_wg
     ce_ee_vue_templates
   ].freeze
 
-- 
GitLab