Add generic conditional container plugin.#326
Conversation
| return True | ||
|
|
||
| def _execute_tasks(self, data): | ||
| # TODO improve handling of defaults either by reusing context/dispatcher -OR- prepend defaults & extract at end |
There was a problem hiding this comment.
Note this currently has the same issue as the similar third-party plugins (scoping defaults to the child tasks). I think the best approach would be to update dispatcher constructor to allow passing in (and therefore reusing) a context.
Other options considered:
- Reusing the parent dispatcher by exposing it through context
- Modify the task list by prepending a default directive. After completion, get the child context defaults and call set_defaults on parent context.
In either case, I also think it's worth adding a configuration option to this plugin to control whether defaults are scoped to the child tasks or not.
|
This is a great start, @gnfzdz! I'd like to assist on implementing a number of initial condition providers, writing up documentation, and adding unit tests. I can pick this up after #313 is reviewed and merged, as it will dramatically affect how the unit tests are implemented (and will make it possible to test the condition providers across all supported operating systems). |
|
@kurtmckee Thanks for the positive feedback. I can definitely see how this would work better with cross platform support. Thanks for the offer to help? @anishathalye Have you had a chance to review the proposal? I did release this as a separate plugin, but it would feel a lot cleaner if at least the abstract base Condition was available in the core Dotbot project. |
See #325 for explanation
Not intended as merge worthy, but just something to help visualize the idea. Let me know if it's worth refining.