-
Notifications
You must be signed in to change notification settings - Fork 340
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
tasks: pickup outgoing task dependencies #1573
Conversation
Deploying devenv with Cloudflare Pages
|
d46116a
to
4fac0ae
Compare
4fac0ae
to
7a21587
Compare
7a21587
to
ae5540e
Compare
f35555d
to
4726277
Compare
We need to brainstorm on this one. Only doing incoming (outgoing) edges means that only Using undirected lets us traverse the entire graph, at the cost of not letting us run subgraphs of tasks. We can't tell the difference between ordering hints and requirements. In this example, if we run graph TD;
devenv:python:virtualenv-->app:afterVenv;
devenv:python:virtualenv-->devenv:enterShell;
devenv:enterShell-->app:afterShell;
devenv:git-hooks:install-->devenv:enterShell;
But if we run just graph TD;
devenv:python:virtualenv-->app:afterVenv;
devenv:python:virtualenv-->devenv:enterShell;
devenv:enterShell-->app:afterShell;
devenv:git-hooks:install-->devenv:enterShell;
style app:afterVenv fill:#0095b6,stroke-width:0,color:white
style devenv:python:virtualenv fill:#0095b6,stroke-width:0,color:white
|
@sandydoo maybe hooks should do the former while |
@sandydoo shall we open an issue and merge this? |
Yeah, we need a CLI flag to modify the "traversal strategy" |
I think we're running the tasks in reverse order after the toposort. The following tasks are speced to run afterenterShell
, but they instead run before.This PR lets the graph traversal visit both incoming and outgoing edges.
Traversing all the edges of a node allows picking up tasks that are only specified to run after the current node. For example:
Previously, the only way to do this was to also use
before
to add this dependency to the graph, usually viadevenv:enterShell
. This change also allows running tasks afterdevenv:enterShell
.Fixes #1557.
TODO
While this change makes setting up tasks more predictable, we'll need to make this behavior configurable to support one-off tasks. You might want to run just the specified task, or all the tasks up to the specified task.
This also opens up the question of different types of constraints, e.g. ordering vs dependency. systemd has
After
andRequires
.