Drain the PR queue in batches, and send the token that is actually set #409

Merged
jaylouisw merged 1 commit from ci/forgejo-auto-rebase into main 2026-11-08 13:58:24 +00:00
Owner

Scheduled Forgejo Actions job that rebases stale open pull requests onto main and arms squash auto-merge, so a PR lands as soon as its checks pass. Conflicts are left for a human.

Why it was not working

Two defects in the version this replaces:

  1. It never authenticated. The curl calls sent the literal header Authorization: token ***
    instead of the token from the environment, so every request was unauthenticated and the job
    could not have rebased or armed anything. It now reads $TOKEN and exits non-zero if it is unset.
  2. It rebased all 196 open PRs at once. This host has a single runner, and each rebase enqueues
    a full CI matrix (3 Node versions + smoke + docker). A single pass would have added ~1000 jobs
    to a queue that already takes hours to drain. Each run now takes the oldest batch (default 5)
    mergeable PRs; workflow_dispatch accepts a larger batch when more runner capacity exists.

Conflicted PRs are filtered on mergeable rather than retried every ten minutes — a conflict is a
decision about behaviour, not a transient error.

What lands once this is on main

main has just dropped .github/workflows/ (#1059). The remaining blocker for the open PRs is that
their heads still carry those legacy workflows, whose docker job runs a bare docker build in a
node:20-bookworm job image and fails with exit 127. Rebasing them onto the new main drops the
legacy workflow and leaves the .forgejo CI, whose docker job probes for a daemon and reports its
absence instead of failing.

Scheduled Forgejo Actions job that rebases stale open pull requests onto `main` and arms squash auto-merge, so a PR lands as soon as its checks pass. Conflicts are left for a human. ### Why it was not working Two defects in the version this replaces: 1. **It never authenticated.** The curl calls sent the literal header `Authorization: token ***` instead of the token from the environment, so every request was unauthenticated and the job could not have rebased or armed anything. It now reads `$TOKEN` and exits non-zero if it is unset. 2. **It rebased all 196 open PRs at once.** This host has a single runner, and each rebase enqueues a full CI matrix (3 Node versions + smoke + docker). A single pass would have added ~1000 jobs to a queue that already takes hours to drain. Each run now takes the oldest `batch` (default 5) mergeable PRs; `workflow_dispatch` accepts a larger batch when more runner capacity exists. Conflicted PRs are filtered on `mergeable` rather than retried every ten minutes — a conflict is a decision about behaviour, not a transient error. ### What lands once this is on `main` `main` has just dropped `.github/workflows/` (#1059). The remaining blocker for the open PRs is that their heads still carry those legacy workflows, whose docker job runs a bare `docker build` in a `node:20-bookworm` job image and fails with `exit 127`. Rebasing them onto the new `main` drops the legacy workflow and leaves the `.forgejo` CI, whose docker job probes for a daemon and reports its absence instead of failing.
ci: add Forgejo auto-rebase workflow
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m14s
CI / Test (Node 20) (pull_request) Successful in 1m15s
CI / Test (Node 22) (pull_request) Successful in 1m13s
CI / Server smoke test (pull_request) Successful in 25s
CI / Docker build (pull_request) Failing after 20s
7670ee29a5
Scheduled (every 10 min) Forgejo Actions job that rebases stale open PRs onto main and arms squash auto-merge. Conflicts are skipped for a human.
Merge branch 'main' into ci/forgejo-auto-rebase
Some checks failed
CI / Server smoke test (pull_request) Successful in 29s
CI / Docker build (pull_request) Successful in 10s
CI / Test (Node 18) (pull_request) Successful in 1m40s
CI / Test (Node 22) (pull_request) Failing after 27m56s
CI / Test (Node 20) (pull_request) Failing after 28m0s
f59851c610
Merge branch 'main' into ci/forgejo-auto-rebase
Some checks failed
CI / Test (Node 18) (pull_request) Failing after 26m57s
CI / Test (Node 20) (pull_request) Failing after 30s
CI / Test (Node 22) (pull_request) Successful in 2m1s
CI / Docker build (pull_request) Failing after 13m57s
CI / Server smoke test (pull_request) Failing after 14m9s
8de66f92dc
jaylouisw changed title from ci: add Forgejo auto-rebase workflow to Drain the PR queue in batches, and send the token that is actually set 2026-11-08 13:56:38 +00:00
jaylouisw force-pushed ci/forgejo-auto-rebase from 8de66f92dc
Some checks failed
CI / Test (Node 18) (pull_request) Failing after 26m57s
CI / Test (Node 20) (pull_request) Failing after 30s
CI / Test (Node 22) (pull_request) Successful in 2m1s
CI / Docker build (pull_request) Failing after 13m57s
CI / Server smoke test (pull_request) Failing after 14m9s
to e6e75917be
All checks were successful
CI / Test (Node 18) (pull_request) Successful in 1m37s
CI / Test (Node 20) (pull_request) Successful in 1m27s
CI / Server smoke test (pull_request) Successful in 26s
CI / Test (Node 22) (pull_request) Successful in 1m28s
CI / Docker build (pull_request) Successful in 10s
2026-11-08 13:56:39 +00:00
Compare
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-08 13:56:52 +00:00
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!409
No description provided.