Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "transitions" as the workflow handler #45

Merged
merged 8 commits into from
May 29, 2024
Merged

Conversation

NotTheEvilOne
Copy link
Contributor

@NotTheEvilOne NotTheEvilOne commented May 10, 2024

This PR replaces the home-grown workflow handler with "transitions" [1] to sort and execute modules in a specifc order.

Closes #3

[1] https://github.com/pytransitions/transitions

This adapts the logic how modules are loaded and sorted for execution.

Signed-off-by: Tobias Wolf <[email protected]>
@NotTheEvilOne NotTheEvilOne requested a review from brueggemann May 10, 2024 14:12
@brueggemann
Copy link
Contributor

Preflights have to be run for all modules before the execution tasks are run. This is because we want to validate all module requirements to abort the migration before we do anything, if something goes wrong.

This changes the way `preflight()` and `execute()` (formerly `run()`) methods are executed by "transitions". Additionally use Python's "pickle" formatted file to store arbitrary state data.

Signed-off-by: Tobias Wolf <[email protected]>
@NotTheEvilOne
Copy link
Contributor Author

Preflights have to be run for all modules before the execution tasks are run. This is because we want to validate all module requirements to abort the migration before we do anything, if something goes wrong.

I restructured the internal handling of preflight and execution states to resemble this behavior.

@NotTheEvilOne NotTheEvilOne requested a review from boekhorstb1 May 27, 2024 12:30
@NotTheEvilOne NotTheEvilOne self-assigned this May 28, 2024
src/rookify/modules/module.py Show resolved Hide resolved
@NotTheEvilOne NotTheEvilOne merged commit 99e29ea into main May 29, 2024
2 checks passed
@NotTheEvilOne NotTheEvilOne deleted the prs/use-transitions branch May 29, 2024 09:30
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.

[framework] states
3 participants