-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(migration): support async hooks in migration nodes #5564
Merged
+23
−19
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
This was referenced Jan 25, 2024
Merged
Full Report@sanity/migrate
@sanity/diff
@sanity/block-tools
@sanity/types
sanity/desk
@sanity/portable-text-editor
@sanity/mutator
@sanity/cli
@sanity/util/legacyDateFormat
@sanity/schema/_internal
@sanity/util/paths
sanity/router
@sanity/schema
sanity/structure
sanity/cli
@sanity/vision
@sanity/util/fs
sanity/_internal
@sanity/util/createSafeJsonParser
sanity/_internalBrowser
@sanity/util/content
sanity
|
Component Testing Report Updated Jan 29, 2024 3:18 PM (UTC)
|
This was referenced Jan 25, 2024
bjoerge
force-pushed
the
feat/migration-runner
branch
from
January 26, 2024 11:15
25e1c4e
to
a58394c
Compare
binoy14
force-pushed
the
feat/migration-runner
branch
from
January 26, 2024 15:29
a58394c
to
1a663f3
Compare
bjoerge
force-pushed
the
feat/migration-runner
branch
from
January 26, 2024 15:43
1a663f3
to
efabcf9
Compare
bjoerge
force-pushed
the
feat/migration-runner
branch
from
January 26, 2024 15:52
efabcf9
to
b60c02d
Compare
binoy14
requested review from
jtpetty and
bjoerge
and removed request for
a team
January 29, 2024 15:12
bjoerge
approved these changes
Jan 29, 2024
jtpetty
approved these changes
Jan 29, 2024
bjoerge
pushed a commit
that referenced
this pull request
Jan 29, 2024
bjoerge
pushed a commit
that referenced
this pull request
Jan 29, 2024
bjoerge
pushed a commit
that referenced
this pull request
Jan 29, 2024
bjoerge
pushed a commit
that referenced
this pull request
Jan 30, 2024
github-merge-queue bot
pushed a commit
that referenced
this pull request
Jan 30, 2024
* feat(migrate): move into monorepo from poc * test(migrate): make sure uint8array-extras package gets transpiled from esm * feat(cli): scaffold create/run migration cli commands * fix(migrate): inline functions from uint8array-extras for now Can't be imported from package because of ESM * feat: basic migration cli support * feat: basic `migrations list` command * feat: migration create command w/templates * feat(sanity): add exports for sanity/migrate + sanity/migrate/mutations * chore(migrate): add test script * test(migrate): add tests for `parseJSON` * feat(migrate): add customisable parser and iterator type to `parseJSON` * feat(migrate): add JSON parser that can handle chunks interrupted by an error object * refactor(migrate): rename targets => destinations * feat(migrate): use safe JSON parser when streaming from Export HTTP API (#5542) * refactor(util): create shared JSON parser for `@sanity/export` and `@sanity/migrate` * feat(migrate): add safe JSON parser * chore(util): update comment * chore(export): update comment * feat(migrate): use safe JSON parser when streaming from Export HTTP API * feat(migrate): add JSON options and type parameter to NDJSON utility * refactor(migrate): use type parameter * fix(migrate): add missing export * fix(util): fix package.json formatting * feat(migrate): implement mutation batcher and use when submitting against mutate endpoint * feat(migrate): limit request concurrency * fix(migrate): workaround issue with p-map and ESM * feat(cli): allow user provided concurrency * feat(migration): improve progress as migration is running (#5550) * feat(migration): add a prompt before runing a real migration (#5552) ### Description <!-- What changes are introduced? Why are these changes introduced? What issue(s) does this solve? (with link, if possible) --> Adds a prompt before running a real migration with the projectId and dataset so the user is aware and intentionally selects running a real migration ### What to review <!-- What steps should the reviewer take in order to review? What parts/flows of the application/packages/tooling is affected? --> `sanity migration run <name-of-migration> --dry=false` should show a prompt like "This migration will run on the “test” dataset in “yajkdsl” project. Are you sure?" ### Testing <!-- Did you add sufficient testing for this change? If not, please explain how you tested this change and why it was not possible/practical for writing an automated test --> ### Notes for release <!-- A description of the change(s) that should be used in the release notes. --> - N/A * feat(migration): support passing an array of documentTypes to migration (#5566) * chore(migration): add better error message when request fails (#5567) * chore(migration): add better error message when request fails * fix(migration): add error message if json parsing fails * feat(migrate): add asyncIterableToStream util * feat(migrate): add bufferThroughFile utility * fix(migrate): buffer exports through file * fix(cli): use dryRun from @sanity/migrate * refactor(migrate): rename function * refactor(migrate): add ndjson support for both parsing and stringifying in ndjson util * refactor(sanity): remove mutiny dependency in favor of inlined creators * fix(sanity): add --no-progress flag * fix(migrate): simplify bufferThroughFile * feat(migrate): unify contexts, add support for document lookup and query during a migration * fix(dev): fix example migration script imports * feat(migration): support async hooks in migration nodes (#5564) * fix(sanity): use --no-dry instead of --dry=false * feat(migrate): add support for yielding transactions * fix(migrate): minor typing issue * fix(sanity): polish cli and migration templates * chore(deps): remove unused deps * fix(sanity): fix quoting of documentTypes in migration templates * fix(sanity): rename migration name => title * fix(migrate): run migration against all documents if documentTypes is omitted * fix(migration): fixes dry run not showing any information * fix(migration): show proper error message when the file has code issues * fix(migrate): various naming consistency fixes * fix(sanity): add a few examples to help text for 'sanity migration create' * fix(sanity): improve error handling on 'sanity migration run' without id * fix(migrate): fix error asserting transaction * fix(migrate): use transactionId instead of id on mutation payload * feat(cli): add pretty mutation formatting to migration runner (#5573) * feat(cli): add pretty mutation formatting to migration runner * feat(cli): improve formatting * feat(cli): add indent option to `prettyFormatMutation` * feat(cli): support indentation when printing JSON * feat(cli): support migrations for multiple document types * feat(cli): improve dry run migration formatting * refactor(cli): abstract tree reporter * chore(cli): remove unused import * fix(cli): add missing closing parenthesis * feat(cli): add migration dry-run output * feat(cli): underline document id when pretty formatting mutation * feat(cli): add transaction support to pretty formatter * feat(cli): add transaction support to pretty mutation formatter * refactor(cli): reduce complexity * feat(cli): pretty format mutations when committing migration * chore(migrate): instrument with some debug logging * refactor(migration): move filtered document methods to a separate `filtered`-context key, add a client with limited concurrency to migration context * fix(migrate): add request tags and user agent * fix(sanity): improve minimal example --------- Co-authored-by: Ash <[email protected]> Co-authored-by: Binoy Patel <[email protected]>
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.
Description
Adds support for async hooks in migration nodes for instance you can do the following thing
What to review
If everything still works
Testing
normalizeMigrateDefinition
Notes for release
N/A