Backport Distribution Multipart Upload (Cloudflare R2) - #8
Open
constantins2001 wants to merge 3 commits into
Open
constantins2001 wants to merge 3 commits into
constantins2001 wants to merge 3 commits into
Conversation
Author
|
Using this in prod since a few months. Would like to switch back to upstream images and not maintain our own CI for it. |
Builds and pushes linux/amd64 image to ghcr.io on release branch pushes and manual workflow_dispatch triggers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Resumed non-aligned uploads can still produce unequal non-final parts that Cloudflare R2 rejects.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates S3 multipart buffering for Cloudflare R2 compatibility and adds GHCR publishing automation.
Changes:
- Uploads fixed-size multipart chunks while buffering the remainder.
- Adds release-branch image publishing to GHCR.
File summaries
| File | Description |
|---|---|
registry/storage/driver/s3-aws/s3.go |
Reworks multipart buffering and flushing. |
.github/workflows/publish-ghcr.yml |
Adds an automated GHCR publishing workflow. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1238
to
+1240
| // Upload chunks of exactly ChunkSize bytes (R2 requirement: all parts except last must be same size) | ||
| chunkSize := int(w.driver.ChunkSize) | ||
| for len(w.buffer) >= chunkSize { |
Comment on lines
+3
to
+7
| on: | ||
| push: | ||
| branches: | ||
| - 'release/*' | ||
| workflow_dispatch: |
Comment on lines
+1234
to
+1235
| // Append incoming data to buffer | ||
| w.buffer = append(w.buffer, p...) |
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.
This merge requests allows Distribution to upload to Cloudflare R2 (multipart).
Currently, this is broken as Cloudflare requires uniform sized chunks (except the last one). This wasn't given with the old code.