Skip to content

test(event): cover notification rule replacement#73

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

test(event): cover notification rule replacement#73
overtrue wants to merge 1 commit intomainfrom
codex/event-add-replace-test-gap

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

Summary

This change adds focused regression coverage for the bucket notification update path in event add.

The recent event shorthand normalization fix ensures shorthand values like put are converted before notification rules are persisted. Existing unit coverage verified the normalization helper itself, but it did not verify the replace-by-ARN behavior that event add uses when updating an existing notification target. That left a gap where normalization could pass in isolation while replacement logic still regressed in the path that actually writes the updated rule.

This patch adds a unit test that starts with an existing notification rule, parses a mixed shorthand and canonical event list, and then upserts a rule with the same ARN. The test asserts that the old rule is replaced rather than duplicated and that the persisted event list is normalized and deduplicated to a single canonical value.

User Impact

Without this coverage, a future change could reintroduce duplicated rules or persist stale event values when users update an existing notification target with shorthand events.

Validation

I ran the required repository checks:

  • 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