Repository navigation
site: a GitHub URL with commit.city swapped in lands on the city - #9
Merged
Merged
Conversation
Swapping the domain on a GitHub page is the site's front door, but it only worked on a profile or a repo's front page: /vercel/ai/pulls, /vercel/ai/tree/main and /vercel/next.js/commits/canary were 404s, and /orgs/vercel opened a repo city called "orgs/vercel". - /owner/repo/<anything> and /owner/repo.git redirect to /owner/repo - /orgs/<org>[/...] redirects to /<org> - the dev server applies vercel.json's redirects too, and a test runs the routes through path-to-regexp, which matches them as Vercel does
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
facebook/react is react/react now, and commit.city kept two cities of it: /facebook/react served one built 2026-10-11 (685 commits) while /react/react had one a day newer (689). A build was keyed by the name it was asked for, so every old link to a moved repo built a second city. - the page redirects (307) when the city under the asked-for name belongs to a repo that has since moved: /facebook/react -> /react/react - a build of a moved repo is keyed by the current name, checks the current owner's hidden setting, and leaves the old name a meta that redirects, so its later visitors are sent on rather than rebuilding - the page swaps the address bar to the current name when the build starts
azank1
force-pushed
the
site/github-paths
branch
from
October 13, 2026 12:02
2e943c8 to
07a7e91
Compare
azank1
marked this pull request as ready for review
October 13, 2026 12:22
This branch was successfully 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.
Swapping
github.comforcommit.cityis the site's front door, but it only worked on a profile or a repo's front page. In production today:/vercel/ai/pulls/vercel/ai/vercel/ai/tree/main/packages/ai/vercel/ai/vercel/next.js/commits/canary/vercel/next.js/vercel/ai.git/vercel/ai/orgs/vercel/vercelvercel.jsongets three redirects (307). Existing site paths (/api,/s,/v,/explore, …) are excluded by the same lookahead the rewrites use.scripts/dev.mjsapplies redirects too, in Vercel's order: redirects, then the filesystem, then rewrites.test/routes.test.tsruns a table of paths throughvercel.jsonwith path-to-regexp 6.3.0, which matches the patterns as Vercel does.Tests: web 39, 33 pass, 6 live tests skipped. The dev server returned all five redirects above, and
?x=1query strings are kept.Second commit: a repo GitHub moved has one city, under its current name
facebook/reactisreact/reactnow, and commit.city kept two cities of it./facebook/reactserved one built on 2026-10-11 (685 commits), while/react/reacthad one a day newer (689). Builds were keyed by the name requested, so every old link to a moved repo built a second city./facebook/react→/react/react. A different letter case is still the same name and doesn't redirect.Tests: new
test/page.test.tscovers the redirect; the finish test checks the meta written under the old name. web: 40 tests, 34 pass, 6 live tests skipped.