Merge R2 upload & multipart docs#28186
Conversation
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
|
This PR requires additional review attention because it affects the following areas: RedirectsThis PR changes current filenames or deletes current files. Make sure you have redirects set up to cover the following paths:
PartialsThis PR updates partial files, which are pieces of content used across multiple files in our Render component.
|
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
- Add error handling (try/catch) to Workers single upload example - Handle null return from put() (precondition failure) - Define placeholder variables in Workers multipart example (was using undefined vars) - Wrap Workers presigned URL in a proper fetch handler with env secrets - Remove unused ctx parameter from all Workers examples - Wrap abort calls in try/catch in manual multipart examples (TS/JS/Python) to avoid masking the original error - Fix progress.total potentially undefined in auto multipart upload - Add console.log/print output to S3 examples for copy-paste clarity - Remove unnecessary Buffer type annotation in TS single upload
|
Here's a summary of my rigorous review and the fixes I applied: Code review summaryI reviewed all 8 code examples (12 language variants total) against the criteria: concise, safe to copy+paste, error handling, and best practices. Issues found and fixed
What was already good
Remaining notes (no fix needed)
|
Co-authored-by: elithrar <elithrar@users.noreply.github.com>
|
Here's a summary of the changes: Converted all 4 Workers API code blocks to use
Each bare The S3 API section examples were intentionally left as manual Note: A full build couldn't run in this CI environment due to a Node.js version mismatch (requires Node 22.x, has 20.x), but the changes follow the exact same pattern used across 100+ other MDX files in the codebase. |
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
|
/bonk run a final review and ensure all code examples meet our bar. |
Final review: All code examples meet the barI reviewed all 12 code examples (8 blocks, 12 language variants) across the file plus the surrounding infrastructure (redirects, links, components). Here's the summary: Code examples -- all pass
Infrastructure -- all pass
No changes neededAll examples are correct, safe to copy-paste, handle errors properly, and follow best practices for their respective languages/SDKs. The previous review rounds caught and fixed the real issues (undefined variables, hardcoded credentials, missing error handling). This PR is in good shape. |
All tasks are complete. Here's a summary of everything done:
Changes summary
Consolidated upload docs into a single page (
/r2/objects/upload-objects/)Restructured
src/content/docs/r2/objects/upload-objects.mdxfrom a basic upload page into a comprehensive upload guide that merges content from the oldmultipart-objects.mdxpage:put()example with httpMetadatacreateMultipartUpload()/uploadPart()/complete()/abort()lifecycleaws4fetch(Workers-compatible)PutObjectCommand/put_object)@aws-sdk/lib-storage Upload/upload_file)CreateMultipartUpload/UploadPart/CompleteMultipartUploadwith proper abort-on-error)getSignedUrl/generate_presigned_url)Deleted
src/content/docs/r2/objects/multipart-objects.mdxUpdated
public/__redirects/r2/objects/multipart-objects/ /r2/objects/upload-objects/ 301Updated 3 files with internal links
src/content/release-notes/r2.yaml- Updated multipart ETags linksrc/content/partials/r2/migrator-etag-caveat.mdx- Updated ETag calculation linksrc/content/docs/r2/api/error-codes.mdx- Updated multipart upload linkCloses #28184
github run