ci(auto-rebase): the tick fetches its own tree, so a dead data.forgejo.org cannot cancel setup #2374

Closed
jaylouisw wants to merge 1 commit from fix/1121-0532 into main
Owner

Fixes #2366.

What was wrong

The runner pre-clones every uses: action at dispatch, before a step of the job runs. auto-rebase.yml was the last workflow in this repository carrying one, so when this host lost egress to data.forgejo.org on 2026-11-20 every tick failed in Set up job - sixteen in a row, 7 h 20 m with no rebase and no arming backstop, in twelve-line logs that no step of the workflow could write to.

What changed

  • .forgejo/workflows/auto-rebase.yml: the Check out the queue step (uses: actions/checkout@v4) is replaced by Fetch the queue - git init + one --filter=blob:none fetch of main, the shape pr-rebase.yml runs ~750 times a day. Same commit, same tree, same if: gate on steps.room.outputs.room / steps.queue.outputs.work / steps.queue.outputs.push, credentials still only in origin from the push prologue onwards. The fetch is bounded (90 s timeout, 1 kB/s low-speed abort) like every other call in the file.
  • test/ci-disk-hygiene.test.js: the #1508 invariant now reads "the room guard precedes whatever materialises the tree" (actions/checkout or a git fetch), with guardAt < checkoutAt and gated() unchanged; a new case asserts the rebase job runs no uses: at all, so the dependency cannot come back. That new case fails on main and passes here.

Verification

  • Reproduced first: the new test failed on main with actual: ['uses: actions/checkout@v4'].
  • Behaviour simulated against a local bare repo with uploadpack.allowFilter: blobless fetch, checkout -B auto/1 origin/<ref>, merge-base --is-ancestor, rebase, diff --quiet and --force-with-lease push all succeed from the object-less clone (blobs fetched on demand, the property pr-rebase.yml already relies on).
  • node scripts/syntax-check.js: 515 files, all OK.
  • npm test: 435 suites, 14 624 assertions, 0 failed.

Cost

Run 4968 (dispatch from a branch doing exactly this) took 5 s where run 4967 from main with the action took 17 s on the same "no mergeable open pull requests" answer - 3.8 s of action clone plus the 9.2 s full-depth fetch of 792 refs measured in run 4962.

Not done

Nothing outstanding for the issue. While in the file I noticed the Rebase and arm step still carries two long comment paragraphs about github.event.inputs and about a run-token push duplicating a later paragraph on the same subject; consolidating those is a separate docs cleanup, left alone here.

Fixes #2366. ## What was wrong The runner pre-clones every `uses:` action at dispatch, before a step of the job runs. `auto-rebase.yml` was the last workflow in this repository carrying one, so when this host lost egress to `data.forgejo.org` on 2026-11-20 every tick failed in `Set up job` - sixteen in a row, 7 h 20 m with no rebase and no arming backstop, in twelve-line logs that no step of the workflow could write to. ## What changed - `.forgejo/workflows/auto-rebase.yml`: the `Check out the queue` step (`uses: actions/checkout@v4`) is replaced by `Fetch the queue` - `git init` + one `--filter=blob:none` fetch of `main`, the shape `pr-rebase.yml` runs ~750 times a day. Same commit, same tree, same `if:` gate on `steps.room.outputs.room` / `steps.queue.outputs.work` / `steps.queue.outputs.push`, credentials still only in `origin` from the push prologue onwards. The fetch is bounded (90 s `timeout`, 1 kB/s low-speed abort) like every other call in the file. - `test/ci-disk-hygiene.test.js`: the #1508 invariant now reads "the room guard precedes whatever materialises the tree" (actions/checkout **or** a `git fetch`), with `guardAt < checkoutAt` and `gated()` unchanged; a new case asserts the `rebase` job runs no `uses:` at all, so the dependency cannot come back. That new case fails on main and passes here. ## Verification - Reproduced first: the new test failed on `main` with `actual: ['uses: actions/checkout@v4']`. - Behaviour simulated against a local bare repo with `uploadpack.allowFilter`: blobless fetch, `checkout -B auto/1 origin/<ref>`, `merge-base --is-ancestor`, `rebase`, `diff --quiet` and `--force-with-lease` push all succeed from the object-less clone (blobs fetched on demand, the property `pr-rebase.yml` already relies on). - `node scripts/syntax-check.js`: 515 files, all OK. - `npm test`: **435 suites, 14 624 assertions, 0 failed**. ## Cost Run 4968 (dispatch from a branch doing exactly this) took 5 s where run 4967 from `main` with the action took 17 s on the same "no mergeable open pull requests" answer - 3.8 s of action clone plus the 9.2 s full-depth fetch of 792 refs measured in run 4962. ## Not done Nothing outstanding for the issue. While in the file I noticed the `Rebase and arm` step still carries two long comment paragraphs about `github.event.inputs` and about a run-token push duplicating a later paragraph on the same subject; consolidating those is a separate docs cleanup, left alone here.
ci(auto-rebase): the tick fetches its own tree, so a dead data.forgejo.org cannot cancel setup (#2366)
All checks were successful
CI / Classify the change (pull_request) Successful in 22s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 19s
CI / Test (Node 22) (pull_request) Successful in 1m7s
CI / Test (Node 18) (pull_request) Successful in 1m9s
CI / Test (Node 20) (pull_request) Successful in 1m10s
CI / Server smoke and Docker build (pull_request) Successful in 25s
CI / Arm auto-merge (pull_request) Successful in 4s
e0832da25b
The runner pre-clones every `uses:` action at dispatch, before a step of the job
runs. `auto-rebase.yml` was the last workflow here carrying one, so on 2026-11-20 -
when this host lost egress to data.forgejo.org - sixteen consecutive ticks failed in
`Set up job` with `could not fetch remote 'origin': ... Failed to connect to
data.forgejo.org:443`, every real step `cancelled`, in a twelve-line log no step of
this workflow could write to. 7 h 20 m with no rebase and no arming backstop, and
sixteen red runs that read like code failures.

The `Check out the queue` step is now `git init` + one blobless fetch of `main`,
the shape pr-rebase.yml runs ~750 times a day. Same commit, same tree, same guard,
same gate (`steps.queue.outputs.push`), and credentials stay out of `.git/config`
until the prologue deliberately puts them in `origin` for the push. A failure now
lands inside a step, where the log explains it, instead of outside the workflow.

Cost as well as correctness: run 4968 (a dispatch from a branch doing exactly this)
took 5 s where run 4967 from main with the action took 17 s on the same answer -
3.8 s of action clone plus the 9.2 s full-depth fetch of 792 refs in run 4962.

Verified against a local bare repo: blobless fetch, `checkout -B auto/1 origin/<ref>`,
`merge-base --is-ancestor`, `rebase`, `diff --quiet` and `--force-with-lease` push all
succeed from the object-less clone (blobs are fetched on demand, as pr-rebase relies on).

test/ci-disk-hygiene.test.js: the "+#1508" invariant now reads "the room guard
precedes whatever materialises the tree" - actions/checkout or a git fetch - with
`guardAt < checkoutAt` and `gated()` unchanged; and a new case asserts the rebase job
runs no `uses:` at all, so this cannot come back.

npm test: 435 suites, 14624 assertions, 0 failed.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-21 05:40:01 +00:00
Author
Owner

Conflicted after #2370 landed

main at 1cbc0b62 (squash of #2370, ci/1121-0502) now carries the same rewrite this PR makes, so the merge reports conflicts in both files:

  • .forgejo/workflows/auto-rebase.yml — both branches replace the same comment block and drop the same second fetch; the prose is a different narrative of the same change, not adjacent insertions.
  • test/ci-disk-hygiene.test.js — same story: #2370 already relaxed the "job must still check out" assertion.

git merge-tree origin/main fix/1121-0532 names stages 1/2/3 for both paths. This is a behaviour/wording decision (which narrative of the tick survives), not a mechanical conflict, so the surgery loop is not resolving it.

Needs the author: rebase fix/1121-0532 on main and keep one narrative. The PR is green 7/7 on e0832da2 but that run is a merge against the pre-2370 tree, so it cannot be merged as-is. Branch is 4 behind and the head status will have to be re-armed after the force-push.

### Conflicted after #2370 landed `main` at `1cbc0b62` (squash of #2370, `ci/1121-0502`) now carries the same rewrite this PR makes, so the merge reports conflicts in both files: - `.forgejo/workflows/auto-rebase.yml` — both branches replace the same comment block and drop the same second fetch; the prose is a different narrative of the same change, not adjacent insertions. - `test/ci-disk-hygiene.test.js` — same story: #2370 already relaxed the "job must still check out" assertion. `git merge-tree origin/main fix/1121-0532` names stages 1/2/3 for both paths. This is a behaviour/wording decision (which narrative of the tick survives), not a mechanical conflict, so the surgery loop is not resolving it. **Needs the author:** rebase `fix/1121-0532` on `main` and keep one narrative. The PR is green 7/7 on `e0832da2` but that run is a merge against the pre-2370 tree, so it cannot be merged as-is. Branch is 4 behind and the head status will have to be re-armed after the force-push.
jaylouisw closed this pull request 2026-11-21 06:10:07 +00:00
Author
Owner

Closing as superseded — no merge, no rebase.

The fix this PR carries is already on main: commit 1cbc0b62 ("ci(auto-rebase): the tick checks out with git, so an unreachable forge cannot stop setup (#2366)"), which landed as #2370 and closed #2366. It does the same thing this branch does — actions/checkout removed, the tree built with git init -q . + git remote add origin + a blobless git fetch, credentials per command through an inline helper rather than http.extraheader.

I merged origin/main into this head locally to classify the red/conflicted state. It is not a code conflict: both sides are prose about the same rewrite, and every conflict hunk is a comment block narrating #2366 from two angles (.forgejo/workflows/auto-rebase.yml, test/ci-disk-hygiene.test.js). There is no behaviour here that main lacks — the step bodies are equivalent.

One thing main does not carry, in case it is worth a fresh PR: this branch generalises isCheckout() in test/ci-disk-hygiene.test.js to also match a git ... fetch step, and adds a test asserting the rebase job runs no uses: at all. That is a test-strength improvement independent of the fix; file it on its own against current main and it should land clean.

Author: nothing to rebase — the branch can go.

Closing as **superseded** — no merge, no rebase. The fix this PR carries is already on `main`: commit **1cbc0b62** ("ci(auto-rebase): the tick checks out with git, so an unreachable forge cannot stop setup (#2366)"), which landed as #2370 and closed #2366. It does the same thing this branch does — `actions/checkout` removed, the tree built with `git init -q .` + `git remote add origin` + a blobless `git fetch`, credentials per command through an inline helper rather than `http.extraheader`. I merged `origin/main` into this head locally to classify the red/conflicted state. It is **not** a code conflict: both sides are prose about the same rewrite, and every conflict hunk is a comment block narrating #2366 from two angles (`.forgejo/workflows/auto-rebase.yml`, `test/ci-disk-hygiene.test.js`). There is no behaviour here that `main` lacks — the step bodies are equivalent. One thing `main` does **not** carry, in case it is worth a fresh PR: this branch generalises `isCheckout()` in `test/ci-disk-hygiene.test.js` to also match a `git ... fetch` step, and adds a test asserting the `rebase` job runs no `uses:` at all. That is a test-strength improvement independent of the fix; file it on its own against current `main` and it should land clean. Author: nothing to rebase — the branch can go.
All checks were successful
CI / Classify the change (pull_request) Successful in 22s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 19s
CI / Test (Node 22) (pull_request) Successful in 1m7s
CI / Test (Node 18) (pull_request) Successful in 1m9s
CI / Test (Node 20) (pull_request) Successful in 1m10s
CI / Server smoke and Docker build (pull_request) Successful in 25s
CI / Arm auto-merge (pull_request) Successful in 4s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2374
No description provided.