-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
One of the upcoming use cases for relui, tagging x/ repos, has a dependency graph we can't know without doing significant work. This is in conflict with one of the workflow package's design principles, that workflows be defined ahead of time. So here's one idea for bending that rule. Introduce the concept of an expansion task. An expansion task runs the same as a normal task, but in addition to its inputs it receives (a copy of) the workflow definition and can add tasks and outputs to it as usual. Once the task finishes running, the workflow swaps in the new definition and continues. Other tasks can run concurrently. One significant difference is that the expansion task must run every time the workflow is started or resumed, so they really should be pure functions with no network access or side effects. To encourage this, they don't receive a Context. Introducing this required some refactoring of the existing Run loop; we need to allow these apparently-unused tasks to run, and deal with new tasks popping up mid-run. But overall I think it's not too huge a distortion to the design. For golang/go#48523. Change-Id: I92c164883e06474fa951abba5fa18fd78eacb8ce Reviewed-on: https://go-review.googlesource.com/c/build/+/423037 Run-TryBot: Heschi Kreinick <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Jenny Rakoczy <[email protected]>
- Loading branch information
Showing
2 changed files
with
285 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.