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
97470ae7
Commit
97470ae7
authored
Jul 17, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove pagerduty_webhook feature flag
Rolls out PagerDuty incident integration
parent
20c359d2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
142 deletions
+94
-142
app/controllers/projects/settings/operations_controller.rb
app/controllers/projects/settings/operations_controller.rb
+0
-4
app/services/incident_management/pager_duty/create_incident_issue_service.rb
...nt_management/pager_duty/create_incident_issue_service.rb
+1
-2
app/services/incident_management/pager_duty/process_webhook_service.rb
...incident_management/pager_duty/process_webhook_service.rb
+1
-2
spec/services/incident_management/pager_duty/create_incident_issue_service_spec.rb
...nagement/pager_duty/create_incident_issue_service_spec.rb
+39
-60
spec/services/incident_management/pager_duty/process_webhook_service_spec.rb
...ent_management/pager_duty/process_webhook_service_spec.rb
+53
-74
No files found.
app/controllers/projects/settings/operations_controller.rb
View file @
97470ae7
...
...
@@ -6,10 +6,6 @@ module Projects
before_action
:authorize_admin_operations!
before_action
:authorize_read_prometheus_alerts!
,
only:
[
:reset_alerting_token
]
before_action
do
push_frontend_feature_flag
(
:pagerduty_webhook
,
project
)
end
respond_to
:json
,
only:
[
:reset_alerting_token
,
:reset_pagerduty_token
]
helper_method
:error_tracking_setting
...
...
app/services/incident_management/pager_duty/create_incident_issue_service.rb
View file @
97470ae7
...
...
@@ -40,7 +40,6 @@ module IncidentManagement
end
def
webhook_available?
Feature
.
enabled?
(
:pagerduty_webhook
,
project
)
&&
incident_management_setting
.
pagerduty_active?
end
...
...
app/services/incident_management/pager_duty/process_webhook_service.rb
View file @
97470ae7
...
...
@@ -39,7 +39,6 @@ module IncidentManagement
end
def
webhook_setting_active?
Feature
.
enabled?
(
:pagerduty_webhook
,
project
)
&&
incident_management_setting
.
pagerduty_active?
end
...
...
spec/services/incident_management/pager_duty/create_incident_issue_service_spec.rb
View file @
97470ae7
...
...
@@ -12,11 +12,6 @@ RSpec.describe IncidentManagement::PagerDuty::CreateIncidentIssueService do
subject
(
:execute
)
{
described_class
.
new
(
project
,
incident_payload
).
execute
}
describe
'#execute'
do
context
'when pagerduty_webhook feature enabled'
do
before
do
stub_feature_flags
(
pagerduty_webhook:
project
)
end
context
'when PagerDuty webhook setting is active'
do
let_it_be
(
:incident_management_setting
)
{
create
(
:project_incident_management_setting
,
project:
project
,
pagerduty_active:
true
)
}
...
...
@@ -85,20 +80,4 @@ RSpec.describe IncidentManagement::PagerDuty::CreateIncidentIssueService do
end
end
end
context
'when pagerduty_webhook feature disabled'
do
before
do
stub_feature_flags
(
pagerduty_webhook:
false
)
end
it
'does not create a GitLab issue'
do
expect
{
execute
}.
not_to
change
(
Issue
,
:count
)
end
it
'responds with forbidden'
do
expect
(
execute
).
to
be_error
expect
(
execute
.
http_status
).
to
eq
(
:forbidden
)
end
end
end
end
spec/services/incident_management/pager_duty/process_webhook_service_spec.rb
View file @
97470ae7
...
...
@@ -19,11 +19,6 @@ RSpec.describe IncidentManagement::PagerDuty::ProcessWebhookService do
subject
(
:execute
)
{
described_class
.
new
(
project
,
nil
,
webhook_payload
).
execute
(
token
)
}
context
'when pagerduty_webhook feature is enabled'
do
before
do
stub_feature_flags
(
pagerduty_webhook:
project
)
end
context
'when PagerDuty webhook setting is active'
do
let_it_be
(
:incident_management_setting
)
{
create
(
:project_incident_management_setting
,
project:
project
,
pagerduty_active:
true
)
}
...
...
@@ -129,20 +124,4 @@ RSpec.describe IncidentManagement::PagerDuty::ProcessWebhookService do
it_behaves_like
'does not process incidents'
end
end
context
'when pagerduty_webhook feature is disabled'
do
before
do
stub_feature_flags
(
pagerduty_webhook:
false
)
end
it
'responds with Forbidden'
do
result
=
execute
expect
(
result
).
to
be_error
expect
(
result
.
http_status
).
to
eq
(
:forbidden
)
end
it_behaves_like
'does not process incidents'
end
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