-
Notifications
You must be signed in to change notification settings - Fork 665
Add --all flag support to molecule reset command #4503
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add all_scenarios_reset option to click_cfg.py with custom help text - Implement --all flag support in reset.py with shared directory cleanup - Fix multi-scenario processing bug in base.py (return -> continue) - Add comprehensive test suite for reset command with 9 test cases - Tests cover basic scenarios, --all flag, excludes, and shared cleanup - Resolves missing --all flag support in reset command - Extends shared-state/shared-inventory functionality to reset operations
Qalthos
reviewed
Aug 8, 2025
Qalthos
approved these changes
Aug 11, 2025
Collaborator
Qalthos
left a comment
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 meant in the help text for reset itself, but this works too
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the missing
--allflag support to themolecule resetcommand, bringing it in line with other molecule commands and extending the shared directory functionality previously introduced for shared-state and shared-inventory.Problem Statement
The
molecule resetcommand was the only core command lacking--allflag support, creating inconsistency in the CLI interface. Additionally, the command did not clean up shared ephemeral directories (introduced for shared-state and shared-inventory), leaving artifacts behind during full resets.Changes Made
Per-file Changes:
src/molecule/command/reset.py (+37 lines, -5 lines)
--allflag handling with shared directory cleanup logic--allis usedexecute_cmdline_scenariosworkflowsrc/molecule/command/base.py (+1 line, -1 line)
returntocontinuein_run_scenarios)--allflagtests/unit/command/test_reset.py (+513 lines, new file)
--allflagRelation to Shared-State/Shared-Inventory
This change complements the shared-state and shared-inventory features introduced months ago by ensuring the
resetcommand properly cleans up shared ephemeral directories. When--allis specified, the command now performs a "nuclear" cleanup, removing both per-scenario artifacts and shared directories, providing a complete reset functionality.Testing
All existing tests pass, and the new test suite provides comprehensive coverage of the reset command functionality including edge cases and integration with the shared directory system.
Backward Compatibility
This change is fully backward compatible. Existing
molecule reset [scenario]usage remains unchanged, with the--allflag being purely additive functionality.