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
75943f4a
Commit
75943f4a
authored
Jan 13, 2022
by
Sean Arnold
Committed by
Luke Duncalfe
Jan 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up escalations after changing incident proj
Changelog: added EE: true
parent
3f60fd64
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
ee/app/services/ee/issues/move_service.rb
ee/app/services/ee/issues/move_service.rb
+5
-0
ee/spec/services/ee/issues/move_service_spec.rb
ee/spec/services/ee/issues/move_service_spec.rb
+12
-0
spec/services/issues/move_service_spec.rb
spec/services/issues/move_service_spec.rb
+10
-0
No files found.
ee/app/services/ee/issues/move_service.rb
View file @
75943f4a
...
...
@@ -10,6 +10,7 @@ module EE
rewrite_epic_issue
rewrite_related_vulnerability_issues
track_epic_issue_moved_from_project
delete_pending_escalations
super
end
...
...
@@ -43,6 +44,10 @@ module EE
issue_links
=
Vulnerabilities
::
IssueLink
.
for_issue
(
original_entity
)
issue_links
.
update_all
(
issue_id:
new_entity
.
id
)
end
def
delete_pending_escalations
original_entity
.
pending_escalations
.
delete_all
(
:delete_all
)
end
end
end
end
ee/spec/services/ee/issues/move_service_spec.rb
View file @
75943f4a
...
...
@@ -152,4 +152,16 @@ RSpec.describe Issues::MoveService do
end
end
end
describe
'#delete_pending_escalations'
do
let!
(
:pending_escalation
)
{
create
(
:incident_management_pending_issue_escalation
,
issue:
old_issue
)
}
it
'deletes the pending escalations for the incident'
do
new_issue
=
move_service
.
execute
(
old_issue
,
new_project
)
expect
(
new_issue
.
pending_escalations
.
count
).
to
eq
(
0
)
expect
(
old_issue
.
pending_escalations
.
count
).
to
eq
(
0
)
expect
{
pending_escalation
.
reload
}.
to
raise_error
(
ActiveRecord
::
RecordNotFound
)
end
end
end
spec/services/issues/move_service_spec.rb
View file @
75943f4a
...
...
@@ -259,6 +259,16 @@ RSpec.describe Issues::MoveService do
it_behaves_like
'copy or reset relative position'
end
context
'issue with escalation status'
do
it
'keeps the escalation status'
do
escalation_status
=
create
(
:incident_management_issuable_escalation_status
,
issue:
old_issue
)
move_service
.
execute
(
old_issue
,
new_project
)
expect
(
escalation_status
.
reload
.
issue
).
to
eq
(
old_issue
)
end
end
end
describe
'move permissions'
do
...
...
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