Repository navigation
Conversation
policyengine-observability 3.0.4 writes `<unmatched>` as `http.route` on
every record written while a FastAPI endpoint runs, because its middleware
begins the request before FastAPI matches the route. These tests check the
gateway's exception record for `/jobs/{job_id}` and the entrypoint's backend
response event for the same route. They fail until the services lock 3.0.5
or later.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3.0.5 reads the matched FastAPI route each time a record is written, so records written while an endpoint runs carry its route template instead of `<unmatched>` (PolicyEngine/policyengine-observability#40). 3.0.6 changes only the certifi version in that repository's own lock. Raise the floor to 3.0.6 in every pyproject that requires the package, and relock the six projects that hold it, upgrading only that package. Update the observability and type-checking guides to the new floor and describe which records carry the matched route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Fixes #1018
Same-Repository Draft PR Check
PolicyEngine/policyengine-sim-api, not a personal fork.Changelog
changelog.d/<name>.<type>.md, whose type is breaking, added, changed, fixed or removed.Summary
>=3.0.6,<4(was>=3.0.4,<4) inlibs/policyengine-simulation-observability,projects/policyengine-simulation-entry,projects/policyengine-simulation-executor(both dependency lists) andprojects/policyengine-simulation-gateway.uv.lockholds the package withuv lock --upgrade-package policyengine-observability(uv 0.13.6, the repository's pinned release). Each lock diff changes only that package's version, file hashes and specifier. The two libraries that get it throughpolicyengine-simulation-observability(policyengine-simulation-contract,policyengine-stage12-persistence) change only their lock.docs/engineering/skills/observability.mdandtype-checking.mdto the new floor, and describes which records carry the matched route.What changes from 3.0.4 to 3.0.6
scope["route"], and the runtime calls it each time it writes a record during the request. Records written while an endpoint runs (record_exception,event,log) now carry the route template, for example/jobs/{job_id}, instead of<unmatched>. Records written before routing (for example from a middleware) and requests that match no route still carry<unmatched>. If the reader raises, the runtime reports a diagnostic and keeps the stored route.uv.lock. The package's requirements do not change, so it changes nothing in these locks besides the package itself.__exit__annotations thattest_scope_exit_typing.pychecks.Deployment
The gateway's and the executor's Modal images install from these locks with
uv_sync(frozen=True), and the entrypoint's Cloud Run image installs from its lock, so the new version reaches all three on the next release. The environment variables the observability runtime reads (OBSERVABILITY_*,OTEL_*,POLICYENGINE_OTEL_*) are the same in 3.0.4 and 3.0.6; this PR changes none of their providers or wiring.Overlap with the daily dependency update
The open
Update dependenciesPR (#583) also moves these locks to 3.0.6 among many other upgrades, and fails on other packages. This PR moves only policyengine-observability so the route fix can ship on its own; the next daily run rebuilds #583 frommain.Testing
Red then green: the first commit adds the tests and fails on 3.0.4 with
'<unmatched>' != '/jobs/{job_id}'; the second commit makes them pass.projects/policyengine-simulation-gateway:uv run --frozen pytest "tests/test_observability.py::test_exception_recorded_while_a_route_runs_carries_the_matched_route"(new) passes. The test makesGET /jobs/{job_id}fail in the Modal lookup and checks that theexception.recordedrecord and therequest.completedrecord both carry/jobs/{job_id}.projects/policyengine-simulation-entry:uv run --frozen pytest "tests/test_app.py::test_event_recorded_while_a_route_runs_carries_the_matched_route"(new) passes. It checks thesimulation_entry_backend_responseevent andrequest.completedforGET /jobs/{job_id}.python -m scripts.rules pyright --sync <package>passes for all six relocked packages.uv lock --check --project <dir>passes for all six.BASE_SHA=origin/main .github/scripts/check-changelog-fragment.shpasses.🤖 Generated with Claude Code