Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5aabda94
Commit
5aabda94
authored
Dec 03, 2021
by
Piotr Skorupa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Danger not warning when there are no PI labels to add
parent
59e5e1f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
danger/product_intelligence/Dangerfile
danger/product_intelligence/Dangerfile
+3
-3
tooling/danger/product_intelligence.rb
tooling/danger/product_intelligence.rb
+10
-3
No files found.
danger/product_intelligence/Dangerfile
View file @
5aabda94
...
...
@@ -15,8 +15,8 @@ MSG
product_intelligence_paths_to_review
=
helper
.
changes_by_category
[
:product_intelligence
]
labels_to_add
=
product_intelligence
.
missing_labels
return
if
product_intelligence_paths_to_review
.
empty?
||
labels_to_add
.
empty?
return
if
product_intelligence_paths_to_review
.
empty?
warn
format
(
CHANGED_FILES_MESSAGE
,
changed_files:
helper
.
markdown_list
(
product_intelligence_paths_to_review
))
warn
format
(
CHANGED_FILES_MESSAGE
,
changed_files:
helper
.
markdown_list
(
product_intelligence_paths_to_review
))
unless
product_intelligence
.
has_approved_label?
project_helper
.
labels_to_add
.
concat
(
labels_to_add
)
project_helper
.
labels_to_add
.
concat
(
labels_to_add
)
unless
labels_to_add
.
empty?
tooling/danger/product_intelligence.rb
View file @
5aabda94
...
...
@@ -4,9 +4,12 @@
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
...
...
@@ -14,11 +17,15 @@ module Tooling
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
private
def
has_workflow_labels?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment