Refactor provisioners for better modularity#9
Merged
lnussbaum merged 4 commits intolnussbaum:masterfrom Jan 19, 2026
Merged
Conversation
This refactors the provisioning logic so that every provisioner is defined by its own class. This better encapsulates provisoner logic and makes adding new provisioners easier. While this is supposed to be a pure refactoring, it contains a small functional change, so that provisioning scripts can now not just be put as string only in the provisioner config, but following a "script" key as well, similar to all other provisioners.
Contributor
Author
|
I'm not sure what'd be the best way to make mypy happy here. |
Owner
Looks good (except for a typo about LLMNR/LLMR), thanks a lot! |
* Rename `incant/provisioners/llmr.py` to `llmnr.py` and correct class/key names. * Add `tests/test_provision_manager.py` to verify LLMNR execution. * Add validation tests for known/unknown provisioners in `tests/test_config_manager.py`
* Update provisioner subclass signatures for LSP compliance and add runtime type checks. * Replace `.get()` calls on `REGISTERED_PROVISIONERS` with direct indexing to ensure non-None callables. * Initialize `Provisioner.config_key` in the base class to satisfy type assignment rules.
b58a914 to
3eb1176
Compare
Owner
I must admit I went ahead with Gemini's suggestion to inherit the base class' signature and add runtime checks |
3eb1176 to
9baf557
Compare
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
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.
This refactors the provisioning logic so that every provisioner is defined by its own class. This better encapsulates provisoner logic and makes adding new provisioners easier.
While this is supposed to be a pure refactoring, it contains a small functional change, so that provisioning scripts can now not just be put as string only in the provisioner config, but following a "script" key as well, similar to all other provisioners.