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

Fix potential zip upload error when deduping files on a very large Storybook #892

Conversation

ghengeveld
Copy link
Member

@ghengeveld ghengeveld commented Jan 17, 2024

When publishing a Storybook with > 1000 files, the processing happens in batches. When using the zip option, each batch returns a zipTarget. However, if there are no files to upload for a batch, zipTarget will be undefined. Previously the CLI would use whatever zipTarget was returned last, even if that zipTarget is undefined. In this case, the CLI falls back to uploading individual files, but the sentinelUrl for unpacking the zip file will still be present and the CLI will wait for the unpack that will never happen, eventually timing out with a failed build.

This PR fixes the zipTarget by ignoring batches that have no zipTarget. Additionally, it deduplicates sentinelUrls because each batch returns the same basic sentinelUrl, with only a deviating query param (signature). We only really need to await one of them. Also, logging is improved to clarify which type of sentinel file we're dealing with (files-copied or zip-unpacked).

📦 Published PR as canary version: 10.3.2--canary.892.7557813674.0

✨ Test out this PR locally via:

npm install [email protected]
# or 
yarn add [email protected]

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.

LGTM👍🏻

@ghengeveld ghengeveld added release Auto: Create a `latest` release when merged patch Auto: Increment the patch version when merged labels Jan 17, 2024
@ghengeveld ghengeveld changed the title Fix potential zip upload error when deduping files on a very large Storybook (>1000 files) Fix potential zip upload error when deduping files on a very large Storybook Jan 17, 2024
@ghengeveld ghengeveld added the bug Classification: Something isn't working label Jan 17, 2024
@ghengeveld ghengeveld added this pull request to the merge queue Jan 17, 2024
Merged via the queue into main with commit 4b05f7e Jan 17, 2024
24 of 26 checks passed
@ghengeveld ghengeveld deleted the ghengeveld/ap-4055-zip-upload-can-fail-when-uploading-multiple-batches-and branch January 17, 2024 15:12
@ghengeveld
Copy link
Member Author

🚀 PR was released in v10.3.1 🚀

@ghengeveld ghengeveld added the released Verdict: This issue/pull request has been released label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Classification: Something isn't working patch Auto: Increment the patch version when merged release Auto: Create a `latest` release when merged released Verdict: This issue/pull request has been released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants