CI decides a change's checks in one pass, released as the versioned package @romaine-life/ci-suites (MQ-9) #340
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/pipeline-templates!340
Loading…
Reference in a new issue
No description provided.
Delete branch "ci-suites-decide"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 andpull-request checkcan pin a version instead of reading main. Released by this repository's newci-release+release-moduletopics (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"}}}}}fordefaultplus everyci-suite in the topics. No network, no token, no pass lookup; refuses a checkout whose HEAD isn'theador that isn't the checkout's top; one decision per process at a time (it changes directory).package.jsonnaming@romaine-life/ci-suites:suites/andactions/without tests or node_modules, and.github/actionlint.yaml.publishPackagerecords the release commit asgitHead;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 onesuiteScope(...)shared by the CI scope job (scope(), which still looks passes up first) anddecide;testJobsstays the one test-platform rule inside it.check.mjstakes its outputs fromdecideinstead of a temporaryGITHUB_OUTPUT.cacheKey,producerand newcheckEntriesmove tofingerprints.mjs(re-exported byreuse.mjs);fingerprint()takes the repository as an argument.go/group.mjsreadssuiteCommit().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-linuxfor suites without their own tests); no job conditioned on those keys exists. One real regression found and fixed on the way (tofu applywas 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