Commit c9b7dc57 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-product-intelligence-dangerfile' into 'master'

Allow the product intelligence Dangerfile to work locally and ensure the correct labels are added in product intelligence Dangerfile

See merge request gitlab-org/gitlab!60481
parents 2085863e 62292aab
...@@ -81,11 +81,12 @@ matching_changed_files = usage_data_changed_files + ...@@ -81,11 +81,12 @@ matching_changed_files = usage_data_changed_files +
snowplow_changed_files snowplow_changed_files
if matching_changed_files.any? if matching_changed_files.any?
warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(matching_changed_files)) warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(matching_changed_files))
fail format(UPDATE_DICTIONARY_MESSAGE) if required_dictionary_update_changed_files.any? && dictionary_changed_file.empty? fail format(UPDATE_DICTIONARY_MESSAGE) if required_dictionary_update_changed_files.any? && dictionary_changed_file.empty?
return unless helper.ci?
labels = [] labels = []
labels << 'product intelligence' unless helper.mr_has_labels?('product intelligence') labels << 'product intelligence' unless helper.mr_has_labels?('product intelligence')
labels << 'product intelligence::review pending' unless helper.mr_has_labels?(['product intelligence::approved', 'product intelligence::review pending']) labels << 'product intelligence::review pending' unless helper.mr_has_labels?(['product intelligence::approved', 'product intelligence::review pending'])
...@@ -93,6 +94,6 @@ if matching_changed_files.any? ...@@ -93,6 +94,6 @@ if matching_changed_files.any?
if labels.any? if labels.any?
gitlab.api.update_merge_request(gitlab.mr_json['project_id'], gitlab.api.update_merge_request(gitlab.mr_json['project_id'],
gitlab.mr_json['iid'], gitlab.mr_json['iid'],
add_labels: helper.prepare_labels_for_mr(labels)) add_labels: labels)
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment