Stop Sentry noise: judge free-text availability isn't a parse error - #274
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.icsemail 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'savailabilityis 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)Weekday, Mon Dstructured prefix logs INFO and returns[]— free text is expected input, not an error. Structured mentor/volunteer strings parse exactly as before.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.icsattachments.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