ci: stand down the test jobs on a merge its pull request already tested - #28
Merged
Merged
Conversation
A squash or rebase merge onto an unmoved main carries the tree its pull request tested. ci.yml gains an already_tested job that runs substrax's already-tested action, pinned by commit, on a push only. The quality, unit shard, integration and coverage jobs need it and run unless the action answers true, so an empty answer (a manual run, a failed lookup) keeps them running. The coverage contract accepts that one condition on the combined coverage job and still refuses any other: the gate stands the job down only for a tree whose pull request ran it successfully. The CI contract module gains the gate's rules: the compare runs only on a push, it is the shared action pinned to a full SHA, every job consults it, and no job reads an empty answer as a skip.
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.
Summary
ci.ymlgains analready_testedjob that runsavitai/substrax/.github/actions/already-tested@ec43d80bbae0040375f746cd1bb07dddb0a0b169on a push only.quality, the sixunit_testsshards,integration_testsandcoverageneed it and run whenneeds.already_tested.outputs.skip != 'true'. A merge whose pull request already passed over the same tree skips the repeat; a manual dispatch or a failed lookup leaves the output empty and runs everything.ci.ymlis main-only, so no main-only job loses a dependency.build-verification.ymlis not gated: its matrix adds themacos-14legs only on a push tomain, so the merge is the one run that builds on macOS.security.yml(18 to 28 runner seconds) is near break-even against the gate's own checkout and API calls;docs.ymldeploys on a push;quality-checks.ymlandpublish.ymlnever run on a push.Contract tests
tests/test_ci_concurrency.pygains four tests overci.yml: the compare runs only on a push, it is the shared action pinned to a full commit SHA, every job consults the gate, and no job reads an empty answer as a skip. Three failed before the workflow change and all pass after it.tests/test_ci_coverage.pyrefused anyif:on the combined coverage job. It now accepts exactly the gate condition and still refuses any other: the gate stands the job down only for a tree whose pull request ran it, and every other check, successfully.Local checks
pytest tests/test_ci_concurrency.py tests/test_ci_shards.py tests/test_ci_coverage.py(10 passed)pre-commit run --all-files(exit 0)