Repository navigation
fix(build): allow 100 MiB prototype static files - #329
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent previews of 100 MiB assets can exhaust the default 1 GiB container and restart the API and both workers because files remain buffered without a shared memory budget.
2 open issues
What changed in this PR
Allows prototypes with large runtime data assets to use the shared build action and Hub’s import, storage, and preview paths without removing needed files.
Changes:
- Raises static-file and storage-object limits to 100 MiB while preserving aggregate, screenshot, and archive limits.
- Avoids redundant copies in filesystem reads, immutable import retries, and ZIP fixtures.
- Adds boundary and package-to-preview regression coverage, plus memory and rollout guidance.
Rollout requires updated Hub code and downstream action pins. Live Azure transfer and hosted import remain unverified.
| File | Description |
|---|---|
hub/server/test/create-zip-archive/index.ts |
Reuses Buffer inputs in ZIP fixtures. |
hub/server/routes/build-preview/serve/get/index.test.ts |
Covers packaging, import, immutable Azure storage, and 100 MiB serving. |
hub/server/integrations/filesystem/create-filesystem-artifact-storage/index.ts |
Returns a byte view without copying. |
hub/server/domains/github-builds/store-github-build-files/index.ts |
Compares immutable artifact bytes without copying. |
hub/server/domains/build-artifacts/extract-dist-package/index.test.ts |
Checks rejection above 100 MiB. |
hub/server/domains/build-artifacts/constants.ts |
Raises Hub’s static-file limit. |
hub/server/domains/artifacts/create-artifact-storage/index.ts |
Raises the storage-object limit. |
hub/server/domains/artifacts/create-artifact-storage/index.test.ts |
Updates storage boundary coverage. |
hub/docs/github-actions-builds.md |
Documents limits, memory needs, and rollout requirements. |
hub/docs/artifact-storage.md |
Updates the storage read/write contract. |
actions/build/scripts/validate-build-output/index.test.mjs |
Covers per-file and aggregate size boundaries. |
actions/build/scripts/constants.mjs |
Raises the shared action’s static-file limit. |
Review effort: Max (adaptive)
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.


Why
Some prototypes need large runtime data files. Publishing currently rejects files above 25 MiB, and Hub storage rejects objects above 32 MiB. Users should not have to delete needed data to publish a prototype.
What changes
Allow static files and stored objects up to 100 MiB (104,857,600 bytes) across publishing, screenshot-job input validation, Hub import, storage reads and writes, and preview serving. The total uncompressed
dist/budget stays at 100 MiB, so a separate data file must leave room forindex.htmland the rest of the app. Screenshots remain limited to 25 MiB each, extracted packages to 150 MiB, and downloaded ZIPs to 160 MiB. Path, entry-count, archive, and immutable-Build safeguards stay in place.Import and serving still buffer files in memory rather than stream them. Preview requests share a 100 MiB source-byte allowance per API process across Build origins and access types. Hub reserves capacity before storage reads and returns 503 when full. Reservations are released only after the read settles and the response finishes or disconnects. Small files reserve at least 64 KiB. Temporary template-manifest reads release their capacity before loading the selected HTML file.
Filesystem reads and immutable import retries avoid redundant full-file copies. The preview allowance bounds concurrent response buffers, not total process memory: Azure downloads and HTML bridge injection need additional memory, as do imports. Keep the default on-demand worker concurrency of one on the 1 GiB Azure runtime; additional import workers need more capacity. Regression coverage uses generated files and replaces only the Azure SDK boundary in the package-to-preview byte pipeline. Live Azure transfer and hosted import remain unverified.
Hub must run the new code, and downstream workflows must update their publish, screenshots, and optional build actions to the same reviewed revision containing this change. Older action pins retain their old limits. This PR targets
build/hub/new; it does not deploy Hub, update downstream repositories, or modify existing successful Builds.