-
Notifications
You must be signed in to change notification settings - Fork 88
Open
Labels
Description
TODO implement this so that we can pass variables through without explicitly passing them from/to every workflow and action
AutoPR/autopr/models/config/elements.py
Lines 41 to 52 in 1d818f4
| # Context mixin for actions and other objects with scope (e.g. workflows) | |
| class ContextModel(StrictModel): | |
| #: Which context variables to global-style include in the scope. | |
| # TODO implement this so that we can pass variables through without explicitly | |
| # passing them from/to every workflow and action | |
| # global_context: dict[ContextVarName, ContextVarName] = Field(default_factory=dict) | |
| pass | |
| ### Context actions |
One approach to resolve this TODO is to use global variables or a shared context object to pass variables without explicitly passing them between workflows and actions. Another option is to refactor the code to use dependency injection, allowing the variables to be passed through constructor parameters or method arguments.