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
cec750cb
Commit
cec750cb
authored
Jul 14, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename PagerDuty webhook URL
Rename PagerDuty webhook URL to /incindents/pagerduty
parent
3e841cdd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
app/controllers/projects/settings/operations_controller.rb
app/controllers/projects/settings/operations_controller.rb
+3
-3
app/helpers/operations_helper.rb
app/helpers/operations_helper.rb
+1
-1
config/routes/project.rb
config/routes/project.rb
+1
-1
spec/controllers/projects/settings/operations_controller_spec.rb
...ntrollers/projects/settings/operations_controller_spec.rb
+2
-2
spec/helpers/operations_helper_spec.rb
spec/helpers/operations_helper_spec.rb
+1
-1
No files found.
app/controllers/projects/settings/operations_controller.rb
View file @
cec750cb
...
...
@@ -47,10 +47,10 @@ module Projects
.
new
(
project
,
current_user
,
pagerduty_token_params
)
.
execute
pagerduty_token
=
project
.
incident_management_setting
&
.
pagerduty_token
webhook_url
=
project_incidents_pager_duty_url
(
project
,
token:
pagerduty_token
)
if
result
[
:status
]
==
:success
pagerduty_token
=
project
.
incident_management_setting
&
.
pagerduty_token
webhook_url
=
project_incidents_pagerduty_url
(
project
,
token:
pagerduty_token
)
render
json:
{
pagerduty_webhook_url:
webhook_url
,
pagerduty_token:
pagerduty_token
}
else
render
json:
{},
status: :unprocessable_entity
...
...
app/helpers/operations_helper.rb
View file @
cec750cb
...
...
@@ -45,7 +45,7 @@ module OperationsHelper
send_email:
setting
.
send_email
.
to_s
,
pagerduty_active:
setting
.
pagerduty_active
.
to_s
,
pagerduty_token:
setting
.
pagerduty_token
.
to_s
,
pagerduty_webhook_url:
project_incidents_pager
_
duty_url
(
@project
,
token:
setting
.
pagerduty_token
),
pagerduty_webhook_url:
project_incidents_pagerduty_url
(
@project
,
token:
setting
.
pagerduty_token
),
pagerduty_reset_key_path:
reset_pagerduty_token_project_settings_operations_path
(
@project
)
}
end
...
...
config/routes/project.rb
View file @
cec750cb
...
...
@@ -407,7 +407,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
post
'alerts/notify'
,
to:
'alerting/notifications#create'
post
'incidents/pager
_
duty'
,
to:
'incident_management/pager_duty_incidents#create'
post
'incidents/pagerduty'
,
to:
'incident_management/pager_duty_incidents#create'
draw
:legacy_builds
...
...
spec/controllers/projects/settings/operations_controller_spec.rb
View file @
cec750cb
...
...
@@ -203,7 +203,7 @@ RSpec.describe Projects::Settings::OperationsController do
reset_pagerduty_token
new_token
=
incident_management_setting
.
reload
.
pagerduty_token
new_webhook_url
=
project_incidents_pager
_
duty_url
(
project
,
token:
new_token
)
new_webhook_url
=
project_incidents_pagerduty_url
(
project
,
token:
new_token
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'pagerduty_webhook_url'
]).
to
eq
(
new_webhook_url
)
...
...
@@ -216,7 +216,7 @@ RSpec.describe Projects::Settings::OperationsController do
it
'does not reset a token'
do
reset_pagerduty_token
new_webhook_url
=
project_incidents_pager
_
duty_url
(
project
,
token:
nil
)
new_webhook_url
=
project_incidents_pagerduty_url
(
project
,
token:
nil
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'pagerduty_webhook_url'
]).
to
eq
(
new_webhook_url
)
...
...
spec/helpers/operations_helper_spec.rb
View file @
cec750cb
...
...
@@ -152,7 +152,7 @@ RSpec.describe OperationsHelper do
send_email:
'false'
,
pagerduty_active:
'true'
,
pagerduty_token:
operations_settings
.
pagerduty_token
,
pagerduty_webhook_url:
project_incidents_pager
_
duty_url
(
project
,
token:
operations_settings
.
pagerduty_token
),
pagerduty_webhook_url:
project_incidents_pagerduty_url
(
project
,
token:
operations_settings
.
pagerduty_token
),
pagerduty_reset_key_path:
reset_pagerduty_token_project_settings_operations_path
(
project
)
)
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