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

Add CLI options to disable loading plugins #3751

Merged
merged 3 commits into from Feb 1, 2019

Conversation

Projects
None yet
3 participants
@clintoncwolfe
Copy link
Contributor

clintoncwolfe commented Jan 25, 2019

From time to time, it is useful to disable loading user or core plugins, especially during testing. This PR does that by adding two new options, --disable-user-plugins and --disable-core-plugins.

Disabling user plugins is useful when your plugin setup is corrupted. This would allow (for example) inspec plugin uninstall inspec-bad-plugin --disable-user-plugins, without resorting to locating and removing the user plugin directory.

Disabling core plugins is needed when testing plugins that may talk to each other - in this case, to isolate user attribute provider plugins during testing.

Simple tests are provided to ensure the two options work, and that they are included in usage help.

@jerryaldrichiii
Copy link
Contributor

jerryaldrichiii left a comment

Looks good to me. Usually I'm against more CLI arguments, but I see these being useful.

@@ -1,5 +1,13 @@
require 'inspec/base_cli'

# Under some conditions (unit testing in particular) we may end

This comment has been minimized.

@jerryaldrichiii

jerryaldrichiii Jan 30, 2019

Contributor

I think we may have a merge conflict with: https://github.com/inspec/inspec/pull/3758/files#diff-0fdac3e925822c85c27f47879d14c973R3

I'm fine with either message but I prefer the one line approach over there. Up to you though. I have no strong opinion.

This comment has been minimized.

@clintoncwolfe

clintoncwolfe Jan 30, 2019

Author Contributor

AHA! Well, we found the PR in which I hit that issue, at least. We'll work out any conflict.

@miah

miah approved these changes Jan 31, 2019

@clintoncwolfe clintoncwolfe force-pushed the cw/plugins-add-no-user-plugins-option branch from 6be9397 to 26aa2b0 Jan 31, 2019

clintoncwolfe added some commits Jan 25, 2019

Crude implementation to watch for plugin disable options
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Passing functional tests for using plugin disable options
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Passing help message functional tests for disabling plugins
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

@clintoncwolfe clintoncwolfe force-pushed the cw/plugins-add-no-user-plugins-option branch from 26aa2b0 to 5d2934c Feb 1, 2019

@clintoncwolfe

This comment has been minimized.

Copy link
Contributor Author

clintoncwolfe commented Feb 1, 2019

Bumping minor for new CLI features

@clintoncwolfe clintoncwolfe merged commit 3612a21 into master Feb 1, 2019

4 checks passed

DCO This commit has a DCO Signed-off-by
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
expeditor/config-validation Validated your Expeditor config file
Details

@clintoncwolfe clintoncwolfe deleted the cw/plugins-add-no-user-plugins-option branch Feb 1, 2019

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