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.
Description
Do not manipulate the context directly; instead, pass parameters to
execute_action, which modifies the context after validating the parameters.This has two benefits:
Credits of the design: @oliwel
For discussion
@jonasbn @oliwel
One problem of this PR is that the context is not fully moved to being a scratchpad; it's still a read-only API: Anything other than the "current state" and "currently available next actions" should still be read from the context.
Another problem that I see, is that the parameters aren't passed to the action's
executemethod, but copied into the context directly. If we want the context to be a scratchpad for the workflow, I'd make it the responsibility of actions to read/write the context: that way it's a fully private resource.Type of change
This change should not break existing behaviour.
Checklist:
You might think, that this is one crazy checklist, but it is just as much written for the maintainer of the involved software :-)