Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'danger/clickhouse/Dangerfile')
-rw-r--r--danger/clickhouse/Dangerfile29
1 files changed, 29 insertions, 0 deletions
diff --git a/danger/clickhouse/Dangerfile b/danger/clickhouse/Dangerfile
new file mode 100644
index 00000000000..91fa45541e7
--- /dev/null
+++ b/danger/clickhouse/Dangerfile
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+CH_MESSAGE = <<~MSG
+This merge request requires a ClickHouse review. To make sure these
+changes are reviewed, take the following steps:
+
+1. Ensure the merge request has ~clickhouse and ~"clickhouse::review pending" labels.
+1. Assign and mention a ClickHouse reviewer.
+MSG
+
+CH_UNREVIEWED_LABEL = 'clickhouse::review pending'
+CH_APPROVED_LABEL = 'clickhouse::approved'
+
+CH_URL =
+ 'https://gitlab.com/groups/gitlab-org/maintainers/clickhouse/-/group_members?with_inherited_permissions=exclude'
+
+return if stable_branch.valid_stable_branch?
+return if helper.mr_labels.include?(CH_UNREVIEWED_LABEL)
+
+helper.labels_to_add << 'clickhouse' if clickhouse.changes.any?
+
+if helper.mr_labels.include?('clickhouse') || clickhouse.changes.any?
+ message 'This merge request adds or changes files that require a ' \
+ 'review from the [GitLab ClickHouse team](CH_URL).'
+
+ markdown(CH_MESSAGE)
+
+ helper.labels_to_add << CH_UNREVIEWED_LABEL unless helper.has_scoped_label_with_scope?("clickhouse")
+end