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
ad2e99ff
Commit
ad2e99ff
authored
Nov 27, 2020
by
Lee Tickett
Committed by
Mayra Cabrera
Nov 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created alias to map issues `service_desk_reply_to` to `external_author`
parent
a10b9c9a
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
17 additions
and
9 deletions
+17
-9
app/mailers/emails/service_desk.rb
app/mailers/emails/service_desk.rb
+1
-1
app/models/issue.rb
app/models/issue.rb
+2
-0
app/services/notification_service.rb
app/services/notification_service.rb
+1
-1
changelogs/unreleased/225281-add-external_author-alias-for-service_desk_reply_to.yml
...1-add-external_author-alias-for-service_desk_reply_to.yml
+5
-0
lib/gitlab/email/handler/service_desk_handler.rb
lib/gitlab/email/handler/service_desk_handler.rb
+1
-1
lib/gitlab/import_export/project/import_export.yml
lib/gitlab/import_export/project/import_export.yml
+1
-0
spec/fixtures/lib/gitlab/import_export/designs/project.json
spec/fixtures/lib/gitlab/import_export/designs/project.json
+2
-2
spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
+1
-1
spec/lib/gitlab/import_export/safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+1
-1
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+1
-1
No files found.
app/mailers/emails/service_desk.rb
View file @
ad2e99ff
...
@@ -47,7 +47,7 @@ module Emails
...
@@ -47,7 +47,7 @@ module Emails
def
service_desk_options
(
email_sender
,
email_type
)
def
service_desk_options
(
email_sender
,
email_type
)
{
{
from:
email_sender
,
from:
email_sender
,
to:
@issue
.
service_desk_reply_to
to:
@issue
.
external_author
}.
tap
do
|
options
|
}.
tap
do
|
options
|
next
unless
template_body
=
template_content
(
email_type
)
next
unless
template_body
=
template_content
(
email_type
)
...
...
app/models/issue.rb
View file @
ad2e99ff
...
@@ -90,6 +90,8 @@ class Issue < ApplicationRecord
...
@@ -90,6 +90,8 @@ class Issue < ApplicationRecord
alias_attribute
:parent_ids
,
:project_id
alias_attribute
:parent_ids
,
:project_id
alias_method
:issuing_parent
,
:project
alias_method
:issuing_parent
,
:project
alias_attribute
:external_author
,
:service_desk_reply_to
scope
:in_projects
,
->
(
project_ids
)
{
where
(
project_id:
project_ids
)
}
scope
:in_projects
,
->
(
project_ids
)
{
where
(
project_id:
project_ids
)
}
scope
:not_in_projects
,
->
(
project_ids
)
{
where
.
not
(
project_id:
project_ids
)
}
scope
:not_in_projects
,
->
(
project_ids
)
{
where
.
not
(
project_id:
project_ids
)
}
...
...
app/services/notification_service.rb
View file @
ad2e99ff
...
@@ -353,7 +353,7 @@ class NotificationService
...
@@ -353,7 +353,7 @@ class NotificationService
issue
=
note
.
noteable
issue
=
note
.
noteable
support_bot
=
User
.
support_bot
support_bot
=
User
.
support_bot
return
unless
issue
.
service_desk_reply_to
.
present?
return
unless
issue
.
external_author
.
present?
return
unless
issue
.
project
.
service_desk_enabled?
return
unless
issue
.
project
.
service_desk_enabled?
return
if
note
.
author
==
support_bot
return
if
note
.
author
==
support_bot
return
unless
issue
.
subscribed?
(
support_bot
,
issue
.
project
)
return
unless
issue
.
subscribed?
(
support_bot
,
issue
.
project
)
...
...
changelogs/unreleased/225281-add-external_author-alias-for-service_desk_reply_to.yml
0 → 100644
View file @
ad2e99ff
---
title
:
Add `external_author` alias to `service_desk_reply_to`
merge_request
:
48363
author
:
Lee Tickett
type
:
other
lib/gitlab/email/handler/service_desk_handler.rb
View file @
ad2e99ff
...
@@ -78,7 +78,7 @@ module Gitlab
...
@@ -78,7 +78,7 @@ module Gitlab
title:
issue_title
,
title:
issue_title
,
description:
message_including_template
,
description:
message_including_template
,
confidential:
true
,
confidential:
true
,
service_desk_reply_to
:
from_address
external_author
:
from_address
).
execute
).
execute
raise
InvalidIssueError
unless
@issue
.
persisted?
raise
InvalidIssueError
unless
@issue
.
persisted?
...
...
lib/gitlab/import_export/project/import_export.yml
View file @
ad2e99ff
...
@@ -220,6 +220,7 @@ excluded_attributes:
...
@@ -220,6 +220,7 @@ excluded_attributes:
-
:duplicated_to_id
-
:duplicated_to_id
-
:promoted_to_epic_id
-
:promoted_to_epic_id
-
:blocking_issues_count
-
:blocking_issues_count
-
:service_desk_reply_to
merge_request
:
merge_request
:
-
:milestone_id
-
:milestone_id
-
:sprint_id
-
:sprint_id
...
...
spec/fixtures/lib/gitlab/import_export/designs/project.json
View file @
ad2e99ff
...
@@ -61,7 +61,7 @@
...
@@ -61,7 +61,7 @@
"lock_version"
:
0
,
"lock_version"
:
0
,
"time_estimate"
:
0
,
"time_estimate"
:
0
,
"relative_position"
:
1073742323
,
"relative_position"
:
1073742323
,
"
service_desk_reply_to
"
:
null
,
"
external_author
"
:
null
,
"last_edited_at"
:
null
,
"last_edited_at"
:
null
,
"last_edited_by_id"
:
null
,
"last_edited_by_id"
:
null
,
"discussion_locked"
:
null
,
"discussion_locked"
:
null
,
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
"lock_version"
:
0
,
"lock_version"
:
0
,
"time_estimate"
:
0
,
"time_estimate"
:
0
,
"relative_position"
:
1073742823
,
"relative_position"
:
1073742823
,
"
service_desk_reply_to
"
:
null
,
"
external_author
"
:
null
,
"last_edited_at"
:
null
,
"last_edited_at"
:
null
,
"last_edited_by_id"
:
null
,
"last_edited_by_id"
:
null
,
"discussion_locked"
:
null
,
"discussion_locked"
:
null
,
...
...
spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
View file @
ad2e99ff
...
@@ -254,7 +254,7 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do
...
@@ -254,7 +254,7 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do
new_issue
=
Issue
.
last
new_issue
=
Issue
.
last
expect
(
new_issue
.
service_desk_reply_to
).
to
eq
(
'finn@adventuretime.ooo'
)
expect
(
new_issue
.
external_author
).
to
eq
(
'finn@adventuretime.ooo'
)
end
end
end
end
...
...
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
ad2e99ff
...
@@ -26,7 +26,7 @@ Issue:
...
@@ -26,7 +26,7 @@ Issue:
-
weight
-
weight
-
time_estimate
-
time_estimate
-
relative_position
-
relative_position
-
service_desk_reply_to
-
external_author
-
last_edited_at
-
last_edited_at
-
last_edited_by_id
-
last_edited_by_id
-
discussion_locked
-
discussion_locked
...
...
spec/mailers/notify_spec.rb
View file @
ad2e99ff
...
@@ -1284,7 +1284,7 @@ RSpec.describe Notify do
...
@@ -1284,7 +1284,7 @@ RSpec.describe Notify do
context
'for service desk issues'
do
context
'for service desk issues'
do
before
do
before
do
issue
.
update!
(
service_desk_reply_to
:
'service.desk@example.com'
)
issue
.
update!
(
external_author
:
'service.desk@example.com'
)
end
end
def
expect_sender
(
username
)
def
expect_sender
(
username
)
...
...
spec/services/notification_service_spec.rb
View file @
ad2e99ff
...
@@ -353,7 +353,7 @@ RSpec.describe NotificationService, :mailer do
...
@@ -353,7 +353,7 @@ RSpec.describe NotificationService, :mailer do
context
'a service-desk issue'
do
context
'a service-desk issue'
do
before
do
before
do
issue
.
update!
(
service_desk_reply_to
:
'service.desk@example.com'
)
issue
.
update!
(
external_author
:
'service.desk@example.com'
)
project
.
update!
(
service_desk_enabled:
true
)
project
.
update!
(
service_desk_enabled:
true
)
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