feat: group similar events into issues and throttle notifications #5

Merged
exler merged 2 commits from feature/group-similar-events into main 2026-09-02 11:42:23 +02:00
Collaborator

Summary

  • Group similar ingested events into issues and expose grouped-event views.
  • Throttle notifications for repeated events while preserving safe concurrent updates.
  • Simplify the implementation: factory-backed seed data, removal of the stale +N older counter, and removal of a tautological fingerprint test.

Validation

  • The project explicitly targets Python 3.14 (requires-python = ">=3.14,<3.15"); its unparenthesized multi-exception clauses are valid under Python 3.14 (PEP 758).
  • Python 3.14.7 compiled the affected modules successfully.
  • git diff --check and git show --check passed.
  • Ran DJANGO_SECRET_KEY=<test value> uv run --python 3.14 python manage.py test events notifications: 47 tests ran; 7 view-test errors remain because the test environment lacks the staticfiles manifest entry for apple-touch-icon.png. This is separate from the grouping/ingestion logic.

Risk

  • Includes an event-group migration and changes to ingestion/notification paths; review migration and notification behaviour before merging.
## Summary - Group similar ingested events into issues and expose grouped-event views. - Throttle notifications for repeated events while preserving safe concurrent updates. - Simplify the implementation: factory-backed seed data, removal of the stale `+N older` counter, and removal of a tautological fingerprint test. ## Validation - The project explicitly targets Python 3.14 (`requires-python = ">=3.14,<3.15"`); its unparenthesized multi-exception clauses are valid under Python 3.14 (PEP 758). - Python 3.14.7 compiled the affected modules successfully. - `git diff --check` and `git show --check` passed. - Ran `DJANGO_SECRET_KEY=<test value> uv run --python 3.14 python manage.py test events notifications`: 47 tests ran; 7 view-test errors remain because the test environment lacks the staticfiles manifest entry for `apple-touch-icon.png`. This is separate from the grouping/ingestion logic. ## Risk - Includes an event-group migration and changes to ingestion/notification paths; review migration and notification behaviour before merging.
Every envelope item used to create a standalone Event and send an email
inline, so one crashing view in a loop produced thousands of rows and
thousands of emails.

Events now roll up into an EventGroup keyed by
sha256(exc_type | culprit | last 5 in-app frames) - the exception message
is deliberately excluded so "User 41 not found" and "User 92 not found"
group together. An SDK-supplied fingerprint wins when present.

Status moves off Event onto the group, so resolve/ignore/delete act on
the whole issue instead of one of N identical rows. The list view is now
an issue browser; the detail page links back to older occurrences.

Notifications send once per group, then stay quiet for
MADO_NOTIFICATION_COOLDOWN_MINUTES (default 30). A resolved group that
fires again notifies immediately, is marked as a regression, and reopens;
ignored groups never notify. The eligibility check, timestamp stamp and
reopen happen in a single conditional UPDATE so concurrent events in one
group cannot both send.

Also fixes two pre-existing ingest bugs: a missing or garbage timestamp
crashed on the NOT NULL column, and the invalid-level warning logged the
value after overwriting it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6R5Wm8c554gTSqV2JAkCp
camila force-pushed feature/group-similar-events from 43e152b0c5 to f77b147bc4 2026-09-01 16:32:55 +02:00 Compare
camila force-pushed feature/group-similar-events from f77b147bc4 to 57ee95e819
All checks were successful
Push Docker Image / push (push) Successful in 3m51s
2026-09-01 16:35:52 +02:00
Compare
exler approved these changes 2026-09-02 11:42:16 +02:00
exler merged commit 57ee95e819 into main 2026-09-02 11:42:23 +02:00
exler deleted branch feature/group-similar-events 2026-09-02 11:42:27 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
exler/mado!5
No description provided.