Repository navigation
fix(s3): emit API reasons and bucket resources in EventBridge events - #9141
aniketshukla1 wants to merge 2 commits into
Conversation
PR Summary by QodoFix S3 EventBridge creation reasons and bucket resources
AI Description
Merge Risk
|
Code Review by Qodo
1.
|
pgermosen
left a comment
There was a problem hiding this comment.
@aniketshukla1 thanks, the creation reasons and the bucket ARN match the S3 EventBridge event docs.
Two things. The rewritten eventBridgeReason still falls back to the classic name for the other events. The same page sets DeleteObject for an API deletion and shows PutObjectAnnotation and DeleteObjectAnnotation for annotations. Could you map ObjectRemoved:* and ObjectAnnotation:Put/Delete in the same switch?
In the test, the queue and rule wiring is what EventRuleQueue in io.floci.aws.testing already does. Using it in a try-with-resources also removes the leak if setup fails.
Summary
S3 Object Created events sent through EventBridge currently carry classic notification names such as
ObjectCreated:Putand an emptyresourceslist. Consumers filtering forPutObjector the bucket ARN therefore miss them.Map the four creation paths to
PutObject,POST Object,CopyObject, andCompleteMultipartUpload. Build the event entry through the shared EventBridge helper with the bucket's partition-aware ARN.Closes #9135.
Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
Matches the documented S3 EventBridge event structure for creation reasons and bucket resources.
New integration coverage uses AWS SDK for Java 2.57.7 for S3 operations, EventBridge rules, SQS delivery, and event-pattern matching. Browser POST uses multipart HTTP. Five cases cover all four creation APIs and a China-region bucket. Before the fix, every case failed on its reason, missing bucket ARN, and the consumer's reason/resource filter. Existing classic notification and lifecycle tests also pass.
690 tests passed, none skipped, plus zero Checkstyle violations and passing docs/partition gates:
The fixture registers SDK clients and resources with the existing
PartitionCleanuphelper immediately after creation. Four fault-injection cases reproduce setup leaks and cleanup masking the original error. On the current fixture revision, 28 tests passed, none skipped, using-Dtest=S3EventBridge*Test,PartitionCleanupTestwith the startup flags above. Checkstyle, docs, and partition gates also passed. The 690-test result above was run before this fixture-only cleanup change.Full repository tests, native builds, Docker compatibility suites, live AWS, and AWS CLI checks were not run locally.
Checklist
./mvnw testpasses locally (focused suite above passed; full suite not run)