summaryrefslogtreecommitdiff
path: root/danger
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 09:08:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 09:08:28 +0000
commit6ac4a6713ed3196af899011f7e18658e16ebaac0 (patch)
treec60237cb5203d171481b765d31bfead080d063cf /danger
parentd2b64c37bdef067656fdc8deb4728a2fbc6c2729 (diff)
downloadgitlab-ce-6ac4a6713ed3196af899011f7e18658e16ebaac0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'danger')
-rw-r--r--danger/telemetry/Dangerfile22
1 files changed, 18 insertions, 4 deletions
diff --git a/danger/telemetry/Dangerfile b/danger/telemetry/Dangerfile
index 68a226ef11b..227621cc1dd 100644
--- a/danger/telemetry/Dangerfile
+++ b/danger/telemetry/Dangerfile
@@ -6,14 +6,28 @@ review from the Data team and Telemetry team is recommended.
@gitlab-org/growth/telemetry group is mentioned in order to notify team members.
MSG
+USAGE_DATA_FILES_MESSAGE = <<~MSG
+For the following files, a review from the [Data team and Telemetry team](https://gitlab.com/groups/gitlab-org/growth/telemetry/-/group_members?with_inherited_permissions=exclude) is recommended:
+MSG
+
usage_data_changed_files = git.modified_files.grep(%r{usage_data})
+def has_label?(label)
+ gitlab.mr_labels.include?(label)
+end
+
+def labels_for_merge_request(labels)
+ labels_list = labels.map { |label| %Q{~"#{label}"} }.join(' ')
+ "/label #{labels_list}"
+end
+
if usage_data_changed_files.any?
warn format(TELEMETRY_CHANGED_FILES_MESSAGE)
- USAGE_DATA_FILES_MESSAGE = <<~MSG
- For the following files, a review from the [Data team and Telemetry team](https://gitlab.com/groups/gitlab-org/growth/telemetry/-/group_members?with_inherited_permissions=exclude) is recommended:
- MSG
-
markdown(USAGE_DATA_FILES_MESSAGE + helper.markdown_list(usage_data_changed_files))
+
+ telemetry_labels = ['telemetry']
+ telemetry_labels << 'telemetry::review pending' unless has_label?('telemetry::reviewed')
+
+ markdown(labels_for_merge_request(telemetry_labels))
end