Conversation
tower-finder-service grew POST /api/geocode (its PR #31): the search form's address field resolves a typed US address to coordinates through it. nginx here forwarded only /api/towers, /api/elevation and /api/config, so on every public towers hostname the lookup fell through `location /` to the monolith and answered 404. The service's own edge on 8443 has the route, but nothing routes there until the Cloudflare flip. Add the fourth location to snippets/towers-proxy.conf, so the include keeps carrying the whole tower stack rather than three quarters of it. This repo's bundle does not call the route yet; the vhosts must answer the same set either way, for the same reason the dashboard vhosts already include the snippet. Guard it the way the other three are guarded: - test_towers_vhost_coverage.py asserts the snippet proxies it and that no exact-match location outranks it. - tower-contract.sh gains assert_geocode_contract, probing with an empty query. The service's request model refuses that with 422 before either geocoder upstream (US Census, Nominatim) is asked, so the probe spends no third-party quota and cannot be confused with the fallback's 404. The direct-run gate, the staging smoke test, the production smoke test and the pre-deploy check of staging's instance over retina-edge all call it. - README, ONBOARDING and the compose/render comments list four routes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Claude finished @jehanazad's task in 3m 28s —— View job Claude finished reviewing this PR
SummaryThis is a clean, well-scoped change: a fourth Two minor nits, neither blocking: 1. Stray literal newline in a printf string — echo "FAIL"; printf ' %s
' "$REASON"; FAIL=$((FAIL+1))Every other FAIL/WARN print in this file (lines 94, 328, 330) and in 2. Adjacent comment now slightly stale — # Elevation is the only one of the three routes that fans out to a third party,This predates the PR and wasn't touched by it, but the PR's own description notes What I checked and found solid
Branch: |
Why
tower-finder-service grew
POST /api/geocode(offworldlabs/tower-finder-service#31): the search form's address field resolves a typed US address to coordinates through it. nginx here forwards only/api/towers,/api/elevationand/api/config, so on every public towers hostname the lookup falls throughlocation /to the monolith and answers 404. Observed today ontest-towers.retina.fmafter a deploy of the service that carries the route. The service's own edge on 8443 answers it, but nothing routes there until the Cloudflare flip.What
deploy/nginx/snippets/towers-proxy.conf: a fourthlocation /api/geocodeblock, sametower-finder.confinclude as the other three. Rendered for the test environment it lands on all six vhosts that carry the snippet.backend/tests/test_towers_vhost_coverage.py:/api/geocodejoins_PROXIED_PATHS, so the snippet must carry it and no exact-match location may outrank it.deploy/tower-contract.sh:assert_geocode_contract, probing with an empty query. The service's request model refuses that with 422 before either geocoder upstream (US Census, Nominatim) is asked, so the probe spends no third-party quota, has no degraded state to tolerate, and cannot be confused with the fallback's 404. Wired into the direct-run gate,staging-smoke-test.sh, the production smoke suite inci.yml, and the pre-deploy check of staging's instance overretina-edge.This repo's own bundle does not call the route yet; the vhosts must answer the same set either way, for the same reason the dashboard vhosts already include the snippet.
Verified
test_towers_vhost_coverage.py: 5 passed.deploy/check-env-parity.py: staging and test in parity with production.nginx.conffor the test overlay:location /api/geocodepresent on the same six vhosts aslocation /api/config.pre-commit run --all-files: clean (ruff check, ruff format, vulture, ruff-config x2).bash deploy/tower-contract.sh https://staging-towers.retina.fm/api/towersagainst current staging: towers, elevation and config OK; geocode FAILED with the new 404 diagnostic, which is the defect this PR fixes and what the check will pass once this deploys.Note for the deploy
The pre-deploy gate asserts staging's tower-finder-service answers 422 on an empty geocode query. That instance must carry offworldlabs/tower-finder-service#31, which is on that repo's
main.🤖 Generated with Claude Code