ci(actions): keep push runs on main from being cancelled #28
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/nanoKontroller2!28
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-26-push-run-concurrency"
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?
Adds a workflow-level
concurrencyblock to.forgejo/workflows/build.yml:A
pushrun onmainis no longer cancelled when a second merge lands seconds later, so everymaincommit keeps a verdict that is not retracted. Pull-request runs keep superseding each other.Design points (also in the commit message and as a comment in the file):
groupkey, deliberately. Per the reference, without a group a falsecancel-in-progressmeans no concurrency management at all — runs proceed in parallel up to the runner's capacity and all finish. Agroupwould instead serialise runs that are independent.event_name, not on the ref. The docs' example usesforgejo.ref_name != 'main', but the documented sampleforgejocontext for a pull-request event carries"ref_name": "main", so a ref-based test risks disabling cancellation on PR runs too. Sinceon.push.branchesis["main"], "event is notpull_request" is exactly "push onmain".Verified:
concurrencyis listed as accepting theforgejocontext, andevent_nameis a documented field of it. The file still parses as YAML with the expression intact. The real check is this PR's ownBuildrun — Forgejo evaluates the expression server-side at run creation, so an unsupported key or malformed expression shows up as a run that does not start.Fallback if the instance rejects the expression: the plain documented form
concurrency:/cancel-in-progress: false, which still fixes themaincase at the cost of letting superseded PR runs finish too. I will report here if that happens.Note: the existing red check on
530bd777ae041662a64195eb7254beca641f5ff7stays red until run #19 is re-run from the Actions UI; this change only affects future runs. Genuine parallelism additionally depends on the runner'srunner.capacity(instance-side, not reachable from this repository); with capacity 1 the runs simply execute one after the other — both to completion, which is the property asked for.Closes: #26
WIP: ci(actions): keep push runs on main from being cancelledto ci(actions): keep push runs on main from being cancelledVerification done:
Build / build (pull_request)onbe6af55ran and finished green (run 16498). The run was created and dispatched normally, so this instance accepts theconcurrencykey and evaluates theforgejo.event_nameexpression server-side — the fallback to the plaincancel-in-progress: falseform is not needed.Marked ready for review.
@ -8,0 +20,4 @@# The test is on `event_name` and not on the ref because a pull-request event's# context carries the base ref (`ref_name: main`), which would switch# cancellation off there too. Push runs can only come from `main` (see# `on.push.branches` above), so "not a pull request" is exactly "push on main".Are you trying to write a novel here?
Fair. Cut from 16 lines to 5 in
07be414, keeping only the two things that aren't obvious from the setting itself — why there is nogroup, and why the condition tests the event rather than the ref. The incident narrative is in the commit message and #26, where it belongs.Say the word if you want it shorter still — the
groupand ref rationales are the two I'd argue hardest to keep, since both are traps someone would otherwise walk into when editing this.