Skip to content

fix: ensure taskgraph full -J --tasks <regex> shows all dependencies#928

Open
ahal wants to merge 1 commit intotaskcluster:mainfrom
ahal:ahal/push-xqlvxprkrkmw
Open

fix: ensure taskgraph full -J --tasks <regex> shows all dependencies#928
ahal wants to merge 1 commit intotaskcluster:mainfrom
ahal:ahal/push-xqlvxprkrkmw

Conversation

@ahal
Copy link
Copy Markdown
Collaborator

@ahal ahal commented Apr 7, 2026

Overwriting task.dependencies with the graph edges doesn't play nicely with get_filtered_taskgraph (e.g --tasks <regex>) because in this case the full graph has already been trimmed. The result is that when using --tasks, the dependencies displayed will be a subset of the real dependencies. This is very misleading and can easily lead one to false conclusions while debugging. Recently this caused me to waste an hour of my time.

I traced this comment back through history and it's been like this since it was originally implemented. Likely the intent was that if we a have a subset of the graph, then we should modify the task definition to not display any dependencies that aren't part of it.

But I disagree with this. I'd argue that Task.dependencies is a very important part of the task definition, and not at all relevant to the higher level DAG that the task happens to be a part of. I believe mutating the task definition just because we did some filtering is a bug.

Testing the full graph from the Firefox repo, I can confirm this change results in identical graphs (when not using --tasks).

@ahal ahal self-assigned this Apr 7, 2026
@ahal ahal requested a review from a team as a code owner April 7, 2026 16:11
@ahal ahal requested a review from Eijebong April 7, 2026 16:11
Overwriting `task.dependencies` with the graph edges doesn't play nicely
with `get_filtered_taskgraph` (e.g `--tasks <regex>`) because in this
case the full graph has already been trimmed. The result is that when
using `--tasks`, the dependencies displayed will be a subset of the real
dependencies. This is very misleading and can easily lead one to false
conclusions while debugging. Recently this caused me to waste an hour of
my time.

I traced this comment back through history and it's been like this since
it was originally implemented. Likely the intent was that if we a have a
subset of the graph, then we should modify the task definition to not
display any dependencies that aren't part of it.

But I disagree with this. I'd argue that `Task.dependencies` is a very
important part of the task definition, and not at all relevant to the
higher level DAG that the task happens to be a part of. I believe
mutating the task definition just because we did some filtering is a
bug.

Testing the full graph from the Firefox repo, I can confirm this change
results in identical graphs (when not using `--tasks`).
@ahal ahal force-pushed the ahal/push-xqlvxprkrkmw branch from b0f8186 to 4cc7091 Compare April 7, 2026 16:18
@hneiva
Copy link
Copy Markdown
Contributor

hneiva commented Apr 7, 2026

I've also had to spend some time figuring out why dependencies weren't showing up. Thanks for fixing it!

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.

2 participants