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
05ae26fe
Commit
05ae26fe
authored
Oct 27, 2021
by
Luis Mejia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid removing PI approved label
parent
62dd5e5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
spec/tooling/danger/product_intelligence_spec.rb
spec/tooling/danger/product_intelligence_spec.rb
+11
-5
tooling/danger/product_intelligence.rb
tooling/danger/product_intelligence.rb
+7
-1
No files found.
spec/tooling/danger/product_intelligence_spec.rb
View file @
05ae26fe
...
...
@@ -44,20 +44,26 @@ RSpec.describe Tooling::Danger::ProductIntelligence do
context
'with product intelligence label'
do
let
(
:expected_labels
)
{
[
'product intelligence::review pending'
]
}
let
(
:mr_labels
)
{
[]
}
before
do
allow
(
fake_helper
).
to
receive
(
:mr_has_labels?
).
with
(
'product intelligence'
).
and_return
(
true
)
allow
(
fake_helper
).
to
receive
(
:mr_labels
).
and_return
(
mr_labels
)
end
it
{
is_expected
.
to
match_array
(
expected_labels
)
}
end
context
'with product intelligence::review pending'
do
before
do
allow
(
fake_helper
).
to
receive
(
:mr_has_labels?
).
and_return
(
true
)
context
'with product intelligence::review pending'
do
let
(
:mr_labels
)
{
[
'product intelligence::review pending'
]
}
it
{
is_expected
.
to
be_empty
}
end
it
{
is_expected
.
to
be_empty
}
context
'with product intelligence::approved'
do
let
(
:mr_labels
)
{
[
'product intelligence::approved'
]
}
it
{
is_expected
.
to
be_empty
}
end
end
context
'with growth experiment label'
do
...
...
tooling/danger/product_intelligence.rb
View file @
05ae26fe
...
...
@@ -14,10 +14,16 @@ module Tooling
labels
=
[]
labels
<<
'product intelligence'
unless
helper
.
mr_has_labels?
(
'product intelligence'
)
labels
<<
'product intelligence::review pending'
unless
h
elper
.
mr_has_labels?
(
WORKFLOW_LABELS
)
labels
<<
'product intelligence::review pending'
unless
h
as_workflow_labels?
labels
end
private
def
has_workflow_labels?
(
WORKFLOW_LABELS
&
helper
.
mr_labels
).
any?
end
end
end
end
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