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
c6d1148c
Commit
c6d1148c
authored
Dec 08, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not apply SLA labels for projects without license
parent
c69f85f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
ee/app/workers/incident_management/apply_incident_sla_exceeded_label_worker.rb
...nt_management/apply_incident_sla_exceeded_label_worker.rb
+1
-1
ee/spec/workers/incident_management/apply_incident_sla_exceeded_label_worker_spec.rb
...nagement/apply_incident_sla_exceeded_label_worker_spec.rb
+15
-0
No files found.
ee/app/workers/incident_management/apply_incident_sla_exceeded_label_worker.rb
View file @
c6d1148c
...
...
@@ -9,7 +9,7 @@ module IncidentManagement
def
perform
(
incident_id
)
@incident
=
Issue
.
find_by_id
(
incident_id
)
return
unless
incident
&
.
s
upports_severity
?
return
unless
incident
&
.
s
la_available
?
@project
=
incident
&
.
project
return
unless
project
...
...
ee/spec/workers/incident_management/apply_incident_sla_exceeded_label_worker_spec.rb
View file @
c6d1148c
...
...
@@ -16,6 +16,10 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
subject
(
:perform
)
{
worker
.
perform
(
incident
.
id
)
}
before
do
stub_licensed_features
(
incident_sla:
true
)
end
context
'label exists already'
do
before
do
incident
.
labels
<<
label
...
...
@@ -50,4 +54,15 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
expect
(
incident
.
labels
.
reload
).
to
be_empty
end
end
context
'without license'
do
before
do
stub_licensed_features
(
incident_sla:
false
)
end
it
'does not add a label'
,
:aggregate_failures
do
expect
{
subject
}.
not_to
change
{
incident
.
labels
.
reload
.
count
}
expect
(
incident
.
labels
.
reload
).
to
be_empty
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