Skip to content
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

Support setting the OpsGenie alert priority on a per-check basis. #27

Merged
merged 6 commits into from Mar 22, 2018

Conversation

Castaglia
Copy link
Contributor

@Castaglia Castaglia commented Jan 21, 2018

Pull Request Checklist

Is this in reference to an existing issue?

General

  • Update Changelog following the conventions laid out here

  • Update README with any necessary configuration snippets

  • Binstubs are created if needed

  • RuboCop passes

  • Existing tests pass

New Plugins

  • Tests

  • Add the plugin to the README

  • Does it have a complete header as outlined here

Purpose

Known Compatibility Issues

@majormoses
Copy link
Member

@Castaglia that seems like a good idea to me, it does raise some questions that I think we should discuss in #28 prior to code review. I look forward to hearing your thoughts especially as a user of opsgenie.

@Castaglia
Copy link
Contributor Author

Any additional work/thoughts on this PR?

@majormoses
Copy link
Member

Sorry will review, easy to lose track of all of these and never enough time.

@@ -118,6 +120,19 @@ def create_alert
teams: json_config['teams'])
end

def event_priority
return nil unless json_config['priority']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest returning false or DEFAULT_PRIORITY rather than returning nil is often harder to trace if it is a bug or intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent point. PR updated.

@majormoses
Copy link
Member

@Castaglia checking if you have time to circle back. I see that you will need to rebase to fix conflicts, let me know if you need help with that.

@majormoses
Copy link
Member

IMHO, Rubocop's defaults a little too strict.

Can't argue with you there, thats why they expose config and allow inline disables. That being said rubocop has made me a much better developer both in the sense of learning to follow commonly accepted convention and more importantly learn why the rules exist and know when to disagree from an informed stance. If you are talking about long running applications ya a long block is probably a bad idea but in a short lived monitoring script there is less need to worry about such things.

Copy link
Member

@majormoses majormoses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@majormoses majormoses merged commit 27e12f5 into sensu-plugins:master Mar 22, 2018
@majormoses
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants