Repository navigation
[8.2] Use S3 conditional writes to prevent overwriting published artifacts - #11597
Conversation
…11532) sbin/upload-artifacts now uploads via `aws s3api put-object --if-none-match "*"` instead of `aws s3 cp`, and the release workflow's copy_object passes IfNoneMatch="*". Both fail loudly if an object already exists at the target key instead of silently overwriting it. upload-artifacts also propagates a rejected upload to the job exit status, which the `{ ...; } || ...` construct swallowed. (cherry picked from commit 046c693)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 77d93c5f60
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| try: | ||
| client.copy_object( | ||
| Bucket=bucket, Key=dst, CopySource={"Bucket": bucket, "Key": src}, | ||
| ACL="public-read", IfNoneMatch="*", |
There was a problem hiding this comment.
Use a supported destination precondition for copies
copy_object does not accept IfNoneMatch as a destination condition (its conditional parameters apply to the copy source, such as CopySourceIfNoneMatch), so boto3 parameter validation raises before any S3 request is made. Every release run that reaches this loop therefore fails to publish its versioned artifacts, irrespective of whether the destination key already exists.
Useful? React with 👍 / 👎.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 8.2 #11597 +/- ##
==========================================
- Coverage 89.09% 89.05% -0.04%
==========================================
Files 262 262
Lines 43225 43225
Branches 3851 3851
==========================================
- Hits 38510 38494 -16
- Misses 4666 4682 +16
Partials 49 49
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@AngelYanev this backport had cherry-pick conflicts that the backport agent resolved automatically. Could you please review the conflict resolution (see the conflict log in the PR description), and if everything looks OK, approve it? Auto-merge is enabled, so your approval will queue it for merge. Note: besides porting the conditional write, the agent also changed |



Backport of #11532 to
8.2.Original PR
046c693486a4a3c157a0f685cd299e4c448f98b9Cherry-pick result
Conflict Log
sbin/upload-artifactsRelease notes
🤖 Generated by the auto-backport workflow.