Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
📝 WalkthroughWalkthroughThis change adds file size calculation using Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
|
@cursor review |
Summary
ContentLengthparameter usingfs.statSync()which follows symlinkslstatSyncreturning symlink size instead of target file sizeRoot cause
AWS SDK v3's
@aws-sdk/lib-storageuseslstatSyncto determine file size for multipart uploads. When the serverless-python-requirements plugin creates a symlink to cachedpythonRequirements.zip,lstatSyncreturns the symlink size (~126 bytes) instead of the actual file size (~40MB), causing a mismatch between expected and actual upload parts.Test plan
statSyncandlstatSyncreturn same size for regular files (no regression)ContentLengthsimple-nodejsintegration testRelated
Summary by CodeRabbit
Note
Medium Risk
Moderate risk because it changes S3 upload request parameters in the deploy path; incorrect size calculation could cause upload failures or unexpected multipart behavior, especially for large artifacts and symlinks.
Overview
Ensures deployment zip uploads to S3 explicitly include
ContentLength, computed from the bytes read viafs.readFileSync, to avoid AWS SDK v3 multipart upload part-count mismatches when the artifact path is a symlink.Adds inline documentation explaining the symlink/lstat behavior and why
ContentLengthmust be provided.Written by Cursor Bugbot for commit 8037211. This will update automatically on new commits. Configure here.