Skip to content
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

Replace upload mechanism to use a batched mutation with a new API #888

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Jan 12, 2024

This reintroduces the uploadBuild mutation after it was reverted. It's now limited to sending 1000 files at a time in order to prevent issues with request/response payload size and/or memory limits. To accommodate that constraint, files are now batched in chunks of 1000 and uploadBuild runs in a loop.

Because S3 does not support uploading empty files directly, those are skipped and a warning is printed. The zip option can be used to work around this limitation.

The new uploadBuild mutation provides a more flexible API so it can support file deduplication.

Depends on https://github.com/chromaui/chromatic/pull/8134

📦 Published PR as canary version: 10.2.3--canary.888.7540838602.0

✨ Test out this PR locally via:

npm install chromatic@10.2.3--canary.888.7540838602.0
# or 
yarn add chromatic@10.2.3--canary.888.7540838602.0

@ghengeveld ghengeveld added the minor Auto: Increment the minor version when merged label Jan 12, 2024
Copy link
Contributor

@JonathanKolnik JonathanKolnik left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@andrewortwein andrewortwein left a comment

Choose a reason for hiding this comment

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

👍🏻👍🏻

@ghengeveld ghengeveld added the skip-release Auto: Preserve the current version when merged label Jan 15, 2024
…-thousands-of-files' into ghengeveld/ap-3912-index-update-cli-to-wait-for-copy-job-using-sentinel-file
@ghengeveld ghengeveld changed the title Reintroduce uploadBuild mutation, running in batches Replace upload mechanism to use a batched mutation with a more flexible API and enforce some constraints Jan 16, 2024
@ghengeveld ghengeveld changed the title Replace upload mechanism to use a batched mutation with a more flexible API and enforce some constraints Replace upload mechanism to use a batched mutation with a more flexible API Jan 16, 2024
@ghengeveld ghengeveld changed the title Replace upload mechanism to use a batched mutation with a more flexible API Replace upload mechanism to use a batched mutation with a new API Jan 16, 2024
…-cli-to-wait-for-copy-job-using-sentinel-file

Retrieve `sentinelUrls` from `uploadBuild` and wait for all of them before finishing upload task
@ghengeveld ghengeveld added this pull request to the merge queue Jan 16, 2024
Merged via the queue into main with commit 461dc9d Jan 16, 2024
19 checks passed
@ghengeveld ghengeveld deleted the ghengeveld/ap-4034-batch-file-upload-requests-to-handle-thousands-of-files branch January 16, 2024 12:28
@ghengeveld
Copy link
Member Author

🚀 PR was released in v10.3.0 🚀

@ghengeveld ghengeveld added the released Verdict: This issue/pull request has been released label Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Auto: Increment the minor version when merged released Verdict: This issue/pull request has been released skip-release Auto: Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants