fix(event): add shorthand dedupe regression test#71
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This change adds a focused regression test for the recent event shorthand normalization fix in
event addhandling. The changed parser path already normalized shorthand names likeput, but it did not yet have an explicit test covering the case where shorthand values and their canonical S3 event names appear together in the same request.Problem and user impact
Recent event notification work fixed shorthand event names before notifications are persisted. Without a regression test for mixed shorthand and canonical inputs, a future refactor could accidentally reintroduce duplicate persisted events such as
put,PUT, ands3:ObjectCreated:*being treated as distinct values. That would make notification rules noisier and could hide regressions in the normalization path until users inspect the stored configuration.Root cause
The recent fix added normalization coverage, but the remaining gap was the deduplication path after normalization when shorthand aliases collide with already-canonical event values.
Fix
The new unit test exercises
parse_event_listwith both shorthand and canonical event inputs and asserts that the result is reduced to a single canonical event entry. This keeps scope tightly aligned with the changed code path and avoids broader command refactors.Validation
I ran the required repository checks successfully:
cargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspace