-
Notifications
You must be signed in to change notification settings - Fork 682
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 profile versions for automate profiles storage #2128
Conversation
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.
Change looks fine overall. Can we please add some unit tests for .target_url
and .profile_split
? I'd like to see both tests for profile names that include and don't include a version string to prevent future regressions.
lib/bundles/inspec-compliance/api.rb
Outdated
if !profiles.empty? | ||
index = profiles.index { |p| "#{p['owner_id']}/#{p['name']}" == profile } | ||
index = profiles.index { |p| |
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.
Multiline blocks should use do..end
please :)
lib/bundles/inspec-compliance/api.rb
Outdated
if !profiles.empty? | ||
index = profiles.index { |p| "#{p['owner_id']}/#{p['name']}" == profile } | ||
index = profiles.index { |p| |
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.
We never really use the index except for checking to see if we have a match. Could we refactor this to use #any?
instead while we're in here?
profiles.any? do |p|
# criteria
end
... that should return true if there was a match, false if not.
We also need to update the inspec-compliance README since this is a new enhancement. |
Makes sense Adam, appreciate the review. Will return next week and finish this up. |
Signed-off-by: Alex Pop <[email protected]>
2c38fcc
to
ed3cc01
Compare
Adam, I added a second commit to the PR that:
Cheers! |
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 with my clean-up commit. @alexpop please confirm!
Signed-off-by: Alex Pop <[email protected]>
Signed-off-by: Adam Leff <[email protected]>
33f57aa
to
f766d9c
Compare
Looks very good Adam, happy to merge! |
After
inspec compliance login_automate ...