debian-mirror-gitlab/danger/product_intelligence/Dangerfile

23 lines
1.2 KiB
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
2021-03-11 19:13:27 +05:30
# rubocop:disable Style/SignalException
2021-01-03 14:25:43 +05:30
2021-03-08 18:12:59 +05:30
CHANGED_FILES_MESSAGE = <<~MSG
For the following files, a review from the [Data team and Product Intelligence team](https://gitlab.com/groups/gitlab-org/growth/product-intelligence/engineers/-/group_members?with_inherited_permissions=exclude) is recommended
2021-04-29 21:17:54 +05:30
Please check the ~"product intelligence" [guide](https://docs.gitlab.com/ee/development/usage_ping.html).
2021-01-03 14:25:43 +05:30
2021-11-18 22:05:49 +05:30
For MR review guidelines, see the [Service Ping review guidelines](https://docs.gitlab.com/ee/development/usage_ping/review_guidelines.html) or the [Snowplow review guidelines](https://docs.gitlab.com/ee/development/snowplow/review_guidelines.html).
2021-01-03 14:25:43 +05:30
%<changed_files>s
MSG
2021-11-18 22:05:49 +05:30
# exit if not matching files or if no product intelligence labels
2022-01-26 12:08:38 +05:30
product_intelligence_paths_to_review = helper.changes_by_category[:product_intelligence]
2021-12-11 22:18:48 +05:30
labels_to_add = product_intelligence.missing_labels
2021-03-11 19:13:27 +05:30
2022-01-26 12:08:38 +05:30
return if product_intelligence_paths_to_review.empty? || product_intelligence.skip_review?
2021-01-03 14:25:43 +05:30
2022-01-26 12:08:38 +05:30
warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(product_intelligence_paths_to_review)) unless product_intelligence.has_approved_label?
2021-04-17 20:07:23 +05:30
2022-05-07 20:08:51 +05:30
helper.labels_to_add.concat(labels_to_add) unless labels_to_add.empty?