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

Feature/standardize task execution #307

Merged
merged 7 commits into from Mar 28, 2023
Merged

Conversation

essweine
Copy link
Contributor

This PR creates a new _run method on task specs that runs the tasks. This method should return True if execution was successful, False if unsuccessful (success and failure are still currently conflated in the COMPLETED task state, but in the future we can differentiate them) or None if the task is not complete, in which case the state will be changed to WAITING

This will allow a custom script engine to execute scripts or service tasks to immediately return None while the task executes without holding up the rest of the workflow. The behavior of the default script engine executes scripts synchronously and returns True on successful completion. This preserves the current behavior.

The old _on_ready_hook method can be used to execute code when the task becomes READY but before it is run; this makes on_ready_before redundant so I've removed it.

I've also changed the prediction model so that (1) we no longer always re-predict definite tasks and (2) the states actually change when sync_children is called. Definite tasks can still be re-predicted by providing an optional mask to _predict.

@github-advanced-security
Copy link

You have successfully added a new SonarCloud configuration ``. As part of the setup process, we have scanned this repository and found no existing alerts. In the future, you will see all code scanning alerts on the repository Security tab.

@sonarcloud
Copy link

sonarcloud bot commented Mar 27, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@burnettk burnettk left a comment

Choose a reason for hiding this comment

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

super exciting. works in backend with just a rename of complete_task_from_id to run_task_from_id.

@danfunk danfunk merged commit 62454c9 into main Mar 28, 2023
3 of 4 checks passed
@danfunk danfunk deleted the feature/standardize-task-execution branch March 28, 2023 13:32
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

4 participants