fix(serverless): cap a source archive at the API's 10 MiB limit - #126
Conversation
The packer allowed 25 MiB, then the upload failed once the archive was past declaredByteLength's maximum of 10485760 bytes.
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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
left a comment
There was a problem hiding this comment.
Checked the new zip cap with a random tree and a compressible one, both behave as expected now. Thanks!
Summary
SourceUploadCreate.declaredByteLength(maximum 10485760).Test plan
go test ./internal/cmd/serverless/ -run 'PackDirectory_TotalTooLarge|PackDirectory_FileTooLarge'