Skip to content

ci: stand down the test jobs on a merge its pull request already tested - #28

Merged
mahdi-shafiei merged 1 commit into
mainfrom
ci/already-tested-gate
Sep 30, 2026
Merged

mahdi-shafiei merged 1 commit into
mainfrom
ci/already-tested-gate

Conversation

@mahdi-shafiei

@mahdi-shafiei mahdi-shafiei commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • ci.yml gains an already_tested job that runs avitai/substrax/.github/actions/already-tested@ec43d80bbae0040375f746cd1bb07dddb0a0b169 on a push only. quality, the six unit_tests shards, integration_tests and coverage need it and run when needs.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.
  • No job in ci.yml is main-only, so no main-only job loses a dependency.
  • Left ungated: build-verification.yml is not gated: its matrix adds the macos-14 legs only on a push to main, 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.yml deploys on a push; quality-checks.yml and publish.yml never run on a push.

Contract tests

  • tests/test_ci_concurrency.py gains four tests over ci.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.py refused any if: 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)
  • every workflow file loads as YAML

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.
@mahdi-shafiei
mahdi-shafiei merged commit 6ddc41f into main Sep 30, 2026
13 checks passed
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