Skip to content

Conversation

@bentsku
Copy link
Contributor

@bentsku bentsku commented Jun 23, 2025

Motivation

We got a report with #12783 that we did not support IfMatch header for DeleteObject. This is because this is only supported for Directory Bucket (S3 Express One Zone), which we don't support yet (requested at #12184).

In the reported issue, the bucket was not created as a Directory Bucket, which would raise an exception in S3 when trying to use preconditions headers for DeleteObject.

This PR adds that parity + a log message to indicate that directory buckets are not yet supported by LocalStack, to avoid users not understanding why such feature would just fail silently.

Changes

  • add test for DeleteObject preconditions when the bucket is not a directory bucket
  • add the same validation in the provider

Side note regarding Directory Buckets

It seems AWS is adding more feature again only to Directory Buckets, as seen by #12785 and https://aws.amazon.com/about-aws/whats-new/2025/06/amazon-s3-express-one-zone-atomic-renaming-objects-api/

@bentsku bentsku added this to the 4.6 milestone Jun 23, 2025
@bentsku bentsku self-assigned this Jun 23, 2025
@bentsku bentsku added aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases labels Jun 23, 2025
@github-actions
Copy link

S3 Image Test Results (AMD64 / ARM64)

    2 files  ±0    2 suites  ±0   8m 34s ⏱️ +16s
  510 tests +4  460 ✅ +4   50 💤 ±0  0 ❌ ±0 
1 020 runs  +8  920 ✅ +8  100 💤 ±0  0 ❌ ±0 

Results for commit 94293b0. ± Comparison against base commit b36bb1a.

@bentsku bentsku requested a review from k-a-il June 23, 2025 09:26
@bentsku bentsku marked this pull request as ready for review June 23, 2025 09:26
@github-actions
Copy link

Test Results - Preflight, Unit

21 727 tests  ±0   20 070 ✅ ±0   6m 40s ⏱️ +23s
     1 suites ±0    1 657 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 94293b0. ± Comparison against base commit b36bb1a.

@github-actions
Copy link

Test Results (amd64) - Acceptance

7 tests  ±0   5 ✅ ±0   3m 14s ⏱️ +7s
1 suites ±0   2 💤 ±0 
1 files   ±0   0 ❌ ±0 

Results for commit 94293b0. ± Comparison against base commit b36bb1a.

@github-actions
Copy link

Test Results - Alternative Providers

988 tests   621 ✅  34m 12s ⏱️
  4 suites  367 💤
  4 files      0 ❌

Results for commit 94293b0.

@github-actions
Copy link

Test Results (amd64) - Integration, Bootstrap

    5 files      5 suites   1h 25m 11s ⏱️
2 252 tests 1 639 ✅ 613 💤 0 ❌
2 258 runs  1 639 ✅ 619 💤 0 ❌

Results for commit 94293b0.

@github-actions
Copy link

LocalStack Community integration with Pro

    2 files  ±    0      2 suites  ±0   1h 3m 53s ⏱️ - 39m 0s
2 228 tests  - 2 662  1 612 ✅  - 2 504  616 💤  - 158  0 ❌ ±0 
2 230 runs   - 2 662  1 612 ✅  - 2 504  618 💤  - 158  0 ❌ ±0 

Results for commit 94293b0. ± Comparison against base commit b36bb1a.

This pull request removes 2666 and adds 4 tests. Note that renamed tests count towards both.
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_lambda_dynamodb
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_opensearch_crud
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_search_books
tests.aws.scenario.bookstore.test_bookstore.TestBookstoreApplication ‑ test_setup
tests.aws.scenario.kinesis_firehose.test_kinesis_firehose.TestKinesisFirehoseScenario ‑ test_kinesis_firehose_s3
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_destination_sns
tests.aws.scenario.lambda_destination.test_lambda_destination_scenario.TestLambdaDestinationScenario ‑ test_infra
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_prefill_dynamodb_table
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input0-SUCCEEDED]
tests.aws.scenario.loan_broker.test_loan_broker.TestLoanBrokerScenario ‑ test_stepfunctions_input_recipient_list[step_function_input1-SUCCEEDED]
…
tests.aws.services.s3.test_s3_api.TestS3DeletePrecondition ‑ test_delete_object_if_match_all_non_express
tests.aws.services.s3.test_s3_api.TestS3DeletePrecondition ‑ test_delete_object_if_match_modified_non_express
tests.aws.services.s3.test_s3_api.TestS3DeletePrecondition ‑ test_delete_object_if_match_non_express
tests.aws.services.s3.test_s3_api.TestS3DeletePrecondition ‑ test_delete_object_if_match_size_non_express

Copy link
Contributor

@k-a-il k-a-il left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Comment on lines +1207 to +1210
LOG.warning(
"DeleteObject Preconditions is only supported for Directory Buckets. "
"LocalStack does not support Directory Buckets yet."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this will improve user experience

@bentsku bentsku merged commit 62f162f into master Jun 24, 2025
56 checks passed
@bentsku bentsku deleted the s3-express-delete-preconditions branch June 24, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants