summaryrefslogtreecommitdiff
path: root/tooling/danger/product_intelligence.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tooling/danger/product_intelligence.rb')
-rw-r--r--tooling/danger/product_intelligence.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/tooling/danger/product_intelligence.rb b/tooling/danger/product_intelligence.rb
index 72fc8deac43..6185b2f0d08 100644
--- a/tooling/danger/product_intelligence.rb
+++ b/tooling/danger/product_intelligence.rb
@@ -4,21 +4,32 @@
module Tooling
module Danger
module ProductIntelligence
+ APPROVED_LABEL = 'product intelligence::approved'
+ REVIEW_LABEL = 'product intelligence::review pending'
+
WORKFLOW_LABELS = [
- 'product intelligence::approved',
- 'product intelligence::review pending'
+ APPROVED_LABEL,
+ REVIEW_LABEL
].freeze
def missing_labels
- return [] if !helper.ci? || helper.mr_has_labels?('growth experiment')
+ return [] unless helper.ci?
labels = []
labels << 'product intelligence' unless helper.mr_has_labels?('product intelligence')
- labels << 'product intelligence::review pending' unless has_workflow_labels?
+ labels << REVIEW_LABEL unless has_workflow_labels?
labels
end
+ def has_approved_label?
+ helper.mr_labels.include?(APPROVED_LABEL)
+ end
+
+ def skip_review?
+ helper.mr_has_labels?('growth experiment')
+ end
+
private
def has_workflow_labels?