-
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(migrate): implement mutation batcher #5541
feat(migrate): implement mutation batcher #5541
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Full Report@sanity/migrate
@sanity/diff
@sanity/block-tools
@sanity/types
sanity/desk
@sanity/portable-text-editor
@sanity/mutator
@sanity/cli
@sanity/schema/_internal
@sanity/util/paths
sanity/router
@sanity/util/legacyDateFormat
@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 24, 2024 1:53 PM (UTC)
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
a81864b
to
7ca5626
Compare
c08e78f
to
f49ec7f
Compare
f49ec7f
to
707d6b7
Compare
7ca5626
to
173baba
Compare
expect(await it.next()).toEqual({value: [second], done: false}) | ||
expect(await it.next()).toEqual({value: undefined, done: true}) | ||
}) | ||
test('when each mutation is smaller then max batch size', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this read "bigger", instead of "smaller"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 🙈
707d6b7
to
cd86097
Compare
continue | ||
} | ||
|
||
// the mutation itself may exceed the payload size, need to handle that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we throw an error in this scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to try posting the mutation. The limits we currently have in the migraiton runner is quite conservative compared to the payload size accepted by the mutate endpoint (which is 4MB)
173baba
to
e8aba07
Compare
cd86097
to
2a5597f
Compare
0301e25
to
0bc11c0
Compare
334a881
to
5af81f4
Compare
5af81f4
to
0474ecf
Compare
…inst mutate endpoint
…ing against mutate endpoint
bbac6c9
to
0cb219a
Compare
Description
Implements mutation batcher. Given a set of mutations, it will try to batch them into arrays not exceeding the given byte size limit
What to review
Testing
Take a look at the tests in packages/@sanity/migrate/src/runner/utils/tests/batchMutations.test.ts
Notes for release
n/a