Repository navigation
[8.8] Use S3 conditional writes to prevent overwriting published artifacts - #11594
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: 6cc2f56ba6
ℹ️ 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 an S3 copy API that supports destination preconditions
IfNoneMatch is not a valid boto3 copy_object parameter (the copy API only exposes CopySourceIfNoneMatch, which conditions the source). Botocore validates parameters before sending the request and raises ParamValidationError, not ClientError, so every set-artifacts release job fails on its first artifact instead of publishing release artifacts. Use a destination-conditional copy mechanism supported by S3 rather than passing this unsupported argument.
Useful? React with 👍 / 👎.
| client.copy_object( | ||
| Bucket=bucket, Key=dst, CopySource={"Bucket": bucket, "Key": src}, | ||
| ACL="public-read", IfNoneMatch="*", | ||
| ) |
There was a problem hiding this comment.
Make multi-artifact publication restartable
If one copy succeeds and a later copy fails (for example, due to a transient S3 error or a cancelled job), this sequential loop leaves a partially published release. A retry for the same tag computes the same destinations, then the first already-published artifact fails the conditional write and prevents the remaining artifacts from being copied. Preflight the complete destination set or allow verified identical artifacts to be treated as idempotent so a failed release can be resumed without permitting overwrites.
Useful? React with 👍 / 👎.
|



Backport of #11532 to
8.8.Merge commit:
046c693486a4a3c157a0f685cd299e4c448f98b9Describe the changes in the pull request
aws s3 cp) and the release copy (copy_object) silently overwrite whatever is already at the target key ins3://redismodules.aws s3api put-object --if-none-match "*"and copy withIfNoneMatch="*", so S3 rejects the write if the object exists.Which additional issues this PR fixes
Main objects this PR modified
sbin/upload-artifacts— conditional put, rejected uploads fail the jobevent-release.ymlset-artifacts — conditional copyMark if applicable
Release Notes