Skip to content

ci: PRs first -- post-merge checks run on the latest main when runners are idle (#4825) - #4843

Merged
squid-protocol merged 2 commits into
mainfrom
ci/4825-post-merge-dispatch
Oct 10, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
ci/4825-post-merge-dispatch

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4825. After every merge, main's push-triggered workflows start at once and take the free plan's ~20 runners from PRs waiting on their checks. GitHub has no job priority, so this PR makes main's heavy checks wait instead.

Changes

  • Cancel superseded main runs (read-only only): cancel-in-progress: true for push events too, in cics-crucible, estate-crucible, fact-crosscheck, java-compile, ports-compile, unicode-gauntlet, smoke-test, tree-sitter-accuracy-audit. Each was checked by reading its steps: none runs git push, git commit, create-pull-request, gh pr merge, a release, or a gh-pages write (the matches were checkout fetches or comments). Writing workflows (evidence-refresh, evidence-pages, *-history, archetype-validation, deploy-docs, publish, mainframe-ground-truth, call-resolution-history, graph-comparison-history) are untouched.
  • full-suite-gate.yml: the push: branches: [main] trigger and its paths are removed. The push: tags: v* trigger stays so release tags are still gated, and schedule and workflow_dispatch stay.
  • post-merge.yml (new): runs every 20 minutes and on dispatch. It reads main's head SHA. If PR jobs waiting for a runner (queued PR runs, plus queued jobs inside in-progress PR runs) is greater than 0, it defers. Otherwise it dispatches full-suite-gate.yml on main once per SHA, skipping if any run already exists for that SHA. Permissions: actions: write, contents: read. The workflow list is one line (WORKFLOWS), so more heavy checks can be added later.

Candidates for a later move from push to dispatch (not moved here, to start conservative): smoke-test (main push grid), tree-sitter-accuracy-audit (about 1 min per merge), ports-compile, java-compile, unicode-gauntlet, cics-crucible, estate-crucible, fact-crosscheck.

Testing

  • All 42 workflow YAML files parse (yaml.safe_load).
  • python tests/tools/workflow_inputs.py: every path-filtered workflow triggers on what it reads (exit 0).
  • bash -n on the dispatcher's run: block: OK.
  • pr_gates.py --fast: 5/5 pass. pr_gates.py --ratchets: 7 pass, 0 fail, 0 skipped.
  • API queries run read-only with gh against squid-protocol/gitgalaxy, at main 97200bb:
queued PR runs: 0            (gh api runs?event=pull_request&status=queued -q '.workflow_runs | length')
in_progress PR runs: 5
  run 38052967512 queued jobs: 0   (runs/{id}/jobs?filter=latest -q '[.jobs[] | select(.status == "queued")] | length')
  (the other four in-progress runs: 0 queued jobs each)
full-suite-gate runs on main for this sha: 1   (workflows/full-suite-gate.yml/runs?branch=main -q select head_sha == sha | length)
latest full-suite-gate runs (id, event, status, conclusion, sha):
  38052469715  push   queued     -          97200bb74   <- queued now, from the merge before this PR
  38050742649  push   completed  cancelled  6affa6646
  38047081790  push   completed  failure    4655f3755

With that marker, the dispatcher will not re-run main at 97200bb, which already has a push run.

Open questions

  • main-watch ignores dispatched runs: main-watch.yml reports only push and schedule events, so a failure in a post-merge dispatched run is not reported. The fix is one line in main-watch.yml (add workflow_dispatch to its event check). It was left out because this PR scopes its edits to triggers and the new file.
  • Only queued PR jobs defer: PR jobs already running do not defer dispatch. Using in_progress as well would hold post-merge checks back for much longer.
  • Cancellation on schedule: a nightly run of a cancel-enabled workflow on main can now be cancelled by a push run. The push run covers the newer SHA.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV

squid-protocol and others added 2 commits October 10, 2026 08:56
…s are idle (#4825)

After every merge, main's push-triggered workflows started at once and took
the free plan's ~20 runners away from PRs waiting on their checks.

- Read-only check workflows with a push-to-main trigger (cics-crucible,
  estate-crucible, fact-crosscheck, java-compile, ports-compile,
  unicode-gauntlet, smoke-test, tree-sitter-accuracy-audit) now set
  cancel-in-progress: true, so a superseded main run is cancelled. Writing
  workflows (history, evidence, docs, publish, archetype) are untouched.
- full-suite-gate drops its main push trigger; it keeps the v* release-tag
  push, schedule and workflow_dispatch.
- post-merge.yml (every 20 min + dispatch) reads main's head SHA, defers while
  any PR job is queued, and otherwise dispatches full-suite-gate on main once
  per SHA (skipped if a run for that SHA already exists).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TBJdDBRtJis5hzE244NQKV
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

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