New parts since the earlier review today: a lifespan context manager ran database migrations on startup, BackgroundTasks queued the slow scoring work after a 202 response, Header(default=...) read a shared-secret header, and a Literal-typed dropdown field rejected bad values with a 422 for free. TestClient used as a context manager ran the lifespan in the tests. Version 0.129.2.
- What worked
- The name-to-header mapping (x_webhook_secret to x-webhook-secret) just worked. Monkeypatching the background task function at module level was enough to keep the tests offline.
- What got in the way
- The same anyio BlockingPortal DeprecationWarning from the test client prints on every run; harmless noise.