Skip to content

feat(sdk): add TailorDB migration rebaseline - #1990

Open
dqn wants to merge 11 commits into
mainfrom
feat/tailordb-migration-rebaseline
Open

feat(sdk): add TailorDB migration rebaseline#1990
dqn wants to merge 11 commits into
mainfrom
feat/tailordb-migration-rebaseline

Conversation

@dqn

@dqn dqn commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

TailorDB projects can safely collapse an applied migration history into a new baseline while preserving compatibility with existing v1 migration files.

Usage

tailor tailordb migration rebaseline --namespace <namespace>

Related CLI behavior

Command Behavior
tailor tailordb migration rebaseline Creates a new 0000 baseline and history generation.
tailor deploy Adopts that baseline only when the replaced history and remote schema match exactly.
tailor tailordb migration status Reports incompatible files and local/remote history mismatches.
tailor tailordb migration set / sync Keep the remote history generation aligned with the selected local checkpoint.
tailor tailordb migration generate / validate Write format v2 and enforce supported format versions.

Notes

  • Re-baselining removes numbered migration artifacts after 0000 from the working tree and resets the selected workspace checkpoint; every environment must be on the latest migration before it is re-baselined.
  • Existing format v1 files remain supported; unsupported versions fail with upgrade guidance.

@pkg-pr-new

pkg-pr-new Bot commented Aug 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tailor-platform/create-sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/create-sdk@75de129

@tailor-platform/eslint-plugin-sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/eslint-plugin-sdk@75de129

@tailor-platform/sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk@75de129

@tailor-platform/sdk-plugin-seed

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk-plugin-seed@75de129

@tailor-platform/sdk-plugin-tailordb-erd

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk-plugin-tailordb-erd@75de129

commit: 75de129

@github-actions

This comment has been minimized.

@dqn
dqn marked this pull request as ready for review August 5, 2026 14:36
@dqn
dqn requested a review from a team as a code owner August 5, 2026 14:36
@dqn
dqn requested a review from toiroakr August 5, 2026 14:37

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📖 Docs Quality & Consistency Check

✅ Docs are consistent with the implementation and contain no user-facing internal-detail leaks.

Checked areas:

  • New tailordb migration rebaseline command documentation in packages/sdk/docs/cli/tailordb.md and packages/sdk/docs/cli-reference.md
  • Migration rebaseline workflow documentation in packages/sdk/docs/services/tailordb-migration.md
  • Updated migration set and migration sync command documentation regarding history ID alignment
  • Updated migration status documentation regarding format version checking
  • Migration file format compatibility section
  • Error handling documentation for unsupported migration file versions

Verification performed:

  1. CLI command consistency: Verified the rebaseline command description, notes, and options match the command definition in packages/sdk/src/cli/commands/tailordb/migrate/rebaseline.ts (auto-generated via politty)
  2. Format version accuracy: Confirmed documentation states "writes format version 2 and reads versions 1 through 2" which matches implementation constants SCHEMA_SNAPSHOT_VERSION = 2 and MIN_SUPPORTED_MIGRATION_FILE_VERSION = 1
  3. Migration history ID: Verified this is an appropriate user-facing concept (stored in 0000/schema.json which users interact with, affects deployment behavior users must understand)
  4. Checkpoint repair mechanism: Confirmed the documented behavior of adopting a new baseline after rebaseline matches the implementation in schema-checks.ts
  5. Internal details: Verified no internal label names (e.g., sdk-migration-history), RPC/API names, module structure references, or transport-layer terminology leaked into user-facing docs
  6. Behavioral accuracy: Confirmed the rebaseline workflow description (validation → confirmation → file replacement → metadata update) matches the implementation flow

Re-run this check by adding the docs-check label to the PR.


The deploy confirmation and migration set prompts called the migration
history ID a "history generation", while the user-facing docs
consistently say "migration history ID". Align CLI output, JSDoc, and
test names with the documented term.
@dqn dqn added the docs-check Trigger Docs Consistency Check label Aug 5, 2026
@changeset-bot

changeset-bot Bot commented Aug 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 75de129

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@tailor-platform/sdk Minor
@tailor-platform/sdk-plugin-seed Major
@tailor-platform/sdk-plugin-tailordb-erd Major
@tailor-platform/create-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (6396b4d) #1990 (b71a7e5) +/-
Coverage 78.5% 78.7% +0.2%
Code to Test Ratio 1:0.4 1:0.4 +0.0
Details
  |                    | main (6396b4d) | #1990 (b71a7e5) |  +/-  |
  |--------------------|----------------|-----------------|-------|
+ | Coverage           |          78.5% |           78.7% | +0.2% |
  |   Files            |            463 |             465 |    +2 |
  |   Lines            |          17768 |           18038 |  +270 |
+ |   Covered          |          13956 |           14208 |  +252 |
+ | Code to Test Ratio |          1:0.4 |           1:0.4 |  +0.0 |
  |   Code             |         126901 |          129054 | +2153 |
+ |   Test             |          62068 |           63484 | +1416 |

Code coverage of files in pull request scope (86.7% → 87.3%)

Files Coverage +/- Status
packages/sdk/src/cli/commands/deploy/confirm.ts 81.6% +2.5% modified
packages/sdk/src/cli/commands/deploy/deploy.ts 92.9% +0.0% modified
packages/sdk/src/cli/commands/deploy/tailordb/index.ts 87.6% +0.2% modified
packages/sdk/src/cli/commands/deploy/tailordb/migration.ts 91.3% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/config.ts 95.8% +4.1% affected
packages/sdk/src/cli/commands/tailordb/migrate/diff-calculator.ts 73.1% +0.2% modified
packages/sdk/src/cli/commands/tailordb/migrate/file-state.ts 80.6% +80.6% added
packages/sdk/src/cli/commands/tailordb/migrate/index.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/rebaseline.ts 92.6% +92.6% added
packages/sdk/src/cli/commands/tailordb/migrate/remote-state.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/schema-checks.ts 96.6% +0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/set.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/snapshot-schema.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/snapshot-types.ts 100.0% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/snapshot.ts 81.1% +0.1% modified
packages/sdk/src/cli/commands/tailordb/migrate/status.ts 81.3% +11.9% modified
packages/sdk/src/cli/commands/tailordb/migrate/sync.ts 92.4% 0.0% modified
packages/sdk/src/cli/commands/tailordb/migrate/types.ts 73.9% +5.4% modified
packages/sdk/src/cli/commands/tailordb/migrate/validate.ts 86.2% -0.6% modified
packages/sdk/src/cli/shared/errors.ts 90.0% +3.3% modified

SDK Configure Bundle Size

main (6396b4d) #1990 (b71a7e5) +/-
configure-index-size 39.25KB 39.25KB 0KB
dependency-chunks-size 24.96KB 24.96KB 0KB
total-bundle-size 64.22KB 64.22KB 0KB

Runtime Performance

main (6396b4d) #1990 (b71a7e5) +/-
Generate Median 2,379ms 2,367ms -12ms
Generate Max 2,429ms 2,416ms -13ms
Apply Build Median 2,409ms 2,443ms 34ms
Apply Build Max 2,436ms 2,471ms 35ms

Type Performance (instantiations)

main (6396b4d) #1990 (b71a7e5) +/-
tailordb-basic 40,450 40,450 0
tailordb-optional 4,535 4,535 0
tailordb-relation 3,854 3,854 0
tailordb-validate 666 666 0
tailordb-hooks 5,499 5,499 0
tailordb-object 16,345 16,345 0
tailordb-enum 1,538 1,538 0
resolver-basic 12,120 12,120 0
resolver-nested 35,419 35,419 0
resolver-array 24,056 24,056 0
executor-schedule 4,489 4,489 0
executor-webhook 1,130 1,130 0
executor-record 4,542 4,542 0
executor-resolver 5,808 5,808 0
executor-operation-function 1,118 1,118 0
executor-operation-gql 1,126 1,126 0
executor-operation-webhook 1,137 1,137 0
executor-operation-workflow 1,931 1,931 0

Reported by octocov

@github-actions github-actions Bot removed the docs-check Trigger Docs Consistency Check label Aug 5, 2026
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