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
4168787c
Commit
4168787c
authored
Sep 22, 2021
by
alinamihaila
Committed by
Rémy Coutable
Sep 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip Product Intelligence review for growth experiments MRs
parent
e06b922e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
6 deletions
+14
-6
danger/product_intelligence/Dangerfile
danger/product_intelligence/Dangerfile
+4
-5
danger/roulette/Dangerfile
danger/roulette/Dangerfile
+1
-0
spec/tooling/danger/product_intelligence_spec.rb
spec/tooling/danger/product_intelligence_spec.rb
+8
-0
tooling/danger/product_intelligence.rb
tooling/danger/product_intelligence.rb
+1
-1
No files found.
danger/product_intelligence/Dangerfile
View file @
4168787c
...
@@ -10,14 +10,13 @@ Please check the ~"product intelligence" [guide](https://docs.gitlab.com/ee/deve
...
@@ -10,14 +10,13 @@ Please check the ~"product intelligence" [guide](https://docs.gitlab.com/ee/deve
MSG
MSG
# exit if not matching files
# exit if not matching files
or if no product intelligence labels
matching_changed_files
=
product_intelligence
.
matching_changed_files
matching_changed_files
=
product_intelligence
.
matching_changed_files
return
unless
matching_changed_files
.
any?
labels
=
product_intelligence
.
missing_labels
warn
format
(
CHANGED_FILES_MESSAGE
,
changed_files:
helper
.
markdown_list
(
matching_changed_files
))
return
if
matching_changed_files
.
empty?
||
labels
.
empty?
labels
=
product_intelligence
.
missing_labels
warn
format
(
CHANGED_FILES_MESSAGE
,
changed_files:
helper
.
markdown_list
(
matching_changed_files
))
return
unless
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'
],
...
...
danger/roulette/Dangerfile
View file @
4168787c
...
@@ -98,6 +98,7 @@ categories << :database if helper.mr_labels.include?('database')
...
@@ -98,6 +98,7 @@ categories << :database if helper.mr_labels.include?('database')
# Ensure to spin for Product Intelligence reviewer when ~"product intelligence::review pending" is applied
# Ensure to spin for Product Intelligence reviewer when ~"product intelligence::review pending" is applied
categories
<<
:product_intelligence
if
helper
.
mr_labels
.
include?
(
"product intelligence::review pending"
)
categories
<<
:product_intelligence
if
helper
.
mr_labels
.
include?
(
"product intelligence::review pending"
)
categories
.
delete
(
:product_intelligence
)
unless
helper
.
mr_labels
.
include?
(
"product intelligence"
)
if
changes
.
any?
if
changes
.
any?
project
=
project_helper
.
project_name
project
=
project_helper
.
project_name
...
...
spec/tooling/danger/product_intelligence_spec.rb
View file @
4168787c
...
@@ -59,6 +59,14 @@ RSpec.describe Tooling::Danger::ProductIntelligence do
...
@@ -59,6 +59,14 @@ RSpec.describe Tooling::Danger::ProductIntelligence do
it
{
is_expected
.
to
be_empty
}
it
{
is_expected
.
to
be_empty
}
end
end
context
'with growth experiment label'
do
before
do
allow
(
fake_helper
).
to
receive
(
:mr_has_labels?
).
with
(
'growth experiment'
).
and_return
(
true
)
end
it
{
is_expected
.
to
be_empty
}
end
end
end
describe
'#matching_changed_files'
do
describe
'#matching_changed_files'
do
...
...
tooling/danger/product_intelligence.rb
View file @
4168787c
...
@@ -30,7 +30,7 @@ module Tooling
...
@@ -30,7 +30,7 @@ module Tooling
].
freeze
].
freeze
def
missing_labels
def
missing_labels
return
[]
unless
helper
.
ci?
return
[]
if
!
helper
.
ci?
||
helper
.
mr_has_labels?
(
'growth experiment'
)
labels
=
[]
labels
=
[]
labels
<<
'product intelligence'
unless
helper
.
mr_has_labels?
(
'product intelligence'
)
labels
<<
'product intelligence'
unless
helper
.
mr_has_labels?
(
'product intelligence'
)
...
...
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