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
b7740592
Commit
b7740592
authored
Mar 24, 2020
by
David Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger cannot merge email notification for async mergeability check
parent
c3fa286f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+8
-0
No files found.
app/models/merge_request.rb
View file @
b7740592
...
@@ -189,7 +189,7 @@ class MergeRequest < ApplicationRecord
...
@@ -189,7 +189,7 @@ class MergeRequest < ApplicationRecord
end
end
# rubocop: disable CodeReuse/ServiceClass
# rubocop: disable CodeReuse/ServiceClass
after_transition
unchecked:
:cannot_be_merged
do
|
merge_request
,
transition
|
after_transition
[
:unchecked
,
:checking
]
=>
:cannot_be_merged
do
|
merge_request
,
transition
|
if
merge_request
.
notify_conflict?
if
merge_request
.
notify_conflict?
NotificationService
.
new
.
merge_request_unmergeable
(
merge_request
)
NotificationService
.
new
.
merge_request_unmergeable
(
merge_request
)
TodoService
.
new
.
merge_request_became_unmergeable
(
merge_request
)
TodoService
.
new
.
merge_request_became_unmergeable
(
merge_request
)
...
...
spec/models/merge_request_spec.rb
View file @
b7740592
...
@@ -3223,6 +3223,14 @@ describe MergeRequest do
...
@@ -3223,6 +3223,14 @@ describe MergeRequest do
subject
.
mark_as_unmergeable
subject
.
mark_as_unmergeable
end
end
it
'notifies conflict, with enabled async mergability check'
do
expect
(
notification_service
).
to
receive
(
:merge_request_unmergeable
).
with
(
subject
).
once
expect
(
todo_service
).
to
receive
(
:merge_request_became_unmergeable
).
with
(
subject
).
once
subject
.
mark_as_checking
subject
.
mark_as_unmergeable
end
it
'does not notify whenever merge request is newly unmergeable due to other reasons'
do
it
'does not notify whenever merge request is newly unmergeable due to other reasons'
do
allow
(
subject
.
project
.
repository
).
to
receive
(
:can_be_merged?
).
and_return
(
true
)
allow
(
subject
.
project
.
repository
).
to
receive
(
:can_be_merged?
).
and_return
(
true
)
...
...
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