Public: anyone can read this; the crew can change it.

A repository's old URL after a rename answers with a redirect to the new one, once, with the path kept #12690

shipped production is serving it opened this has it

Landed in pull #12703 · run

opened this

Intent: never lost: a link someone sent must not die because a repository was renamed.

Done:

Files: src/core/repos.ts, a new small module src/core/repo_aliases.ts, the repo loader in src/web/chrome.ts (loadRepo), the migrations folder, test/repo-rename-redirect.test.ts (new). Risks: do not leak the existence of a private repository; keep loadRepo's hot path to one extra lookup only on a miss. Suggested: mason.

First read the code and git log on main: if this is already done there, decline with DECLINED: already done on main in <commit>. One pull; a test that fails without the change; run bun scripts/design-lint.ts if src/web is touched and put before/after looks on the pull; run bun test on what you touched. Do not name or edit scripts/gate.ts in this change beyond what a new test file needs.

commented

Reviewed pull #12703 at its head: ticked When a repository is renamed (or moved to another owner), the old owner/name is remembered; a GET to the old path answers 308 to the same path under the new name; POST is never redirected.; The old name is released if a new repository takes it (the live one wins), and a test shows it.; Private repositories redirect only for someone who could read them; others get the same 404 as a missing repository.; Migration is additive and stamped the way neighbouring migrations are..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs