CI decides a change's checks in one pass, released as the versioned package @romaine-life/ci-suites (MQ-9) #340

Merged
merge-queue merged 1 commit from ci-suites-decide into main 2026-12-01 00:09:02 -08:00
Owner

https://openproject.home.romaine.life/wp/MQ-9: CI's decision logic (which checks a change needs, their fingerprints, the suite settings) becomes one entry point and a versioned npm package, @romaine-life/ci-suites, so merge-queue can decide every PR's checks centrally and pull-request check can pin a version instead of reading main. Released by this repository's new ci-release + release-module topics (infra-bootstrap#57, landed): each merge that changes a release input publishes a version.

Added

  • suites/decide.mjs: decide({dir, base, head, repository, topics}) and a CLI printing {"version":1,"suites":{"<suite>":{"workflow","outputs","checks":{"<check>/<variant>":{"check","variant","key","fingerprint","cacheKey","producer","changed"}}}}} for default plus every ci- suite in the topics. No network, no token, no pass lookup; refuses a checkout whose HEAD isn't head or that isn't the checkout's top; one decision per process at a time (it changes directory).
  • Root package.json naming @romaine-life/ci-suites: suites/ and actions/ without tests or node_modules, and .github/actionlint.yaml. publishPackage records the release commit as gitHead; lib.mjs suiteCommit() reads it (else the checkout's HEAD), the one source of the suites commit.
  • suites/tests/decide.test.mjs.

Changed

  • inputs.mjs: the scope logic is one suiteScope(...) shared by the CI scope job (scope(), which still looks passes up first) and decide; testJobs stays the one test-platform rule inside it. check.mjs takes its outputs from decide instead of a temporary GITHUB_OUTPUT. cacheKey, producer and new checkEntries move to fingerprints.mjs (re-exported by reuse.mjs); fingerprint() takes the repository as an argument. go/group.mjs reads suiteCommit().

Proved equivalent on real data: 154 fleet repositories × their last 3 non-merge commits (415 commits, 1,226 suite runs, 37,588 outputs). In CI mode (empty pass cache), 0 differences. Local mode (no reuse) differs only where a check has no fingerprint entry, which CI already reported false (e.g. test-linux for suites without their own tests); no job conditioned on those keys exists. One real regression found and fixed on the way (tofu apply was computed for a PR when the event was unset).

Left alone: pass reuse in CI (reuse.mjs, pass-cache.mjs), every workflow.

pull-request's pin moves to the first released version in its own PR once this publishes.

🤖 Generated with Claude Code

https://openproject.home.romaine.life/wp/MQ-9: CI's decision logic (which checks a change needs, their fingerprints, the suite settings) becomes one entry point and a versioned npm package, `@romaine-life/ci-suites`, so merge-queue can decide every PR's checks centrally and `pull-request check` can pin a version instead of reading main. Released by this repository's new `ci-release` + `release-module` topics (infra-bootstrap#57, landed): each merge that changes a release input publishes a version. **Added** - `suites/decide.mjs`: `decide({dir, base, head, repository, topics})` and a CLI printing `{"version":1,"suites":{"<suite>":{"workflow","outputs","checks":{"<check>/<variant>":{"check","variant","key","fingerprint","cacheKey","producer","changed"}}}}}` for `default` plus every `ci-` suite in the topics. No network, no token, no pass lookup; refuses a checkout whose HEAD isn't `head` or that isn't the checkout's top; one decision per process at a time (it changes directory). - Root `package.json` naming `@romaine-life/ci-suites`: `suites/` and `actions/` without tests or node_modules, and `.github/actionlint.yaml`. `publishPackage` records the release commit as `gitHead`; `lib.mjs suiteCommit()` reads it (else the checkout's HEAD), the one source of the suites commit. - `suites/tests/decide.test.mjs`. **Changed** - `inputs.mjs`: the scope logic is one `suiteScope(...)` shared by the CI scope job (`scope()`, which still looks passes up first) and `decide`; `testJobs` stays the one test-platform rule inside it. `check.mjs` takes its outputs from `decide` instead of a temporary `GITHUB_OUTPUT`. `cacheKey`, `producer` and new `checkEntries` move to `fingerprints.mjs` (re-exported by `reuse.mjs`); `fingerprint()` takes the repository as an argument. `go/group.mjs` reads `suiteCommit()`. **Proved equivalent on real data**: 154 fleet repositories × their last 3 non-merge commits (415 commits, 1,226 suite runs, 37,588 outputs). In CI mode (empty pass cache), 0 differences. Local mode (no reuse) differs only where a check has no fingerprint entry, which CI already reported `false` (e.g. `test-linux` for suites without their own tests); no job conditioned on those keys exists. One real regression found and fixed on the way (`tofu apply` was computed for a PR when the event was unset). **Left alone**: pass reuse in CI (reuse.mjs, pass-cache.mjs), every workflow. pull-request's pin moves to the first released version in its own PR once this publishes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Suites decide a change's checks in one pass, released as the versioned package @romaine-life/ci-suites (MQ-5)
All checks were successful
CI / changes (pull_request) Successful in 4s
CI / actionlint (pull_request) Has been skipped
CI / prune-releases (pull_request) Has been skipped
CI / release-version (pull_request) Has been skipped
CI / check-versions (pull_request) Has been skipped
CI / check-fetches (pull_request) Has been skipped
CI / check-image-digests (pull_request) Has been skipped
CI / cached-images (pull_request) Has been skipped
CI / container-health (pull_request) Has been skipped
CI / azure-cli (pull_request) Has been skipped
CI / home-cache-linux (pull_request) Has been skipped
CI / home-cache-windows (pull_request) Has been skipped
CI / cache-save (ubuntu-latest) (pull_request) Has been skipped
CI / cache-save (windows-latest) (pull_request) Has been skipped
Tofu providers / lock (pull_request) Successful in 3s
Fleet / align (pull_request) Successful in 9s
Suite default / scope (pull_request) Successful in 8s
Suite default / check-fetches (pull_request) Has been skipped
CI / suite-tests-windows (pull_request) Successful in 1m31s
CI / setup-windows (pull_request) Successful in 2m28s
CI / setup-linux (cluster) (pull_request) Successful in 49s
CI / service-runtime (two) (pull_request) Successful in 10s
CI / service-runtime (one) (pull_request) Successful in 56s
CI / manifest-check-linux (pull_request) Successful in 4s
Suite default / check-rules (pull_request) Successful in 10s
Suite default / check-logs (pull_request) Successful in 11s
CI / service-cancellation (pull_request) Successful in 23s
Suite default / reused-checks (pull_request) Successful in 9s
CI / suite-tests-linux (pull_request) Successful in 35s
merge-queue landed on main
58a2426f14
suites/decide.mjs decides, for a checkout at a change's head, its base and the repository's
topics, every suite's scope outputs and each check with its fingerprint, pass key, producer
and whether its inputs changed: no network, no token, no pass lookup. The scope job and
decide share one implementation (inputs.mjs suiteScope); the scope job still looks up passes
first (reuse.mjs), and check.mjs now takes its outputs from decide instead of a temporary
GITHUB_OUTPUT. Fingerprints, pass keys and producers move to fingerprints.mjs (checkEntries),
the fingerprint takes its repository as an argument, and the suites commit comes from one
place (lib.mjs suiteCommit): a published package's gitHead, else the checkout's HEAD.

The root package.json names @romaine-life/ci-suites: suites/ without tests and node_modules,
actions/ without tests, and .github/actionlint.yaml. publishPackage records the release's
commit as gitHead. pipeline-templates releases it through the release suite as a module
(ci-release, release-module, set in infra-bootstrap's list).

https://openproject.home.romaine.life/wp/MQ-5
merge-queue deleted branch ci-suites-decide 2026-12-01 00:09:03 -08:00
Sign in to join this conversation.
No description provided.