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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
9b91e681
Commit
9b91e681
authored
May 27, 2019
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cancel auto merge when merge request is closed
We should cancel auto merge when merge request is closed.
parent
9a9c947b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
app/services/merge_requests/close_service.rb
app/services/merge_requests/close_service.rb
+5
-0
changelogs/unreleased/cancel-auto-merge-when-merge-request-is-closed.yml
...leased/cancel-auto-merge-when-merge-request-is-closed.yml
+5
-0
spec/services/merge_requests/close_service_spec.rb
spec/services/merge_requests/close_service_spec.rb
+8
-0
No files found.
app/services/merge_requests/close_service.rb
View file @
9b91e681
...
...
@@ -18,6 +18,7 @@ module MergeRequests
invalidate_cache_counts
(
merge_request
,
users:
merge_request
.
assignees
)
merge_request
.
update_project_counter_caches
cleanup_environments
(
merge_request
)
cancel_auto_merge
(
merge_request
)
end
merge_request
...
...
@@ -33,5 +34,9 @@ module MergeRequests
merge_request_metrics_service
(
merge_request
).
close
(
close_event
)
end
end
def
cancel_auto_merge
(
merge_request
)
AutoMergeService
.
new
(
project
,
current_user
).
cancel
(
merge_request
)
end
end
end
changelogs/unreleased/cancel-auto-merge-when-merge-request-is-closed.yml
0 → 100644
View file @
9b91e681
---
title
:
Cancel auto merge when merge request is closed
merge_request
:
28782
author
:
type
:
fixed
spec/services/merge_requests/close_service_spec.rb
View file @
9b91e681
...
...
@@ -52,6 +52,14 @@ describe MergeRequests::CloseService do
it
'marks todos as done'
do
expect
(
todo
.
reload
).
to
be_done
end
context
'when auto merge is enabled'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
:merge_when_pipeline_succeeds
)
}
it
'cancels the auto merge'
do
expect
(
@merge_request
).
not_to
be_auto_merge_enabled
end
end
end
it
'updates metrics'
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