Skip to content

fix(serverless): cap a source archive at the API's 10 MiB limit - #126

Merged
Ryank90 merged 2 commits into
rc/serverlessfrom
fix/serverless-pack-limit
Sep 24, 2026
Merged

Ryank90 merged 2 commits into
rc/serverlessfrom
fix/serverless-pack-limit

Conversation

@Ryank90

@Ryank90 Ryank90 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Lower the source-archive cap from 25 MiB to 10 MiB so packing fails locally when the archive would be rejected by SourceUploadCreate.declaredByteLength (maximum 10485760).

Test plan

  • go test ./internal/cmd/serverless/ -run 'PackDirectory_TotalTooLarge|PackDirectory_FileTooLarge'
  • A tree between 10 and 25 MiB is rejected before upload, and the error names the 10 MiB limit

The packer allowed 25 MiB, then the upload failed once the archive was
past declaredByteLength's maximum of 10485760 bytes.
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include coderabbit-review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 12eb3dd1-637c-4264-9bb7-0dd788ddc2ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread internal/cmd/serverless/pack.go Outdated
declaredByteLength is the compressed archive, not the uncompressed tree. The walk still bounds memory at 25 MiB; the zip is checked after it is closed.

@wilsonsilva wilsonsilva left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checked the new zip cap with a random tree and a compressible one, both behave as expected now. Thanks!

@Ryank90
Ryank90 merged commit 2fe44fa into rc/serverless Sep 24, 2026
4 checks passed
@Ryank90
Ryank90 deleted the fix/serverless-pack-limit branch September 24, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants