Uh oh!
There was an error while loading. Please reload this page.
Ensure if-dependency edges don't pull in unselected tasks during target phase - #917
Ensure if-dependency edges don't pull in unselected tasks during target phase#917ahal wants to merge 1 commit into
Conversation
4ff66be to
a28e1c2CompareEijebong
commented
Mar 11, 2026
Does this fix #710 ? |
ahal
commented
Mar 11, 2026
Yes! Forgot about that.. I'll add it to the commit message |
BREAKING CHANGE: Tasks will no longer pull `if-dependencies` in at the target phase. It's now possible for a task with multiple `if-dependencies` to run after one task, without also causing the other to run. Bug: 2020718 Issue: taskcluster#710
a28e1c2 to
5f87817Compareahal
commented
Mar 11, 2026
Hm, though it would only impact the I think I'd want to do it in a follow-up as there is some time pressure to fixing this for |
There was a problem hiding this comment.
I think this is slightly wrong? If a task is both an if-dep for one task and a hard dep for another, the if-dep edge gets dropped.
deftest_if_deps_bork(maketgg):
tgg=maketgg(
target_tasks=["u-t-0", "v-t-0"],
kinds=[
("base", {}),
(
"v",
{
"task-defaults": {
"dependencies": {"base": "base-t-0"},
}
},
),
(
"u",
{
"task-defaults": {
"dependencies": {"if-dep": "base-t-0"},
"if-dependencies": ["base-t-0"],
}
},
),
],
)
target_graph=tgg.target_task_graphassert"u-t-0"intarget_graph.tasksassert"v-t-0"intarget_graph.tasksassert"base-t-0"intarget_graph.tasksedges=target_graph.graph.edgesassert ("u-t-0", "base-t-0", "if-dep") inedgesjcristau
commented
Mar 12, 2026
I worry a bit about unintended consequences here, for tasks that might expect that if they're running then all their dependencies have also run, not just one of them. |
ahal
commented
Mar 12, 2026
Is that wrong though? Tbh, that sounds like intuitively what I'd expect. But I guess part of the problem is that this behaviour is all undefined and everyone has a slightly different idea of what's intuitive. But specifically to this question, why should the existence of a hard dep have any bearing on the how the if-deps are treated? |
For sure, definitely a backwards incompatible change. I guess we could pretty easily audit Gecko to see where In practice I don't think this will be a huge issue though? Like if a task has that expectation it feels like they shouldn't be using |
Eijebong
commented
Mar 12, 2026
Because both |
ahal
commented
Mar 12, 2026
Actually this appears to be incorrect. I wrote a quick test to try it out and as long as one This feels surprising and wrong to me, but maybe I'm not thinking of the use cases for it properly? |
ahal
commented
Mar 12, 2026
Oh I see, that makes sense. Before fixing this edge case however, I think we need to agree on what the behaviour of Intuitively I kind of think we should fix the optimization phase to follow this PR. But is it worth breaking backwards compat? If we decide not to fix this, it does mean we need to stop using |
ahal
commented
Apr 1, 2026
I don't want to land this as is because it introduces separate behaviour at the target phase than what happens in the optimization phase. I think we should fix optimization to also work like this. |
No description provided.