Repository navigation
feat(db-migrate): buildFilter names the package the runner is built from (0.22.0) - #23
Merged
Merged
Conversation
…rom (0.22.0)
db-migrate built @saas/db unconditionally, and its closed parameter schema
had no way to say otherwise. A product whose migration ladder lives in
another package (pullely/openproduct keeps it in @openproduct/db) could
not use the composition: the build step would build @saas/db and go
green, and the apply step would then fail with MODULE_NOT_FOUND for a
dist that was never built.
- schema.yaml declares an optional string buildFilter (minLength 1,
default @saas/db).
- The build step renders
--filter={{if .parameters.buildFilter}}{{.parameters.buildFilter}}{{else}}@saas/db{{end}}.
orun does not copy schema defaults into .parameters, so the else branch
is the default. A component that leaves the parameter out renders the
exact 0.21.0 command.
- tests/smoke/component.yaml is a fixture adapted from a real consumer:
its own db package and migrations two levels below it.
- verify.sh stage 8 plans that fixture and a component without the
parameter through the packed artifact, on stage and prod. It requires
every build step to render exactly the declared filter and exactly the
0.21.0 command respectively. A guard on .parameters.buildfilter, which
stage 2's lint cannot see, fails it.
- The composition README documents the parameter and drops the stale AWS
OIDC sentence; docs/verification.md, README and roadmap follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
db-migratebuilds@saas/dbunconditionally (pnpm exec turbo run build --filter=@saas/db), and its parameter schema is closed, so a consumer cannot name another package.pullely/openproductkeeps its migration ladder in@openproduct/db(packages/db, runner atpackages/db/dist/runner/cli.js) and cannot use the composition until the filter is configurable.This parameter fails silently when it is wrong. The build step builds whatever the filter names and goes green. The apply step then fails with
MODULE_NOT_FOUNDfor adistthat was never built. orun-cloud's vendored copy of this composition shipped the same parameter with its guard on.buildFilterinstead of.parameters.buildFilter, and it did nothing for weeks before anyone noticed. So this PR proves the rendered command, not only that the composition loads.What
schema.yaml: optional stringbuildFilter(minLength: 1,default: "@saas/db").jobs/db-migrate-run.yaml: the build step renders--filter={{if .parameters.buildFilter}}{{.parameters.buildFilter}}{{else}}@saas/db{{end}}. The guard and the value read the same key. orun does not copy a schema'sdefaultinto.parameters, so theelsebranch is what supplies the default.tests/smoke/component.yaml: a fixture adapted from a real consumer. It has its own db package and its migrations two levels below it.scripts/verify.shstage 8: plans that fixture and a component withoutbuildFilterthrough the packed artifact, on stage and prod. Every build step must render exactlypnpm exec turbo run build --filter=@example/dbfor the fixture, and exactly the 0.21.0 commandpnpm exec turbo run build --filter=@saas/dbfor the other.docs/verification.md, the README fixture count and the roadmap are updated to match.stack.yaml: 0.21.0 → 0.22.0.Verification
Run locally with orun 2.96.0 (built from the
v2.96.0tag):./scripts/verify.shpasses all eight stages.Each of these broken variants fails the gate:
.parameters.buildfilter(wrong case)--filter=@saas/db. Stage 2's lint cannot see this one..buildFilter(root key, the orun-cloud bug)@saas/dbwith the schema still accepting the parameter@saas/db-migrationsbuildFilter)additionalProperties 'buildFilter' not allowedA lumen-shaped component (no
buildFilter, withowner/repo) was planned through packed v0.21.0 and through this branch, on both the plan profile and--trigger github-push-main(apply). Every job'sprofile,path,parameters,runsOn,timeoutandstepsare byte-identical.buildFilter: ""is rejected at plan time (minLength). It does not quietly fall back to@saas/db.Consumer impact
Additive. A component that does not set
buildFilterplans exactly as on 0.21.0. Consumers pin exact versions, so nothing changes until a pin moves. On 0.21.0, a component that setsbuildFilterfails schema validation. It does not build the wrong package.🤖 Generated with Claude Code