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
74b6309f
Commit
74b6309f
authored
Dec 07, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not apply SLA labels when issuable does not support it
parent
bb9ef246
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
ee/app/workers/incident_management/apply_incident_sla_exceeded_label_worker.rb
...nt_management/apply_incident_sla_exceeded_label_worker.rb
+3
-2
ee/spec/workers/incident_management/apply_incident_sla_exceeded_label_worker_spec.rb
...nagement/apply_incident_sla_exceeded_label_worker_spec.rb
+11
-0
No files found.
ee/app/workers/incident_management/apply_incident_sla_exceeded_label_worker.rb
View file @
74b6309f
...
...
@@ -9,9 +9,10 @@ module IncidentManagement
def
perform
(
incident_id
)
@incident
=
Issue
.
find_by_id
(
incident_id
)
@project
=
incident
&
.
project
return
unless
incident
&
.
supports_severity?
return
unless
incident
&&
project
@project
=
incident
&
.
project
return
unless
project
@label
=
incident_exceeded_sla_label
return
if
incident
.
label_ids
.
include?
(
label
.
id
)
...
...
ee/spec/workers/incident_management/apply_incident_sla_exceeded_label_worker_spec.rb
View file @
74b6309f
...
...
@@ -39,4 +39,15 @@ RSpec.describe IncidentManagement::ApplyIncidentSlaExceededLabelWorker do
expect
(
event
.
action
).
to
eq
(
'add'
)
expect
(
event
.
label
).
to
eq
(
label
)
end
context
'for plain issues'
do
before_all
do
incident
.
update!
(
issue_type:
'issue'
)
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