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

feat: auto-detect custom start and stop events in workflow classes #17865

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

masci
Copy link
Member

@masci masci commented Feb 19, 2025

Description

With #17767 we introduced the ability to use custom start and stop events in workflow. I wasn't happy with the UX, because in order to use custom events you had to pass them to the workflow init like this (or a variation of this):

wf = MyWorkflow(start_event_class=MyStart, stop_event_class=MyStop)

With this PR, start and stop events are inferred from the step definitions, so if your workflow is using MyStart and MyStop, you can intantiate the workflow without caring about that: wf = MyWorkflow().

Question: the current PR is backward compatible, but start_event_class and stop_event_class were added very recently and not documented. Should we just kill them and always rely on introspection?

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Your pull-request will likely not be merged unless it is covered by some form of impactful unit testing.

  • I added new unit tests to cover this change
  • I believe this change is already covered by existing unit tests

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files. topic:workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant