Skip to content

test(event): cover shorthand normalization deduplication#70

Closed
overtrue wants to merge 1 commit intomainfrom
codex/event-shorthand-dedup-test
Closed

test(event): cover shorthand normalization deduplication#70
overtrue wants to merge 1 commit intomainfrom
codex/event-shorthand-dedup-test

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This change closes a regression-test gap in the event notification parser.

The recent event shorthand normalization fix correctly maps aliases such as put, get, and delete to their canonical S3 event names before notification rules are persisted. That behavior was already covered for plain shorthand inputs, but there was still no test proving that shorthand aliases collapse with already-canonical event names into a single persisted value.

Without this regression test, a future refactor could accidentally reintroduce duplicate notification events whenever users mix shorthand flags and canonical event names in the same command invocation.

Root cause

The changed code path normalizes event names first and only then sorts and deduplicates them. The existing tests did not exercise the specific case where shorthand inputs and canonical S3 event names should normalize to the same final string before deduplication.

Fix

Add a focused unit test in crates/cli/src/commands/event.rs that covers mixed shorthand and canonical event inputs and asserts that the parser returns a deduplicated canonical event list.

Validation

  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

@overtrue
Copy link
Copy Markdown
Contributor Author

Superseded by #69, which now carries the broadened mixed shorthand/canonical event dedup coverage from this run.

@overtrue overtrue closed this Mar 28, 2026
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