Uh oh!
There was an error while loading. Please reload this page.
fix(api): stop otel turning every 405 into a 500 (unblocks 5 PRs) - #564
Conversation
`Backend (pytest)` has been red on main since the FastAPI 0.138 lock, on test_quiz_preflight_a.py::TestQuizErrorEnvelope::test_method_not_allowed_gets_generic_code: AttributeError: '_IncludedRouter' object has no attribute 'path' Not test-only. otel's _get_route_details guards its FULL-match `.path` read with `except AttributeError` but its PARTIAL-match branch does not — and a PARTIAL match is exactly a wrong-method request. So the error escapes the middleware and every 405 returns 500. Staging and prod install the same lock, so that is live behaviour. Nothing to upgrade to: the unguarded line is in every released opentelemetry-instrumentation-fastapi through 0.65b0. services/otel_fastapi_compat.py wraps the resolver, absorbing only AttributeError and falling back to scope["path"] — otel's own FULL-branch fallback. Lifted verbatim from #563 so that PR still auto-merges after this lands; it blocks five other open PRs whose CI runs against a merge with main.
Warning Review limit reached
Next review available in:52 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
This pull request has been ignored for the connected project Preview Branches by Supabase. |
Uh oh!
There was an error while loading. Please reload this page.
Why this is separate
Backend (pytest)has been red onmainsince the FastAPI 0.138 lock, on one test:This is not test-only. otel's
_get_route_detailsguards its FULL-match.pathread withexcept AttributeError, but its PARTIAL-match branch does not — and a PARTIAL match is exactly a wrong-method request. The error escapes the middleware, so every 405 returns 500. Staging and production install the same lock, so that is live behaviour today.There is nothing to upgrade to: the unguarded line is present in every released
opentelemetry-instrumentation-fastapithrough 0.65b0.services/otel_fastapi_compat.pywraps the resolver, absorbing onlyAttributeErrorand falling back toscope["path"]— which is otel's own FULL-branch fallback.Why now
This one failure is blocking the CI of five open PRs, none of which touch routing or quiz:
Their
pull_requestruns check out a merge of head + base, so landing this onmainturns all five green without touching their branches.Relationship to #563
The three files here are lifted verbatim from #563, which diagnosed the bug and already carries the fix.
backend/main.pyis byte-identical to that branch's version, so #563 still auto-merges cleanly after this lands — both sides hold the same content. #563 keeps the credit for the diagnosis; this just unblocks the queue ahead of it.Verification
ruff check .cleantest_otel_fastapi_compat.py+test_quiz_preflight_a.py: 27 passed