Skip to content

ci: add concurrency groups to 78 push workflows - #647

Open
gHashTag wants to merge 1 commit into
mainfrom
ci/concurrency-78
Open

gHashTag wants to merge 1 commit into
mainfrom
ci/concurrency-78

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

GitHub Actions concurrency is billed per account, not per repo. This repo held 431 of the account's 644 queued runs, starving gHashTag/t27 at in_progress=0 for over a day — its four merge-gating contexts could not reach a runner, and no PR there could land.

251 of 427 runs were push-event hygiene workflows with no concurrency group: every push spawned a fresh run and nothing superseded anything. Draining 552 runs freed capacity and seven t27 PRs landed within the hour — then the queue was back to 70 in a single cycle. Cancelling treats the symptom; this treats the cause.

Each file gains, at top level (sibling of on:/jobs:):

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

github.workflow is in the key, so two different workflows on the same ref do not cancel each other. push gives refs/heads/main, pull_request gives refs/pull/N/merge — a push run can never cancel a PR run.

fpga-docker.yml gets cancel-in-progress: false. It is the only push workflow that writes externally (docker/build-push-action → ghcr.io, latest tag); killing it mid-upload can leave a half-pushed manifest. It still gets a group so runs serialize rather than pile up.

Skipped 8: seven have no push trigger; trinity-identity-gate.yml already had a group and is byte-for-byte untouched.

Verified by parsing, not by reading. PyYAML re-parsed all 86 files: concurrency is a top-level mapping key in all 79 push workflows and appears under no job. git diff --stat reports 78 files, 347 insertions, zero deletions — an in-place edit of any trigger, job, step or permission would have registered a deletion.

Honest limits. actionlint is unavailable on this machine, so validation is structural only, not a GitHub schema check. The adversarial verifier confirmed top-level placement on 4 of 78 files before the machine's disk filled; the other 74 rest on the parser sweep alone.

Not merged deliberately — this changes CI behaviour across the repo.

Measured: GitHub Actions concurrency is billed per ACCOUNT, not per repo.
trinity-fpga held 431 of the account's 644 queued runs, starving gHashTag/t27
at in_progress=0 for over a day while its merge-gating contexts could not
reach a runner. 251 of 427 runs were push-event hygiene workflows with no
concurrency group, so every push spawned a fresh run and nothing superseded
anything. A drain of 552 runs freed capacity and seven PRs landed within the
hour -- then the queue was back to 70 in one cycle.

Each edited file gains, at top level, a sibling of on:/jobs::

  concurrency:
    group: ${{ github.workflow }}-${{ github.ref }}
    cancel-in-progress: true

github.workflow is in the key so two different workflows on the same ref do
not cancel each other. push gives refs/heads/main and pull_request gives
refs/pull/N/merge, so a push run can never cancel a PR run.

fpga-docker.yml gets cancel-in-progress: false -- it is the only push workflow
that writes externally (docker/build-push-action to ghcr.io with a latest
tag), and killing it mid-upload can leave a half-pushed manifest. It still
gets a group so runs serialize instead of piling up.

Skipped 8: seven have no push trigger, and trinity-identity-gate.yml already
had a group and is left byte-for-byte.

Verified by parsing, not reading: PyYAML re-parsed all 86 files; concurrency
is a top-level mapping key in all 79 push workflows and appears under no job.
git diff --stat shows 78 files, 347 insertions, ZERO deletions -- an in-place
edit of any trigger, job, step or permission would have registered a deletion.

Limits: actionlint is unavailable here, so validation is structural only, and
the adversarial verifier read 4 of 78 files before the disk filled.
@gHashTag

gHashTag commented Oct 2, 2026

Copy link
Copy Markdown
Owner Author

Reviewer bee Z: conflicting, and awaiting the owner's workflow scope. 766 commits behind; conflicts with main. Still relevant: 79 of the 78+1 workflows it edits still exist on main, and only 3 workflows on main have cancel-in-progress today. Because the change is mechanical, regenerating it on current main (a script adding the top-level concurrency: block to push-triggered workflows that lack one) is cheaper than resolving 78 conflicts. Cannot be merged with the bee's token (no workflow scope) in any case.

@gHashTag

gHashTag commented Oct 2, 2026

Copy link
Copy Markdown
Owner Author

Bee review — left open (conflicts) (head 94f042c4ce38)

This is not superseded: none of the 79 workflows touched here has a concurrency: block on main today. Against main, it conflicts in:

  • .github/workflows/codegen.yml: content conflict;
  • .github/workflows/openxc7-build-timing.yml: add/add conflict (main added its own version).

The other 77 files apply cleanly. I didn't resolve the conflicts: a reviewer doesn't push to the branch. Needs a rebase by the author.

@gHashTag

gHashTag commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

Regenerated on current main as #870 (issue #869), as the 2026-10-02 review suggested. It covers 102 workflows today, where this PR covered 78.

#870 changes the key. Here it is ${{ github.workflow }}-${{ github.ref }} with cancel-in-progress: true. That key would:

  • let a push to main cancel a workflow_dispatch run in progress on main. 85 of the 102 workflows are dispatchable.
  • let a second dispatch cancel the first.
  • put conformance-golden-selftests.yml and conformance-selftest.yml, which share one name:, in the same group.

#870 keys on github.workflow_ref instead, gives each dispatch its own group, and cancels in progress only on pull_request.

I have left this PR open. Closing it is the owner's call.

🤖 Generated with Claude Code

dmitrii-f-t27 pushed a commit that referenced this pull request Oct 10, 2026
Eight merges in 3m22s on 2026-10-04 started 220 push runs on main across
66 workflows, and jobs waited ~25 min for a runner (#869). 102 of the 104
workflows that run on push to main had no concurrency group, so nothing
superseded anything.

Each of them now has, at top level:

  concurrency:
    group: ${{ github.workflow_ref }}-${{ github.event_name == 'workflow_dispatch' && github.run_id || github.event_name }}
    cancel-in-progress: ${{ github.event_name == 'pull_request' }}

- push: one run active and one pending per file and branch; a newer
  commit replaces the pending run, and the active run is not cancelled.
- pull_request: a new commit cancels the old commit's run.
- workflow_dispatch: a group per run, so a push never cancels a manual
  run and two dispatches with different inputs never cancel each other.
  85 of the 102 can be dispatched; #647's group (workflow + ref,
  cancel-in-progress always) would have done both.
- The key is workflow_ref (the file), not github.workflow (the name):
  conformance-golden-selftests.yml and conformance-selftest.yml are both
  named "Conformance golden self-tests" and would have shared a group.

Skipped: 2 workflows that already have a group, 18 with no push trigger,
0 reusable workflows. 102 files, 6 lines each, 0 deletions; every edited
file re-parses with the block at top level and no job carrying one.

Refs #869 #647 #851

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant