-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add options for force delete monitors #213
Conversation
# Cop supports --auto-correct. | ||
Layout/EmptyLineAfterMagicComment: | ||
Exclude: | ||
- 'dogapi.gemspec' | ||
- 'spec/integration/comment_spec.rb' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these no longer needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ran the rubocop autogenerate command rubocop --auto-gen-config
with the ruby version that's used for linting so I think this should be good
@@ -549,8 +549,8 @@ def can_delete_monitors(monitor_ids) | |||
@monitor_svc.can_delete_monitors(monitor_ids) | |||
end | |||
|
|||
def delete_monitor(monitor_id) | |||
@monitor_svc.delete_monitor(monitor_id) | |||
def delete_monitor(monitor_id, options = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means existing users that aren't passing in options
will still be able to omit it, right? I.e. we're backwards compatible here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there's a default argument so it's backwards compatible!
@@ -51,6 +51,17 @@ | |||
:delete, "/monitor/#{MONITOR_ID}" | |||
end | |||
|
|||
describe '#delete_monitor with options' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💜 Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks!
https://datadoghq.atlassian.net/browse/MA-791
What does this PR do?
Allow monitors to be force deleted even if part of composite or SLO via options
Description of the Change
Enabled options to be passed in the
monitor_delete
function in the client, to allow for force deletion.Review checklist (to be filled by reviewers)
changelog/
label attached. If applicable it should have thebackward-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.