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
511f9415
Commit
511f9415
authored
Jan 12, 2021
by
Jan Provaznik
Committed by
Kamil Trzciński
Jan 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove customer service_desk_custom_address flag
This flag is not needed anymore
parent
1d19b15c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
123 deletions
+14
-123
app/models/project.rb
app/models/project.rb
+2
-6
app/services/service_desk_settings/update_service.rb
app/services/service_desk_settings/update_service.rb
+0
-4
app/views/projects/_service_desk_settings.html.haml
app/views/projects/_service_desk_settings.html.haml
+1
-1
config/feature_flags/development/service_desk_custom_address.yml
...feature_flags/development/service_desk_custom_address.yml
+0
-8
doc/user/project/service_desk.md
doc/user/project/service_desk.md
+6
-26
lib/gitlab/email/handler/service_desk_handler.rb
lib/gitlab/email/handler/service_desk_handler.rb
+1
-1
spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
+0
-10
spec/models/project_spec.rb
spec/models/project_spec.rb
+4
-54
spec/services/service_desk_settings/update_service_spec.rb
spec/services/service_desk_settings/update_service_spec.rb
+0
-13
No files found.
app/models/project.rb
View file @
511f9415
...
...
@@ -2486,16 +2486,12 @@ class Project < ApplicationRecord
end
def
service_desk_custom_address
return
unless
service_desk_custom_address_
enabled?
return
unless
Gitlab
::
ServiceDeskEmail
.
enabled?
key
=
service_desk_setting
&
.
project_key
return
unless
key
.
present?
::
Gitlab
::
ServiceDeskEmail
.
address_for_key
(
"
#{
full_path_slug
}
-
#{
key
}
"
)
end
def
service_desk_custom_address_enabled?
::
Gitlab
::
ServiceDeskEmail
.
enabled?
&&
::
Feature
.
enabled?
(
:service_desk_custom_address
,
self
,
default_enabled:
true
)
Gitlab
::
ServiceDeskEmail
.
address_for_key
(
"
#{
full_path_slug
}
-
#{
key
}
"
)
end
def
root_namespace
...
...
app/services/service_desk_settings/update_service.rb
View file @
511f9415
...
...
@@ -5,10 +5,6 @@ module ServiceDeskSettings
def
execute
settings
=
ServiceDeskSetting
.
safe_find_or_create_by!
(
project_id:
project
.
id
)
unless
::
Feature
.
enabled?
(
:service_desk_custom_address
,
project
,
default_enabled:
true
)
params
.
delete
(
:project_key
)
end
params
[
:project_key
]
=
nil
if
params
[
:project_key
].
blank?
if
settings
.
update
(
params
)
...
...
app/views/projects/_service_desk_settings.html.haml
View file @
511f9415
...
...
@@ -12,7 +12,7 @@
enabled:
"#{@project.service_desk_enabled}"
,
incoming_email:
(
@project
.
service_desk_incoming_address
if
@project
.
service_desk_enabled
),
custom_email:
(
@project
.
service_desk_custom_address
if
@project
.
service_desk_enabled
),
custom_email_enabled:
"#{
@project.service_desk_custom_address_
enabled?}"
,
custom_email_enabled:
"#{
Gitlab::ServiceDeskEmail.
enabled?}"
,
selected_template:
"#{@project.service_desk_setting&.issue_template_key}"
,
outgoing_name:
"#{@project.service_desk_setting&.outgoing_name}"
,
project_key:
"#{@project.service_desk_setting&.project_key}"
,
...
...
config/feature_flags/development/service_desk_custom_address.yml
deleted
100644 → 0
View file @
1d19b15c
---
name
:
service_desk_custom_address
introduced_by_url
:
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/284656
milestone
:
type
:
development
group
:
group::certify
default_enabled
:
true
doc/user/project/service_desk.md
View file @
511f9415
...
...
@@ -140,15 +140,12 @@ To edit the custom email display name:
### Using custom email address
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/2201) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.0.
> - It was [deployed behind a feature flag](../feature_flags.md), disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/284656) on GitLab 13.7.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#disable-custom-email-address). **(CORE ONLY)**
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/284656) in GitLab 13.8.
If the
`service_desk_email`
feature flag is enabled, then you can
create Service Desk issues by sending emails to the Service Desk email address.
The default address has the following format:
`project_contact+%{key}@example.com`
.
If the
`service_desk_email`
is configured, then you can create Service Desk
issues by sending emails to the Service Desk email address. The default
address has the following format:
`project_contact+%{key}@example.com`
.
The
`%{key}`
part is used to find the project where the issue should be created. The
`%{key}`
part combines the path to the project and configurable project name suffix:
...
...
@@ -163,7 +160,7 @@ always use separate mailboxes. This is important, because emails picked from
`service_desk_email`
mailbox are processed by a different worker and it would
not recognize
`incoming_email`
emails.
You can add the following snippets to your configuration
:
To configure a custom email address for Service Desk, add the following snippets to your configuration file
:
-
Example for installations from source:
...
...
@@ -216,23 +213,6 @@ As a result, a new Service Desk issue is created from this email in the `mygroup
The configuration options are the same as for configuring
[
incoming email
](
../../administration/incoming_email.md#set-it-up
)
.
#### Disable custom email address **(CORE ONLY)**
Service Desk custom email is under development but ready for production use.
It is deployed behind a feature flag that is
**enabled by default**
.
To disable it:
```
ruby
Feature
.
disable
(
:service_desk_custom_address
)
```
To enable it:
```
ruby
Feature
.
enable
(
:service_desk_custom_address
)
```
## Using Service Desk
There are a few ways Service Desk can be used.
...
...
lib/gitlab/email/handler/service_desk_handler.rb
View file @
511f9415
...
...
@@ -68,7 +68,7 @@ module Gitlab
end
def
valid_project_key?
(
project
,
slug
)
project
.
present?
&&
slug
==
project
.
full_path_slug
&&
Feature
.
enabled?
(
:service_desk_custom_address
,
project
,
default_enabled:
true
)
project
.
present?
&&
slug
==
project
.
full_path_slug
end
def
create_issue!
...
...
spec/lib/gitlab/email/handler/service_desk_handler_spec.rb
View file @
511f9415
...
...
@@ -191,16 +191,6 @@ RSpec.describe Gitlab::Email::Handler::ServiceDeskHandler do
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
ProjectNotFound
)
end
end
context
'when service_desk_custom_address feature is disabled'
do
before
do
stub_feature_flags
(
service_desk_custom_address:
false
)
end
it
'bounces the email'
do
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
ProjectNotFound
)
end
end
end
end
...
...
spec/models/project_spec.rb
View file @
511f9415
...
...
@@ -1499,63 +1499,13 @@ RSpec.describe Project, factory_default: :keep do
allow
(
::
Gitlab
::
ServiceDeskEmail
).
to
receive
(
:config
).
and_return
(
config
)
end
context
'when service_desk_custom_address flag is enabled'
do
before
do
stub_feature_flags
(
service_desk_custom_address:
true
)
end
it
'returns custom address when project_key is set'
do
create
(
:service_desk_setting
,
project:
project
,
project_key:
'key1'
)
expect
(
subject
).
to
eq
(
"foo+
#{
project
.
full_path_slug
}
-key1@bar.com"
)
end
it_behaves_like
'with incoming email address'
end
context
'when service_desk_custom_address flag is disabled'
do
before
do
stub_feature_flags
(
service_desk_custom_address:
false
)
end
it_behaves_like
'with incoming email address'
end
end
end
describe
'.service_desk_custom_address_enabled?'
do
let_it_be
(
:project
)
{
create
(
:project
,
service_desk_enabled:
true
)
}
subject
(
:address_enabled
)
{
project
.
service_desk_custom_address_enabled?
}
context
'when service_desk_email is enabled'
do
before
do
allow
(
::
Gitlab
::
ServiceDeskEmail
).
to
receive
(
:enabled?
).
and_return
(
true
)
end
it
'returns true'
do
expect
(
address_enabled
).
to
be_truthy
end
context
'when service_desk_custom_address flag is disabled'
do
before
do
stub_feature_flags
(
service_desk_custom_address:
false
)
end
it
'returns false'
do
expect
(
address_enabled
).
to
be_falsey
end
end
end
it
'returns custom address when project_key is set'
do
create
(
:service_desk_setting
,
project:
project
,
project_key:
'key1'
)
context
'when service_desk_email is disabled'
do
before
do
allow
(
::
Gitlab
::
ServiceDeskEmail
).
to
receive
(
:enabled?
).
and_return
(
false
)
expect
(
subject
).
to
eq
(
"foo+
#{
project
.
full_path_slug
}
-key1@bar.com"
)
end
it
'returns false when service_desk_email is disabled'
do
expect
(
address_enabled
).
to
be_falsey
end
it_behaves_like
'with incoming email address'
end
end
...
...
spec/services/service_desk_settings/update_service_spec.rb
View file @
511f9415
...
...
@@ -16,19 +16,6 @@ RSpec.describe ServiceDeskSettings::UpdateService do
expect
(
settings
.
reload
.
outgoing_name
).
to
eq
'some name'
expect
(
settings
.
reload
.
project_key
).
to
eq
'foo'
end
context
'when service_desk_custom_address is disabled'
do
before
do
stub_feature_flags
(
service_desk_custom_address:
false
)
end
it
'ignores project_key parameter'
do
result
=
described_class
.
new
(
settings
.
project
,
user
,
params
).
execute
expect
(
result
[
:status
]).
to
eq
:success
expect
(
settings
.
reload
.
project_key
).
to
be_nil
end
end
end
context
'when project_key is an empty string'
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