Skip to content

fix: resolve relative redirect locations in routing smoke - #924

Open
eastagiletracker wants to merge 1 commit into
tempoxyz:mainfrom
eastagiletracker:agile-board/routing-smoke-resolve-location
Open

eastagiletracker wants to merge 1 commit into
tempoxyz:mainfrom
eastagiletracker:agile-board/routing-smoke-resolve-location

Conversation

@eastagiletracker

Copy link
Copy Markdown

This PR proposes resolving relative redirect Location headers in the routing smoke check before comparing them, so the scheduled Docs routing smoke workflow stops failing on a correct redirect. We include this PR work along with a full history of your repo at https://eastagiletracker.com/projects/699. You can sign in with your GitHub ID to claim ownership of the project.

What was wrong

The scheduled Docs routing smoke workflow has failed on every run since 2026-07-20 (the last green run was 2026-07-18), always with the same error:

Error: https://tempo.xyz/developers/accounts/server/handler.relay redirected to /developers/docs/server/relay-handler; expected https://tempo.xyz/developers/docs/server/relay-handler

The /developers/accounts/server/handler.relay mirror in vercel.json intentionally uses the relative destination /developers/docs/server/relay-handler (the developersProxyDestination assertions in docs-routing.test.ts pin that form), and resolved against the request URL it is exactly the expected canonical URL. scripts/smoke-docs-routing.ts compared the raw header string, though, so a correct redirect failed. Because the loop throws on the first mismatch, none of the cases after it (/developers/learn/use-cases/payroll, /developers/api/og, and all six legacy-host cases) have been checked since July, so a real regression there would have gone unnoticed.

The change

  • src/lib/docs-routing.ts: new resolveRedirectLocation(location, requestUrl) that resolves the header the same way a client does (and returns null for a missing or unparseable header).
  • scripts/smoke-docs-routing.ts: compares the resolved location with expectedLocation, and follows that same resolved URL for the final-status check.

The README invariant still holds: a proxy-relative Vocs Location such as /docs/server/relay-handler resolves to https://tempo.xyz/docs/..., outside /developers, so it still fails the check.

Verification

To reproduce without touching production, I preloaded a fetch stub that answers each smoke case the way the CI log shows production answering, then ran the unmodified script at main (13dba5c):

$ STUB_RELAY_LOCATION=/developers/docs/server/relay-handler tsx --import ./fetch-stub.mjs scripts/smoke-docs-routing.ts
Error: https://tempo.xyz/developers/accounts/server/handler.relay redirected to /developers/docs/server/relay-handler; expected https://tempo.xyz/developers/docs/server/relay-handler

With this branch, the same run prints Validated 14 deployed routing cases. An absolute Location still passes. A Location of /docs/server/relay-handler (escaping the mount) and an empty Location both still fail with the error above.

New tests in src/lib/docs-routing.test.ts cover relative resolution, absolute and fragment Locations, the /developers-escape case, missing and unparseable headers, and a guard that every expectedLocation in routingSmokeCases is already in resolved form. Reverting only the resolution line makes the relative and absolute/fragment tests fail while the other three stay green. Before and after the change: pnpm test 409 → 414 passing, zero failures; pnpm check:types clean both times; biome check reports the same single existing error in src/pages.gen.ts both times, and the touched files are clean.

How this was managed

This work is tracked as a story at https://eastagiletracker.com/projects/699/stories/648033 on a board imported from this repository's issues and pull requests (922 stories) at https://eastagiletracker.com/projects/699, which we used to manage the change.

board

If you'd rather not receive contributions like this, reply no-more-prs on this pull request and we won't open any further ones on your repositories.


Lawrence W. Sinclair
CEO / East Agile
linkedin.com/in/lwsinclair/
eastagile.com

@vercel

vercel Bot commented Sep 28, 2026

Copy link
Copy Markdown

@eastagiletracker is attempting to deploy a commit to the Tempo Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant