Derive a base revision for git pushes that create a branch so tgdiff runs on code review bot pushes
Categories
(Firefox Build System :: Task Configuration, task)
Tracking
(firefox162 fixed)
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: nhadji, Assigned: ahal)
References
(Blocks 1 open bug)
Details
Attachments
(2 external files, 1 obsolete file)
Part of the Mercurial -> Git CI migration (blocks gecko2github). Follow-up to bug 2046767.
When a git push creates a branch, GitHub reports the push's before revision as the null SHA and the decision task records it as base_rev. With bug 2046767 the source-test-taskgraph-diff (tgdiff) task skips the diff with a warning in that case instead of failing. That is fine for a developer branch, but it loses the diff where it matters most.
The code review bot (bug 2048352) pushes every Phabricator revision to its own branch on mozilla-firefox/firefox-crb with a force push:
- the first diff of a revision creates the branch, so
base_revis the null SHA and no taskgraph diff is produced; - later diffs of the same revision force-push the branch, so
base_revis the previous diff's tip and the task compares the new patch to the old one instead of tomain.
Today, on Mercurial try, the base of the bot's push is the mozilla-central changeset the stack sits on, and the "Tasks were added or removed" review comment comes from that diff. The em-onpush diff reviewbot posted on D335510 is a recent example of it catching a real problem.
Possible fixes:
- In
get_base_git_rev(decision.py), whenbase_revis the null SHA, or whenever the push went to a branch that is not the default one, fetch the default branch ofbase_repositoryand usegit merge-base head_rev <default branch>asbase_git_rev. - Let the bot hand over the base it applied the stack on, since it knows the
maincommit it cloned.
Verification: a push creating a branch on mozilla-releng/staging-firefox, then a force push to the same branch, should both produce a taskgraph diff against main. D332894 documents the current behaviour: push 1 skips the diff, push 2 diffs against the previous tip.
| Assignee | ||
Comment 1•2 days ago
|
||
Updated•2 days ago
|
Comment 2•1 day ago
|
||
Comment on attachment 9683715 [details]
Bug 2084622 - Version bump taskcluster-taskgraph to v24.8.0, r?#taskgraph-reviewers!
Revision D343152 was moved to bug 2092851. Setting attachment 9683715 [details] to obsolete.
| Assignee | ||
Comment 3•1 day ago
|
||
This allows tasks in Gecko to use Taskgraph 24.9.0's new ability to
fetch secrets in run-task (assuming they are using the upstream
run-task).
| Assignee | ||
Comment 4•1 day ago
|
||
Taskgraph's run-task replaces <PREFIX>_BASE_REV with the merge base found
through GitHub's compare API and fetches it. Pass the base revision and ref to
the task through GECKO_BASE_REV and GECKO_BASE_REF, and read the base at
runtime so the diff runs against the corrected value instead of the one baked
into the task definition. This makes tgdiff work for pushes that create a
branch or force push one, such as the code review bot's.
Support Taskgraph's secrets key in job descriptions by reusing its
use_secrets transform, and use it on git pushes to give run-task a GitHub
token, so its compare requests aren't rate limited as anonymous ones.
Comment 6•1 day ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/50348879a0a8
https://hg.mozilla.org/mozilla-central/rev/68e78809c2a1
Updated•14 hours ago
|
Updated•14 hours ago
|
Description
•