Skip to content

[2.10] Use S3 conditional writes to prevent overwriting published artifacts - #11598

Merged
redisearch-backport-pull-request[bot] merged 1 commit into
2.10from
backport-agent/pr-11532-to-2.10
Sep 30, 2026
Merged

redisearch-backport-pull-request[bot] merged 1 commit into
2.10from
backport-agent/pr-11532-to-2.10

Conversation

@redisearch-backport-pull-request

Copy link
Copy Markdown
Contributor

Backport of #11532 to 2.10.

Original PR

Cherry-pick result

  • Resolved 1 conflict(s) — see Conflict Log below.

Conflict Log

sbin/upload-artifacts

  • Conflict: The source hunk updates error handling in a beta-upload loop, while the release branch ends its upload function after the snapshot loop.
  • Why it conflicted: 2.10 does not contain the beta-directory upload feature present in the source parent; its upload function retains the original completion message.
  • Resolution: Kept the release branch upload flow and completion message, omitted the absent beta loop, and retained the conditional put-object operation, snapshot failure propagation, temporary-file cleanup on upload failure, and explicit upload_product exit-status handling.
  • Rationale: Applies overwrite protection and propagates rejected uploads for the existing release upload path without introducing the unrelated beta-upload feature. Builds and tests were not run, as requested; CI must validate AWS CLI and SDK compatibility.

Release notes

  • This PR requires release notes
  • This PR does not require release notes

🤖 Generated by the auto-backport workflow.

…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)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd22f14a8a

ℹ️ 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="*",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use an S3 operation that supports destination preconditions

CopyObject has no destination IfNoneMatch parameter; its only related condition is CopySourceIfNoneMatch, which applies to the source object. The boto3 client validates this unknown keyword before making the request and raises ParamValidationError (not the caught ClientError), so every release reaching Set Version Artifacts fails before publishing any artifacts. Use a supported conditional destination-write flow instead.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.51%. Comparing base (e5e1e0d) to head (cd22f14).

Additional details and impacted files
@@            Coverage Diff             @@
##             2.10   #11598      +/-   ##
==========================================
- Coverage   89.56%   89.51%   -0.05%     
==========================================
  Files         212      212              
  Lines       36709    36709              
==========================================
- Hits        32877    32860      -17     
- Misses       3832     3849      +17     
Flag Coverage Δ
flow 84.08% <ø> (-0.22%) ⬇️
unit 43.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@alonre24

Copy link
Copy Markdown
Collaborator

@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 upload_product to propagate the upload exit status — on this branch the { ...; } || { ... } wrapper disabled set -e, so a rejected upload would otherwise leave the job green.

@redisearch-backport-pull-request
redisearch-backport-pull-request Bot added this pull request to the merge queue Sep 30, 2026
Merged via the queue into 2.10 with commit a7c220e Sep 30, 2026
25 checks passed
@redisearch-backport-pull-request
redisearch-backport-pull-request Bot deleted the backport-agent/pr-11532-to-2.10 branch September 30, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport This PR was automatically backported by an agent auto-backport-conflicts There were conflicts in this automatic backport size:S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants