Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-03-30 21:08:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-03-30 21:08:19 +0300
commitf06ebebadece98495408c29112abf1b65a43ecb6 (patch)
tree7df6f3c584086d35a3bd175cebef7215f08bec38 /tooling
parentf4199ade274d43b2627d17d9087f42d0f8175369 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'tooling')
-rw-r--r--tooling/danger/product_intelligence.rb25
1 files changed, 23 insertions, 2 deletions
diff --git a/tooling/danger/product_intelligence.rb b/tooling/danger/product_intelligence.rb
index 6185b2f0d08..dcac1099687 100644
--- a/tooling/danger/product_intelligence.rb
+++ b/tooling/danger/product_intelligence.rb
@@ -6,12 +6,35 @@ module Tooling
module ProductIntelligence
APPROVED_LABEL = 'product intelligence::approved'
REVIEW_LABEL = 'product intelligence::review pending'
+ 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
+ Please check the ~"product intelligence" [guide](https://docs.gitlab.com/ee/development/usage_ping.html).
+
+ 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).
+
+ %<changed_files>s
+
+ MSG
WORKFLOW_LABELS = [
APPROVED_LABEL,
REVIEW_LABEL
].freeze
+ def check!
+ # exit if not matching files or if no product intelligence labels
+ product_intelligence_paths_to_review = helper.changes_by_category[:product_intelligence]
+ labels_to_add = missing_labels
+
+ return if product_intelligence_paths_to_review.empty? || skip_review?
+
+ warn format(CHANGED_FILES_MESSAGE, changed_files: helper.markdown_list(product_intelligence_paths_to_review)) unless has_approved_label?
+
+ helper.labels_to_add.concat(labels_to_add) unless labels_to_add.empty?
+ end
+
+ private
+
def missing_labels
return [] unless helper.ci?
@@ -30,8 +53,6 @@ module Tooling
helper.mr_has_labels?('growth experiment')
end
- private
-
def has_workflow_labels?
(WORKFLOW_LABELS & helper.mr_labels).any?
end