CI: stop main-branch runs from holding up PR runs #107
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
schaefera/utStudyBIble#107
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The runner runs one job at a time (
runner_capacity = 1) and Forgejo Actions has no run priority, so every merge to main queues the whole pipeline (rust → audit → app → e2e → click, more than 10 min) ahead of PR pushes that come after it.Owner decision (2026-10-28): do 1 and 2 now. Watch the queue before option 3 (a second runner or a PR-only runner label, in
~/dev/infrastructure), because that one costs real money.1. Don't repeat a PR's CI on main
A PR is brought up to date with
origin/mainbefore merge (merge-base rule), so the merge commit's tree equals the tree of the PR head that already passed. Onpush: main, a first cheap job comparesHEAD^{tree}withHEAD^2^{tree}. If they match (and HEAD is a merge), the heavy jobs are skipped. Otherwise (direct push, stale merge) the full pipeline runs. Alternative if that gets fiddly: droppush: mainand add a nightlyschedulerun on main.To check first:
ci.yml's hash, plus cargo registry, app-build and sword-modules)? If Forgejo scopes PR caches like GitHub does (PRs read the default branch's caches, writes stay per-PR), skipping main runs would leave the caches cold. In that case, keep a cache-warming step on main, or let the nightly run warm them.clickartifact. Is the arm64 click from main runs used anywhere? If so, keep that job on main.2.
concurrencyon main pushesconcurrency: { group: ci-${{ github.ref }}, cancel-in-progress: ${{ github.ref == 'refs/heads/main' }} }so a newer main push cancels an older queued or running main run. Check that Forgejo 17 honoursconcurrency(test with two quick pushes on a branch) before relying on it.Trunk (
.forgejo/workflows/): full review. Start after #85's PR merges (one feature at a time on the single runner).Data point for option 2 (2026-10-28): a new push to PR #106 cancelled the run still in progress for its previous head (run 177, every job "Has been cancelled", with no
concurrencykey in ci.yml). Forgejo already cancels a supersededpull_requestrun by itself. Still to find out: whether it does the same forpush: mainruns, which is the case #107 needs.Options 1 and 2 are merged in #108 (
e7194a4).Option 3, a second runner, isn't done. You chose to watch first, because it has a real cost. If PR runs still wait behind main, reopen this issue for it.
Two things came up along the way:
ci-preview/*branch therefore needs an open draft PR (docs/09).appruns on trees that had already passed. That now costs more queue time than main's repeat runs did.