Skip to content

Refactor provisioners for better modularity#9

Merged
lnussbaum merged 4 commits intolnussbaum:masterfrom
Dunedan:refactor-provisioners
Jan 19, 2026
Merged

Refactor provisioners for better modularity#9
lnussbaum merged 4 commits intolnussbaum:masterfrom
Dunedan:refactor-provisioners

Conversation

@Dunedan
Copy link
Copy Markdown
Contributor

@Dunedan Dunedan commented Jan 18, 2026

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.

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.
@Dunedan
Copy link
Copy Markdown
Contributor Author

Dunedan commented Jan 18, 2026

I'm not sure what'd be the best way to make mypy happy here.

@lnussbaum
Copy link
Copy Markdown
Owner

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.

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.
@lnussbaum lnussbaum force-pushed the refactor-provisioners branch from b58a914 to 3eb1176 Compare January 19, 2026 21:00
@lnussbaum
Copy link
Copy Markdown
Owner

I'm not sure what'd be the best way to make mypy happy here.

I must admit I went ahead with Gemini's suggestion to inherit the base class' signature and add runtime checks

@lnussbaum lnussbaum force-pushed the refactor-provisioners branch from 3eb1176 to 9baf557 Compare January 19, 2026 21:02
@lnussbaum lnussbaum merged commit 4d477a7 into lnussbaum:master Jan 19, 2026
9 checks passed
@Dunedan Dunedan deleted the refactor-provisioners branch January 24, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants