fix: resolve relative redirect locations in routing smoke - #924
Open
eastagiletracker wants to merge 1 commit into
Open
eastagiletracker wants to merge 1 commit into
eastagiletracker wants to merge 1 commit into
Conversation
|
@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
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.
This PR proposes resolving relative redirect
Locationheaders 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:
The
/developers/accounts/server/handler.relaymirror invercel.jsonintentionally uses the relative destination/developers/docs/server/relay-handler(thedevelopersProxyDestinationassertions indocs-routing.test.tspin that form), and resolved against the request URL it is exactly the expected canonical URL.scripts/smoke-docs-routing.tscompared 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: newresolveRedirectLocation(location, requestUrl)that resolves the header the same way a client does (and returnsnullfor a missing or unparseable header).scripts/smoke-docs-routing.ts: compares the resolved location withexpectedLocation, 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-handlerresolves tohttps://tempo.xyz/docs/..., outside/developers, so it still fails the check.Verification
To reproduce without touching production, I preloaded a
fetchstub that answers each smoke case the way the CI log shows production answering, then ran the unmodified script atmain(13dba5c):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.tscover relative resolution, absolute and fragment Locations, the/developers-escape case, missing and unparseable headers, and a guard that everyexpectedLocationinroutingSmokeCasesis 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 test409 → 414 passing, zero failures;pnpm check:typesclean both times;biome checkreports the same single existing error insrc/pages.gen.tsboth 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.
If you'd rather not receive contributions like this, reply
no-more-prson 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