-
Notifications
You must be signed in to change notification settings - Fork 681
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
load local dependencies in inspec shell #2438
Conversation
for loading dependencies from local folders. mainly used for development. Signed-off-by: Dominik Richter <[email protected]>
Signed-off-by: Dominik Richter <[email protected]>
88b24f1
to
ed16a92
Compare
Signed-off-by: Dominik Richter <[email protected]>
ed16a92
to
9f14af3
Compare
That's really cool. Now the follow-up to this would be to add train support for AWS. |
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.
Super great change, @arlimus, and closes a long-standing feature request too!
Two suggestions, neither of which are blocking.
lib/inspec/cli.rb
Outdated
@@ -194,6 +194,8 @@ def detect | |||
desc: 'A single command string to run instead of launching the shell' | |||
option :format, type: :string, default: nil, hide: true, | |||
desc: 'Which formatter to use: cli, documentation, html, json, json-min, junit, progress' | |||
option :depends, type: :array, default: [], | |||
desc: 'A list of local folders that are loaded as dependencies (e.g. for resources)' |
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.
Proposed alteration to make it clear what type of folder we're expecting:
'A space-delimited list of local folders containing profiles whose libraries and resources will be loaded into the new shell'
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.
Much nicer words, thank you, i'll add it!
@@ -194,6 +194,8 @@ def detect | |||
desc: 'A single command string to run instead of launching the shell' | |||
option :format, type: :string, default: nil, hide: true, | |||
desc: 'Which formatter to use: cli, documentation, html, json, json-min, junit, progress' | |||
option :depends, type: :array, default: [], |
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.
What do you think about calling the option --load-profiles
instead of --depends
? I know --depends
is technically correct re: implementation and consistent with the inspec.yml, but I wonder if --load-profiles
is a clearer option as to what it feels like to the user. Don't feel obligated to take this suggestion, just wanted to toss it out there.
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.
Load-profiles is interesting too yeah 🤔
To add a small argument: "load profiles" would technically only load the libraries of the profile and not the controls, i.e. not the entire profile. I was pondering "load libraries" (but that may lead users to specify the libraries folder which we don't want either; traversing dependencies for all resources is beautiful right now)
There may be a better term...
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.
--load-profile-libs
?
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.
I can't think of anything terribly better. If --load-profile-libs
doesn't feel right, and you think --depends
is clear enough, please merge when ready. :) We can always add an alias if someone comes up with something better.
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.
Good idea, i'll make sure to add the docs you suggested below. Otherwise we can deprecate and find something else. Naming is hard...
Could we add a quick section to https://www.inspec.io/docs/reference/shell/ also? |
The change is shell-specific. It has nothing to do with Test Kitchen or otherwise. |
Ok. Just double checking. Thanks. |
kudos @adamleff Signed-off-by: Dominik Richter <[email protected]>
fe6e981
to
02b498f
Compare
Signed-off-by: Dominik Richter <[email protected]>
8ed49fe
to
4fe6e66
Compare
for loading dependencies from local folders. mainly used for development.
Fixes #1486