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 intotaskcluster:mainfrom
Conversation
4ff66be to
a28e1c2
Compare
|
Does this fix #710 ? |
|
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
5f87817
Compare
|
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.
def test_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_graph
assert "u-t-0" in target_graph.tasks
assert "v-t-0" in target_graph.tasks
assert "base-t-0" in target_graph.tasks
edges = target_graph.graph.edges
assert ("u-t-0", "base-t-0", "if-dep") in edges|
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. |
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 |
Because both |
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? |
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 |
No description provided.