Repository navigation
docs: own the legacy content redirects on 2.39 - #32640
Conversation
Moves coder.com's and the docs router's unversioned content redirects into docs/redirects.json, so 2.39 serves them from its own branch.
|
👋 Hey @nickvigilante! This PR is targeting the Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format: If this is not a bug fix, it likely should not target a release branch. |
Jesswinters
left a comment
There was a problem hiding this comment.
No P0/P1, so I'm approving.
What I checked: I parsed the file with docs-engine's own parseVersionRedirectsFile (legacy forms on), which is what version-redirects.mjs runs at publish, and then resolved every rule with resolveVersionRedirect against this branch's docs/manifest.json. I checked for:
- every exact source ending on a live page after following the chain, with no loops and no chains over 3 hops;
- every wildcard destination prefix having pages;
- no duplicate sources;
- no source that is itself a live page, which would be a rule that never fires;
- no exact rule shadowed by an earlier wildcard.
The result was 0 problems. The external destinations all pass the engine's allowlist, and all nine blob/main/... files exist on coder/coder main. 314 rules against 495 routes. On this branch, go run ./scripts/docsredirectscheck also reports 314 rules OK.
P3 (non-blocking)
- Leaving out the router's
/docs/aboutrule is fine.abouthas no page of its own on 2.39 (onlyabout/screenshots), so the router's static rule keeps answering it until the router is slimmed. When that happens, keep/docs/about→/docsin the router, or add an exempt form here, so/docs/aboutdoesn't start returning a 404. - The sibling 2.38 file (#32639) lacks this file's older
templates,templates/*andworkspacesrules. I suggested adding them there for parity. - CI is green.
This review was generated by Coder Agents on behalf of @Jesswinters.
Moves the unversioned docs content redirects that coder.com and the docs router (coder/docs-engine) hold for 2.39 into this branch's
docs/redirects.json, so the version owns them.This lets those repos drop their copies later.
redirects.jsonand the router's staticredirects.json.URL-scheme rules (
coder-oss,coder,v1,v2,code-server) and tagged-release patterns stay in the router.about/architecturegoes to/.The retired security advisory goes to GitHub Security Advisories, because its old blob URL returns 404.
contributing/*becomes nine exact rules, becauseabout/contributinghas no pages.The
ai-bridgeandagent-boundariesexact rules sit above their wildcards./docs/aboutrule (2.39's checker treats it as a live page), and uses the absolute/docs/...form because 2.39's checker rejects relative routes.Validation
go run ./scripts/docsredirectscheckandgo test ./scripts/docsredirectscheck/...: 314 rules OK.Do not remove the matching rules from coder.com or the router until this is merged and 2.39 is republished.
Plan and decision log
Ownership rules agreed for redirects:
/docsto/docswithin one version (a wildcard or branch slug such as@mainnext): the version'sdocs/redirects.jsonin coder/coder./docsto/docsacross versions: the router'sredirects.jsonin coder/docs-engine./docssource to a/docsdestination: coder.com and coder.com-new./docssource to a non-/docsdestination: the router'sredirects.json./docs/xto/docs/yis mainline same-version content, so it belongs to the release branch that is mainline.Findings behind this PR:
The router README says static rules answer before a version's own rules on the mainline, so the stale copies win.
docs/redirects.jsonexisted onmainandrelease/2.39only.2.39 is mainline until 2.40 ships, and 2.38 becomes the mainline after that.
Sequence: backport files to 2.38 and 2.39 (this PR and its sibling), then delete duplicated rules from coder.com, then slim the router's static file to URL-scheme rules.
Note
Generated by Coder Agents on behalf of @nickvigilante.