feat(sdk): add tailordb migration sync subcommand#1183
Draft
toiroakr wants to merge 1 commit into
Draft
Conversation
Add `tailor-sdk tailordb migration sync <number>`. The new subcommand reconstructs the TailorDB schema snapshot at the given migration number (e.g. `0` for the baseline) and brings the remote in line with it without requiring a `git checkout`. Useful for recovering from drift introduced by an unintended `deploy --no-schema-check`. After syncing, run `tailor-sdk deploy` to catch up the remaining migrations from the working tree.
🦋 Changeset detectedLatest commit: 0123147 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
⚡ pkg.pr.new@tailor-platform/sdk@tailor-platform/create-sdk
|
Code Metrics Report (packages/sdk)
Details | | main (0cee9fb) | #1183 (fa6437f) | +/- |
|--------------------|----------------|-----------------|-------|
- | Coverage | 61.8% | 61.4% | -0.4% |
| Files | 362 | 363 | +1 |
| Lines | 12638 | 12720 | +82 |
+ | Covered | 7818 | 7819 | +1 |
- | Code to Test Ratio | 1:0.4 | 1:0.4 | -0.1 |
| Code | 82717 | 82962 | +245 |
+ | Test | 34475 | 34490 | +15 |Code coverage of files in pull request scope (100.0% → 2.4%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
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.
Summary
tailor-sdk tailordb migration sync <number>. The subcommand reconstructs the TailorDB schema snapshot at the given migration number (0for the baseline, etc.) from the working tree'stailordb-migrations/<namespace>/{0000/schema.json + NNNN/diff.json...}and pushes it to the remote, then sets thesdk-migration: mNNNNlabel to that number.deploy --no-schema-checkleaves the remote schema out of sync with its migration label (a possibility this PR doesn't address; see PR fix(sdk): reconcile TailorDB migration label after deploy --no-schema-check #1179 for the prevention side), runningsync <N>reconstructs and applies the snapshot forNwithout requiring agit checkout. A subsequenttailor-sdk deploycatches up the remaining migrations from the working tree.deploy: shows aPlan: X to create, Y to update, Z to deletepreview and prompts unless--yes.packages/sdk/docs/cli/tailordb.md+packages/sdk/docs/cli-reference.mdviapnpm docs:update; thesyncblock sits under the existingtailordb migrationsection.syncCommandCLI shape tests inmigrate/cli.test.ts(subcommand registration + args schema).Notes
--catchupflag. The natural recovery flow issync <N>→deploy, which keeps both code paths simple.