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

implement chef-server fetcher and reporter #135

Merged
merged 1 commit into from Nov 1, 2016

Conversation

Projects
None yet
4 participants
@chris-rock
Collaborator

chris-rock commented Nov 1, 2016

This PR implements #129

@binamov binamov added the in progress label Nov 1, 2016

files/default/audit_report.rb Outdated
# TODO: should be available in inspec `json-min` reports out-of-the-box
# TODO: raise warning when not a compliance-known profile
def cc_profile_index(profiles)
cc_profiles = tests_for_runner(profiles).map { |profile| profile[:compliance] if profile[:compliance] }.uniq.compact

This comment has been minimized.

@srenatus

srenatus Nov 1, 2016

Collaborator

I think this could be tests_for_runner(profiles).select { |profile| profile[:compliance] }.uniq.compact:

irb(main):001:0> ls = [ { foo: nil }, { bar: 3 }, { foo: 4 }]
=> [{:foo=>nil}, {:bar=>3}, {:foo=>4}]
irb(main):002:0> ls.select {|x| x[:foo] }
=> [{:foo=>4}]

This comment has been minimized.

@chris-rock

chris-rock Nov 1, 2016

Collaborator

In this case we would need:

tests_for_runner(profiles).select { |profile| profile[:compliance] }.map { |profile| profile[:compliance].uniq.compact

I think it reads better, although we loop more often. Thanks @srenatus

metadata.rb Outdated
@@ -5,7 +5,7 @@
license 'Apache 2.0'
description 'Allows for fetching and executing compliance profiles, and reporting its results'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.0.0'
version '2.0.2'

This comment has been minimized.

@chris-rock

chris-rock Nov 1, 2016

Collaborator

do not change the version in this PR

implement chef-server fetcher and reporter
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
@vjeffrey

This comment has been minimized.

Collaborator

vjeffrey commented Nov 1, 2016

👍 on the code, testing against viz -- have to reboot real quick cause everything is hanging

profile_id: profile_id,
}
}
end

This comment has been minimized.

@vjeffrey

vjeffrey Nov 1, 2016

Collaborator

would prob be cool to have a test on this method someday... :)

This comment has been minimized.

@vjeffrey

vjeffrey Nov 1, 2016

Collaborator

also, it could be moved to helper.rb

@vjeffrey

This comment has been minimized.

Collaborator

vjeffrey commented Nov 1, 2016

tested against viz -- all good 👍

@chris-rock chris-rock merged commit f5a8ca9 into master Nov 1, 2016

2 checks passed

DCO This commit has a DCO Signed-off-by
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@binamov binamov removed the in progress label Nov 1, 2016

@chris-rock chris-rock deleted the chris-rock/chef-server branch Nov 1, 2016

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