ci: run the suite once per PR, not twice per merge - #220
Merged
Conversation
ci.yml triggered on both pull_request and push to main, so every squash-merge re-ran the full suite on content that had already passed minutes earlier -- roughly doubling Actions minutes. Drop the push trigger, add workflow_dispatch for on-demand runs against main, and keep pull_request as the actual merge gate. Safe because release.yml re-runs ruff + pytest as its own gate before building an artifact, so main still cannot ship red. Residual risk: a PR green against an older main can merge and break it semantically, surfacing at release time instead of immediately. Branch protection's "require branches to be up to date before merging" would close that gap but is deliberately not being relied on here. Closes #200
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ci.ymltriggered on bothpull_requestandpush: branches: [main], so every squash-merge re-ran the full suite (lint, test, build identity) on content that had already passed minutes earlier as the PR run. That's roughly double the Actions minutes for zero new information, since the merge commit's tree is identical to what the PR run already tested.push: branches: [main]trigger.workflow_dispatchso the suite can still be run on demand againstmain(e.g. before cutting a release, or after changing branch protection settings).pull_request— that's the gate that actually protects merges, and for a tool that moves money it's the one worth paying for.maincan drift red between releases and the gate discovers it at the worst moment"), which is exactly the reasoning being traded away here, so it no longer belonged.Why this is safe
release.ymlalready re-runsruff+pytestas its own gate before it will build an artifact — "a red suite must never produce an artifact that could touch funds." Somainstill cannot ship red even with nothing running automatically on push.Residual risk (stated plainly)
A PR that was green against an older
maincan merge and turn out to be semantically red against themainit actually landed on — two independently-green changes that conflict once combined. Previously, the push-triggered CI run would have caught that immediately on merge. Now it surfaces at release time instead.Branch protection's "require branches to be up to date before merging" would close this gap by forcing every PR to re-test against the latest
mainbefore merge — but that's deliberately not being relied on here, since it would reintroduce the double-run cost this PR removes (just moved to before-merge instead of after).Validation
uv run python -c "import yaml; print(list(yaml.safe_load(open('.github/workflows/ci.yml')).keys()))"parses cleanly (PyYAML maps the barewordonkey toTrueper YAML 1.1 — a pre-existing quirk unrelated to this change, confirmed identical on the pre-change file and onrelease.yml).docs/RELEASING.mdchecked); no doc changes needed..github/workflows/ci.ymltouched — triggers and header comment only, job steps unchanged.Closes #200