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
7b8c75b8
Commit
7b8c75b8
authored
Mar 04, 2021
by
David Kim
Committed by
Etienne Baqué
Mar 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reviewers detail to merged merge request email
parent
37d862c3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
32 deletions
+44
-32
app/views/notify/merged_merge_request_email.text.haml
app/views/notify/merged_merge_request_email.text.haml
+1
-0
changelogs/unreleased/300750-add-missing-reviewers-information-to-merged-merge-request-email.yml
...g-reviewers-information-to-merged-merge-request-email.yml
+5
-0
spec/mailers/emails/merge_requests_spec.rb
spec/mailers/emails/merge_requests_spec.rb
+38
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+0
-31
No files found.
app/views/notify/merged_merge_request_email.text.haml
View file @
7b8c75b8
...
...
@@ -6,3 +6,4 @@ Merge Request URL: #{project_merge_request_url(@merge_request.target_project, @m
Author:
#{
sanitize_name
(
@merge_request
.
author_name
)
}
=
assignees_label
(
@merge_request
)
=
reviewers_label
(
@merge_request
)
changelogs/unreleased/300750-add-missing-reviewers-information-to-merged-merge-request-email.yml
0 → 100644
View file @
7b8c75b8
---
title
:
Add reviewers detail to merged merge request email
merge_request
:
55589
author
:
type
:
added
spec/mailers/emails/merge_requests_spec.rb
View file @
7b8c75b8
...
...
@@ -6,7 +6,8 @@ require 'email_spec'
RSpec
.
describe
Emails
::
MergeRequests
do
include
EmailSpec
::
Matchers
let_it_be
(
:recipient
)
{
create
(
:user
)
}
include_context
'gitlab email notification'
let_it_be
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:assignee
,
reload:
true
)
{
create
(
:user
,
email:
'assignee@example.com'
,
name:
'John Doe'
)
}
let_it_be
(
:reviewer
,
reload:
true
)
{
create
(
:user
,
email:
'reviewer@example.com'
,
name:
'Jane Doe'
)
}
...
...
@@ -20,6 +21,42 @@ RSpec.describe Emails::MergeRequests do
description:
'Awesome description'
)
end
let
(
:recipient
)
{
assignee
}
describe
'#merged_merge_request_email'
do
let
(
:merge_author
)
{
assignee
}
subject
{
Notify
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
merge_author
.
id
)
}
it_behaves_like
'a multiple recipients email'
it_behaves_like
'an answer to an existing thread with reply-by-email enabled'
do
let
(
:model
)
{
merge_request
}
end
it_behaves_like
'it should show Gmail Actions View Merge request link'
it_behaves_like
'an unsubscribeable thread'
it_behaves_like
'appearance header and footer enabled'
it_behaves_like
'appearance header and footer not enabled'
it
'is sent as the merge author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
expect
(
sender
.
display_name
).
to
eq
(
merge_author
.
name
)
expect
(
sender
.
address
).
to
eq
(
gitlab_sender
)
end
it
'has the correct subject and body'
do
aggregate_failures
do
is_expected
.
to
have_referable_subject
(
merge_request
,
reply:
true
)
is_expected
.
to
have_body_text
(
'merged'
)
is_expected
.
to
have_body_text
(
project_merge_request_path
(
project
,
merge_request
))
is_expected
.
to
have_link
(
merge_request
.
to_reference
,
href:
project_merge_request_url
(
merge_request
.
target_project
,
merge_request
))
expect
(
subject
.
text_part
).
to
have_content
(
assignee
.
name
)
expect
(
subject
.
text_part
).
to
have_content
(
reviewer
.
name
)
end
end
end
describe
"#merge_when_pipeline_succeeds_email"
do
let
(
:title
)
{
"Merge request
#{
merge_request
.
to_reference
}
was scheduled to merge after pipeline succeeds by
#{
current_user
.
name
}
"
}
...
...
spec/mailers/notify_spec.rb
View file @
7b8c75b8
...
...
@@ -495,37 +495,6 @@ RSpec.describe Notify do
end
end
describe
'that are merged'
do
let
(
:merge_author
)
{
create
(
:user
)
}
subject
{
described_class
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
merge_author
.
id
)
}
it_behaves_like
'a multiple recipients email'
it_behaves_like
'an answer to an existing thread with reply-by-email enabled'
do
let
(
:model
)
{
merge_request
}
end
it_behaves_like
'it should show Gmail Actions View Merge request link'
it_behaves_like
'an unsubscribeable thread'
it_behaves_like
'appearance header and footer enabled'
it_behaves_like
'appearance header and footer not enabled'
it
'is sent as the merge author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
expect
(
sender
.
display_name
).
to
eq
(
merge_author
.
name
)
expect
(
sender
.
address
).
to
eq
(
gitlab_sender
)
end
it
'has the correct subject and body'
do
aggregate_failures
do
is_expected
.
to
have_referable_subject
(
merge_request
,
reply:
true
)
is_expected
.
to
have_body_text
(
'merged'
)
is_expected
.
to
have_body_text
(
project_merge_request_path
(
project
,
merge_request
))
is_expected
.
to
have_link
(
merge_request
.
to_reference
,
href:
project_merge_request_url
(
merge_request
.
target_project
,
merge_request
))
end
end
end
describe
'that are unmergeable'
do
let_it_be
(
:merge_request
)
do
create
(
:merge_request
,
:conflict
,
...
...
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