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

rewrite chef checks to use Ridley instead of deprecated chef rest api. #26

Merged
merged 7 commits into from
May 9, 2017

Conversation

annshah
Copy link
Contributor

@annshah annshah commented May 8, 2017

Pull Request Checklist

Is this in reference to an existing issue?
rewrite plugin checks to use ridley issue #25

General

  • Update Changelog following the conventions laid out on Keep A Changelog

  • Update README with any necessary configuration snippets

  • Binstubs are created if needed

  • RuboCop passes

  • Existing tests pass

Purpose

Known Compatablity Issues

@@ -65,12 +70,16 @@ def run
critical "Node #{config[:node_name]} not found - #{e.message}"
end

private
private
Copy link
Member

Choose a reason for hiding this comment

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

was there a reason for this whitespace?

@majormoses
Copy link
Member

@annshah thanks for the contribution overall this looks good, if you can kill that extra whitespace and fix the gem dependency issues after some quick verification tests I would love to get this merged.

@@ -50,13 +50,18 @@ class ChefNodeChecker < Sensu::Plugin::Check::CLI
short: '-K CLIENT-KEY',
long: '--keys CLIENT-KEY'

option :ignore_ssl_warnings,
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be more appropriately named ignore_ssl_verification

@@ -68,19 +68,24 @@ class ChefNodesStatusChecker < Sensu::Plugin::Check::CLI
long: '--exclude-nodes EXCLUDE-NODES',
default: '^$'

option :ignore_ssl_warnings,
Copy link
Member

Choose a reason for hiding this comment

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

I think this would be more appropriately named ignore_ssl_verification

@majormoses majormoses changed the title Ridley rewrite check checks to use Ridley instead of deprecated chef server api. May 8, 2017
@majormoses majormoses changed the title rewrite check checks to use Ridley instead of deprecated chef server api. rewrite chef checks to use Ridley instead of deprecated chef server api. May 8, 2017
@majormoses majormoses changed the title rewrite chef checks to use Ridley instead of deprecated chef server api. rewrite chef checks to use Ridley instead of deprecated chef rest api. May 8, 2017
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'rack', '~> 1.6.5'
end

s.add_runtime_dependency 'ridley', '4.1.2'
s.add_runtime_dependency 'ridley', '5.1.0'
s.add_runtime_dependency 'sensu-plugin', '~> 1.2'
s.add_runtime_dependency 'varia_model', '0.4.1'
Copy link
Member

Choose a reason for hiding this comment

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

looks like this needs to be bumped per travis: https://travis-ci.org/sensu-plugins/sensu-plugins-chef/jobs/230068843

@majormoses
Copy link
Member

I see the issue, basically ridley 5.x requires buff-extension 2.x which requires >= ruby 2.2.

@eheydrick did sensu ever ship with ruby 2.1? In this case I think we should consider dropping support and do a major bump as this solves issues for lots of users of this gem and with a rewrite I would hate to force using an old version of ridley that we are gonna have to update agains shortly anyways. Thoughts?

@annshah
Copy link
Contributor Author

annshah commented May 8, 2017

I was facing compatibility issues with earlier versions of ridley. So I believe using latest version might be a necessity.

@majormoses
Copy link
Member

Ya I looked at it and im favor of this breaking change but would like to hear from another maintainer before merging and releasing this one.

@majormoses
Copy link
Member

@cwjohnston thoughts?

@cwjohnston
Copy link
Contributor

@majormoses per sensu-build commit history I don't think we've shipped a Sensu release with Ruby 2.1.

I find these changes agreeable for the most part. I also like the idea of implementing a module library like you mentioned in #25 (comment). Would that be reasonable here to dry things up and make it easier to move to https://github.com/sethvargo/chef-api when that becomes a stable option?

@majormoses
Copy link
Member

@cwjohnston awesome thats what I was looking for! While I would like to force the connection information out right now to me the priority is to get this fixed and nice cleanup later. We should keep the original issue open to track that but I really want this merged asap.

@cwjohnston
Copy link
Contributor

cwjohnston commented May 9, 2017

@majormoses @annshah let's remove ruby 2.1 and add ruby 2.4 to the travis matrix, if those tests pass we can shipit :shipit:

edit: with a major version bump 👍

@majormoses
Copy link
Member

majormoses commented May 9, 2017

@annshah I see you did not give maintainers access to your fork can you please add this:

$ git diff origin/master 
diff --git a/.travis.yml b/.travis.yml
index cf6c5ac..fa96a2a 100644
--- a/.travis.yml
+++ b/.travis.yml

@@ -5,7 +5,6 @@ install:
 - gem install bundler -v 1.12
 - bundle install
 rvm:
-- 2.1
 - 2.2
 - 2.3.0
 notifications:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d6a3a86..39b5372 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
 
 ## [Unreleased]
+### Breaking Change
+- re-wrote all checks to use latest ridley. As ridley 5.x requires buff-extension 2.x which requires >= ruby 2.2 and sensu has never shipped with ruby 2.1 the decision was made to drop this support. If you are not using an embedded ruby and are using 2.1 this will break for you. To avoid this you can either switch to embedded ruby or upgrade your ruby to at least 2.2
 
 ## [2.0.1] - 2017-04-28
 ### Fixed

Also add 2.4 as requested by @cwjohnston

majormoses and others added 4 commits May 9, 2017 09:14
@annshah
Copy link
Contributor Author

annshah commented May 9, 2017

@majormoses : I have added all maintainers and Ruby 2.4.1.

@majormoses
Copy link
Member

@annshah thanks I will squash and merge this

@majormoses majormoses merged commit 846cc66 into sensu-plugins:master May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants