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

Create a class to handle the plugins.json file #3575

Merged
merged 9 commits into from Nov 16, 2018

Conversation

Projects
None yet
3 participants
@clintoncwolfe
Contributor

clintoncwolfe commented Nov 3, 2018

Fixes #3350

This is an internal refactor for the plugins system. As tech debt, we had implemented the reading, validation, and writing of the plugin state file, ~/.inspec/plugins.json scattered accross several files, with no one class having responsibility. Testing was minimal.

This PR creates a class to handle the statefile and gate modifications to it with validation. Unit tests are included.

The Loader and Installer classes are modified to use the ConfigFile class, and their tests are updated.

clintoncwolfe added some commits Nov 2, 2018

unit tests for plugin conf file class, all skip
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
File path stuff works
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Validation works
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Add works
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Added remove_entry
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Save works - ready to refactor others
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Rework Loader to use ConfigFile
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Modify loader and installer to use the config file class
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
@jquick

jquick approved these changes Nov 8, 2018

Code and tests look good to me! Thanks @clintoncwolfe

@miah

miah approved these changes Nov 16, 2018

Looks great, excellent test coverage and error handling. A++ Would review again =)

@jquick jquick merged commit 3c8697e into master Nov 16, 2018

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

@jquick jquick deleted the cw/plugins-statefile-class branch Nov 16, 2018

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