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

Allow flows to set run state from "key_tasks" #95

Merged
merged 5 commits into from Aug 7, 2018

Conversation

jlowin
Copy link
Member

@jlowin jlowin commented Aug 7, 2018

Closes #26

Introduces a new method for flows called set_key_tasks(). "Key tasks" are tasks that determine the state of the flow when it runs. By default, they are the flow's terminal tasks. However, the user may specify any other tasks in the flow.

Operationally, this changes almost none of the flow run logic, except that it looks at the key tasks to determine state instead of the terminal tasks. The only change is that terminal tasks are still waited on (by the executor) and checked to make sure they're in a Finished state. If - and only if - they have finished, the key tasks are checked to determine state. In other words: the flow must still be completely done before state is checked, even if the tasks that determine state are finished, themselves.

Check not only for cycles, but also for edges / key_tasks that reference non-existant tasks
@jlowin jlowin requested a review from cicdw as a code owner August 7, 2018 01:57
Copy link
Member

@cicdw cicdw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you're killin' it with these tests, I love it!

@@ -58,6 +58,7 @@ def __init__(

self.tasks = set() # type: Set[Task]
self.edges = set() # type: Set[Edge]
self.set_key_tasks([])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd vote to include this as an init argument as well, so users don't have to declaratively call this method if they don't want to.

@jlowin jlowin merged commit 75b6929 into master Aug 7, 2018
@jlowin jlowin deleted the flow_state_from_tasks branch August 7, 2018 19:51
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.

None yet

2 participants