Skip to content

feat(db-migrate): buildFilter names the package the runner is built from (0.22.0) - #23

Merged
pullely merged 1 commit into
mainfrom
claude/db-migrate-build-filter
Nov 11, 2026
Merged

pullely merged 1 commit into
mainfrom
claude/db-migrate-build-filter

Conversation

@pullely

@pullely pullely commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Why

db-migrate builds @saas/db unconditionally (pnpm exec turbo run build --filter=@saas/db), and its parameter schema is closed, so a consumer cannot name another package. pullely/openproduct keeps its migration ladder in @openproduct/db (packages/db, runner at packages/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_FOUND for a dist that was never built. orun-cloud's vendored copy of this composition shipped the same parameter with its guard on .buildFilter instead 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 string buildFilter (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's default into .parameters, so the else branch 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.sh stage 8: plans that fixture and a component without buildFilter through the packed artifact, on stage and prod. Every build step must render exactly pnpm exec turbo run build --filter=@example/db for the fixture, and exactly the 0.21.0 command pnpm exec turbo run build --filter=@saas/db for the other.
  • The composition README documents the parameter and drops a stale sentence about assuming an AWS OIDC role (the job has no AWS step since 0.17.0). 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.0 tag):

  • ./scripts/verify.sh passes all eight stages.

  • Each of these broken variants fails the gate:

    Variant Fails at
    guard on .parameters.buildfilter (wrong case) stage 8: the fixture renders --filter=@saas/db. Stage 2's lint cannot see this one.
    guard on .buildFilter (root key, the orun-cloud bug) stage 2: the guard lint
    value hard-coded to @saas/db with the schema still accepting the parameter stage 8
    default drifted to @saas/db-migrations stage 8: the default component
    the 0.21.0 schema (no buildFilter) plan: additionalProperties 'buildFilter' not allowed
  • A lumen-shaped component (no buildFilter, with owner/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's profile, path, parameters, runsOn, timeout and steps are 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 buildFilter plans exactly as on 0.21.0. Consumers pin exact versions, so nothing changes until a pin moves. On 0.21.0, a component that sets buildFilter fails schema validation. It does not build the wrong package.

🤖 Generated with Claude Code

…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>
@pullely
pullely merged commit d1f9d12 into main Nov 11, 2026
3 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.

2 participants