Skip to content

[8.8-rse] Use S3 conditional writes to prevent overwriting published artifacts - #11595

Closed
redisearch-backport-pull-request[bot] wants to merge 1 commit into
8.8-rsefrom
backport-agent/pr-11532-to-8.8-rse
Closed

redisearch-backport-pull-request[bot] wants to merge 1 commit into
8.8-rsefrom
backport-agent/pr-11532-to-8.8-rse

Conversation

@redisearch-backport-pull-request

Copy link
Copy Markdown
Contributor

Backport of #11532 to 8.8-rse.
Merge commit: 046c693486a4a3c157a0f685cd299e4c448f98b9

Describe the changes in the pull request

  1. Current: artifact uploads (aws s3 cp) and the release copy (copy_object) silently overwrite whatever is already at the target key in s3://redismodules.
  2. Change: upload with aws s3api put-object --if-none-match "*" and copy with IfNoneMatch="*", so S3 rejects the write if the object exists.
  3. Outcome: CI only. A published snapshot or release artifact can no longer be replaced by a later run; the job fails instead.

Which additional issues this PR fixes

  1. N/A

Main objects this PR modified

  1. sbin/upload-artifacts — conditional put, rejected uploads fail the job
  2. event-release.yml set-artifacts — conditional copy

Mark if applicable

  • This PR introduces API changes
  • This PR introduces serialization changes

Release Notes

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

…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: 8037bfc2a6

ℹ️ 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 a supported conditional copy API

Every release reaches this copy_object call after collecting its artifacts, but boto3's CopyObject operation does not accept IfNoneMatch as a destination precondition (its similarly named CopySourceIfNoneMatch applies only to the source). Botocore parameter validation will raise ParamValidationError before S3 is called, so release workflows fail instead of publishing artifacts. Use an operation/API that supports a destination conditional write, or otherwise implement the no-overwrite behavior.

Useful? React with 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (8.8-rse@cb861e0). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             8.8-rse   #11595   +/-   ##
==========================================
  Coverage           ?   81.24%           
==========================================
  Files              ?      562           
  Lines              ?    76547           
  Branches           ?    30619           
==========================================
  Hits               ?    62187           
  Misses             ?    14072           
  Partials           ?      288           
Flag Coverage Δ
flow 82.59% <ø> (?)
unit 52.47% <ø> (?)

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.

@redisearch-backport-pull-request
redisearch-backport-pull-request Bot added this pull request to the merge queue Sep 28, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 28, 2026
@AngelYanev
AngelYanev added this pull request to the merge queue Sep 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Sep 30, 2026
@oshadmi

oshadmi commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Closing: 8.8-rse already contains this change (inherited from master via the re-branch in #11635), so this backport is redundant.

@oshadmi oshadmi closed this Nov 29, 2026
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 size:S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants