2020-09-29 11:10:08 -04:00
|
|
|
# frozen_string_literal: true
|
2021-02-08 01:09:18 -05:00
|
|
|
# rubocop:disable Style/SignalException
|
2020-09-29 11:10:08 -04:00
|
|
|
|
2021-01-11 16:10:36 -05:00
|
|
|
CHANGED_FILES_MESSAGE = <<~MSG
|
2021-01-12 19:10:50 -05: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 08:09:21 -04:00
|
|
|
Please check the ~"product intelligence" [guide](https://docs.gitlab.com/ee/development/usage_ping.html).
|
2020-09-29 11:10:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
%<changed_files>s
|
|
|
|
|
|
|
|
MSG
|
|
|
|
|
2021-05-19 20:10:36 -04:00
|
|
|
# exit if not matching files
|
|
|
|
matching_changed_files = product_intelligence.matching_changed_files
|
|
|
|
return unless matching_changed_files.any?
|
2021-02-08 01:09:18 -05:00
|
|
|
|
2021-05-19 20:10:36 -04:00
|
|
|
warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(matching_changed_files))
|
2020-09-29 11:10:08 -04:00
|
|
|
|
2021-05-19 20:10:36 -04:00
|
|
|
labels = product_intelligence.missing_labels
|
|
|
|
return unless labels.any?
|
2020-09-29 11:10:08 -04:00
|
|
|
|
2021-05-19 20:10:36 -04:00
|
|
|
gitlab.api.update_merge_request(gitlab.mr_json['project_id'],
|
2021-04-27 11:09:52 -04:00
|
|
|
gitlab.mr_json['iid'],
|
2021-04-28 17:10:01 -04:00
|
|
|
add_labels: labels)
|