Skip to content

test(common): every event kind is checked against its stored tag, and a new one can't be skipped - #413

Merged
PiquelChips merged 2 commits into
mainfrom
test/event-kinds-exhaustive
Nov 7, 2026
Merged

PiquelChips merged 2 commits into
mainfrom
test/event-kinds-exhaustive

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

event_kinds_match_their_serde_tags claims to check every event's hand-written kind() against the serde tag it is stored under, but it built only 43 of the 58 kinds. A typo in any of the other 15 would have stored history under a kind nothing reads, and no test would notice. This is a follow-up to the test cleanup.

  • The test now builds the 15 missing kinds: the email ones, pictures, deliveries, signing keys, export, deletion, restore, purge, pruning and chain verification.
  • It also asks serde for the full list of tags: a small de::Error captures the variant names serde expects when it reads an unknown tag. It then requires one built event per tag, so a new event kind that the test doesn't build fails it.

Test-only. No production code changes.

Proved by: the test passes, and removing one event from its list makes it fail with "one event per variant". Also clippy -D warnings on piquel-common, all targets and features.

Reviewed with review-loop: 1 round with 2× GPT 6.1 Sol and Claude Opus 5.5. Verdict: approved

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by GPT 6.1 Sol and Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2f95d98-e189-432d-b994-c0520c12cf31
Commits

Reviewing files that changed from the base of the PR and between 4105405 and ef5342b.

Files selected for processing: 1

  • crates/common/src/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips PiquelChips self-assigned this Nov 6, 2026
@PiquelChips PiquelChips added the tests Tests label Nov 6, 2026
@PiquelChips PiquelChips added this to the v0.1 milestone Nov 6, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 6, 2026
@PiquelChips PiquelChips moved this from Needs Triage to In Progress in sourceorigin.dev Nov 6, 2026
@PiquelChips PiquelChips moved this from In Progress to Ready in sourceorigin.dev Nov 6, 2026
@PiquelChips
PiquelChips added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 2efdb3a Nov 7, 2026
9 checks passed
@PiquelChips
PiquelChips deleted the test/event-kinds-exhaustive branch November 7, 2026 00:09
@github-project-automation github-project-automation Bot moved this from Ready to Done in sourceorigin.dev Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant