2020-09-29 15:10:08 +00:00
|
|
|
# frozen_string_literal: true
|
2021-02-08 06:09:18 +00:00
|
|
|
# rubocop:disable Style/SignalException
|
2020-09-29 15:10:08 +00:00
|
|
|
|
2021-01-11 21:10:36 +00:00
|
|
|
CHANGED_FILES_MESSAGE = <<~MSG
|
2021-01-13 00:10:50 +00:00
|
|
|
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-06 12:09:21 +00:00
|
|
|
Please check the ~"product intelligence" [guide](https://docs.gitlab.com/ee/development/usage_ping.html).
|
2020-09-29 15:10:08 +00:00
|
|
|
|
2021-10-06 18:12:19 +00:00
|
|
|
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).
|
2020-09-29 15:10:08 +00:00
|
|
|
|
|
|
|
%<changed_files>s
|
|
|
|
|
|
|
|
MSG
|
|
|
|
|
2021-09-27 18:12:38 +00:00
|
|
|
# exit if not matching files or if no product intelligence labels
|
2021-12-03 15:10:36 +00:00
|
|
|
product_intelligence_paths_to_review = helper.changes_by_category[:product_intelligence]
|
2021-10-27 18:13:16 +00:00
|
|
|
labels_to_add = product_intelligence.missing_labels
|
2021-02-08 06:09:18 +00:00
|
|
|
|
2021-12-15 15:15:54 +00:00
|
|
|
return if product_intelligence_paths_to_review.empty? || product_intelligence.skip_review?
|
2020-09-29 15:10:08 +00:00
|
|
|
|
2021-12-06 21:10:14 +00:00
|
|
|
warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(product_intelligence_paths_to_review)) unless product_intelligence.has_approved_label?
|
2020-09-29 15:10:08 +00:00
|
|
|
|
2022-03-02 21:16:54 +00:00
|
|
|
helper.labels_to_add.concat(labels_to_add) unless labels_to_add.empty?
|