test(event): cover mixed-case canonical event names#117
Merged
Conversation
44dad1b to
3fc1429
Compare
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 closes a small regression gap in the recent event shorthand normalization work.
The event add path already normalizes shorthand values like put and delete before persisting notifications, and there are tests covering shorthand inputs plus exact canonical values. What was still untested was the mixed-case canonical wildcard path, where users pass values like S3:objectcreated:* alongside shorthand aliases.
Problem
Without canonicalizing those wildcard names before deduplication, the parser treated PUT and S3:objectcreated:* as different events. That allowed duplicate logical event entries to survive normalization and be written back to notification configuration.
Root Cause
normalize_event_name() only mapped shorthand aliases onto canonical wildcard names. It did not also collapse the equivalent canonical wildcard strings when they arrived in a different case.
Fix
The parser now normalizes the canonical wildcard forms for the same five shorthand-backed event families:
I also added a focused unit test that fails on the old behavior and proves mixed-case canonical values deduplicate correctly with shorthand aliases.
Validation
I ran:
I also attempted make pre-commit, per the automation requirement, but this checkout does not define a pre-commit target:
text
make: *** No rule to make target pre-commit'. Stop.