Skip to content

Stop Sentry noise: judge free-text availability isn't a parse error - #274

Merged
gregv merged 1 commit into
developfrom
fix/judge-availability-sentry-noise
Aug 30, 2026
Merged

Stop Sentry noise: judge free-text availability isn't a parse error#274
gregv merged 1 commit into
developfrom
fix/judge-availability-sentry-noise

Conversation

@gregv

@gregv gregv commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Why

Sentry issue 80f5bb179a23474d843391277adf62ba (volunteers.submit_judge_application — "CRITICAL: All patterns failed to match slot") fires on every judge application that has anything typed in the "Additional availability details" field. The submission itself always succeeds; this is pure log noise.

Root cause: get_calendar_email_attachment_from_availability() runs on every application submit to build .ics email attachments, but it only understands the machine-generated slot format the mentor/volunteer forms emit ("Sunday, Oct 12: ☀️ Morning (9am - 12pm PST)"). The judge form's availability is a deliberate free-text field, so prose like "I will be Present near ASU during Entire November month…" failed all three regex patterns → 2 WARNINGs + 1 ERROR per submit.

What changed (services/volunteers_service.py)

  • Early guard: availability with no Weekday, Mon D structured prefix logs INFO and returns [] — free text is expected input, not an error. Structured mentor/volunteer strings parse exactly as before.
  • Genuine structured-parse failures now log a single WARNING per slot (was ERROR with a char-code dump); the per-pattern cascade logs are DEBUG.
  • Call-site "no calendar attachments generated" warnings downgraded to INFO (they fired for every judge and every empty-availability submit).
  • CLAUDE.md note documenting the guard.

Tests

Two new tests in api/volunteers/tests/test_volunteers_service.py: the exact Sentry free-text string returns [] with zero error-level logs, and a structured two-slot string still yields two valid .ics attachments. ENVIRONMENT=test pytest api/volunteers/tests → 15/15 pass.

After this deploys, the Sentry issue can be resolved — it should not recur.

🤖 Generated with Claude Code

Every judge application with anything typed in "Additional availability
details" fired an ERROR ("CRITICAL: All patterns failed to match slot",
Sentry 80f5bb179a23474d843391277adf62ba) plus two WARNINGs. The .ics
calendar-attachment parser only understands the machine-generated slot
format the mentor/volunteer forms emit; the judge form's availability is
deliberately free text, so it failed all three patterns on every submit.
The request itself always succeeded — this was pure log noise.

- Early guard: availability with no "Weekday, Mon D" structured prefix
  logs INFO and returns [] (free text is expected input, not an error)
- Genuine structured-parse failures now log one WARNING per slot
  (was ERROR with a char-code dump); per-pattern cascade logs are DEBUG
- Call-site "no calendar attachments generated" downgraded to INFO
- Tests: free-text skip (the exact Sentry string) + structured
  two-slot regression

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gregv
gregv merged commit a82c12a into develop Aug 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant