Handle the null base revision in `mach taskgraph --diff` so tgdiff works on git-backed pushes
Categories
(Firefox Build System :: Task Configuration, task)
Tracking
(firefox162 fixed)
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: nhadji, Assigned: nhadji, NeedInfo)
References
(Blocks 1 open bug)
Details
Attachments
(1 obsolete file)
Part of the Mercurial -> Git CI migration (blocks gecko2github).
On a git-backed push that creates a new branch (e.g. a mach try push), GitHub reports the push's "before" revision as the null SHA 0000000000000000000000000000000000000000. The decision task records it as base_rev, and the source-test-taskgraph-diff (tgdiff) task passes it to mach taskgraph target --diff {base_rev}.
show_taskgraph (taskcluster/gecko_taskgraph/main.py) then calls repo.update("0000...0") -> git checkout 0000000000000000000000000000000000000000, which fails with fatal: unable to read tree (0000...). Mercurial accepts the null SHA as its null revision, so hg pushes were never affected; git has no all-zeros object.
This is the last blocker for unguarding source-test/taskgraph.yml; the other source-test guard removals are Bug 2046757.
Comment 1•3 months ago
|
||
I think this might have been fixed by:
https://github.com/taskcluster/taskgraph/pull/921
It's possible that at the time this was filed, Gecko hadn't picked up a version of Taskgraph with the fix yet? Or it's possible there's still another issue that that PR didn't address.
Can you still reproduce this?
| Assignee | ||
Comment 2•1 month ago
|
||
The task was kept on Mercurial because --diff {base_rev} substitutes the
hg base changeset, which a git checkout cannot resolve, and because a push
that creates a branch has the null SHA as base, which crashed
mach taskgraph --diff.
The decision task now records base_git_rev: base_rev on git pushes and
the base changeset's git_commit extra on Mercurial pushes (None when there
is no base or no mapping). The task prefers it through the task-context
parameter list and falls back to base_rev for pushes without a git mirror.
mach taskgraph --diff skips the diff with a warning instead of failing
when the base is the null revision or cannot be checked out, and fetches a
missing base with one depth-1 git fetch first, since CI clones are shallow.
Verified on staging-firefox: a push creating a branch (null base) skips the
diff and is green; a second push on the same branch fetches the base from
the staging repository and generates the diff. Verified on an hg try push
(2065399): the hg base maps to its git commit, the task clones the git
mirror, fetches the base from git-backing and generates the diff in 12m47
(autoland baseline 12 to 13 min).
Landing waits on https://github.com/mozilla/global-platform-admin/pull/7642
(GitHub app install for the repo).
Updated•1 month ago
|
Updated•1 day ago
|
Comment 3•17 hours ago
|
||
This ended up getting fixed in upstream Taskgraph and then integrated into gecko in bug 2084622
Updated•12 hours ago
|
Updated•12 hours ago
|
Updated•12 hours ago
|
Description
•