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-10-25 09:12:21 +00:00
|
|
|
product_intelligence_paths_to_review = project_helper.changes_by_category[:product_intelligence]
|
2021-09-27 18:12:38 +00:00
|
|
|
labels = product_intelligence.missing_labels
|
2021-02-08 06:09:18 +00:00
|
|
|
|
2021-10-25 09:12:21 +00:00
|
|
|
return if product_intelligence_paths_to_review.empty? || labels.empty?
|
2020-09-29 15:10:08 +00:00
|
|
|
|
2021-10-25 09:12:21 +00:00
|
|
|
warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(product_intelligence_paths_to_review))
|
2020-09-29 15:10:08 +00:00
|
|
|
|
2021-05-20 00:10:36 +00:00
|
|
|
gitlab.api.update_merge_request(gitlab.mr_json['project_id'],
|
2021-04-27 15:09:52 +00:00
|
|
|
gitlab.mr_json['iid'],
|
2021-04-28 21:10:01 +00:00
|
|
|
add_labels: labels)
|