Skip to content

fix(event): add shorthand dedupe regression test#71

Draft
overtrue wants to merge 1 commit intomainfrom
codex/event-shorthand-test-gap
Draft

fix(event): add shorthand dedupe regression test#71
overtrue wants to merge 1 commit intomainfrom
codex/event-shorthand-test-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This change adds a focused regression test for the recent event shorthand normalization fix in event add handling. The changed parser path already normalized shorthand names like put, 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, and s3: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_list with 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 --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant