Repository navigation
docs: own the legacy content redirects on 2.38 - #32639
Conversation
Moves coder.com's and the docs router's unversioned content redirects into docs/redirects.json, so 2.38 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. 310 rules against 463 routes. I also ran main's docsredirectscheck with this file and 2.38's manifest: 310 rules OK.
P3 (non-blocking)
- 2.39's file keeps four older rules that 2.38's file lacks:
templates→admin/templates,templates/open-in-coder,templates/troubleshooting, andworkspaces→user-guides/workspace-management. coder.com doesn't hold these either, so they aren't part of "moving" anything. However, all four destinations exist on 2.38 and the sources aren't pages there, so/docs/v2.38/templates404s today while/docs/v2.39/templatesredirects. Adding them would make the two lines match. - 2.38 uses the relative form and 2.39 uses
/docs/..., because each branch's checker forces it. The engine normalizes both, so this is just a note. - CI:
Analyze PR for Documentation Updates Neededfails in its setup step (CODER_URL/CODER_TOKENcheck), which is infrastructure and has nothing to do with this file. Everything else is green. - The PR body says "Do not remove the matching rules … until this is merged and 2.38 is republished". That's the right order, because the router's static rules answer first on the mainline.
This review was generated by Coder Agents on behalf of @Jesswinters.
Adds four rules to 2.38's `docs/redirects.json` that 2.39's file already has, so `/docs/v2.38/templates` and the other three stop returning 404 where `/docs/v2.39/...` redirects: - `templates` to `admin/templates` - `templates/open-in-coder` to `admin/templates/open-in-coder` - `templates/troubleshooting` to `admin/templates/troubleshooting` - `workspaces` to `user-guides/workspace-management` All four destinations are pages on 2.38 and none of the sources are. 2.38 becomes the mainline after 2.40 ships. `main` needs no change: these four are live pages there. Follow-up to #32639, from Jess's review. Checks: main's `docsredirectscheck` against this branch (`-base origin/release/2.38 -branch release/2.38`): 314 rules OK, 767 routes still resolve. This branch has no checker, so CI does not lint the file. > [!NOTE] > Generated by Coder Agents on behalf of @nickvigilante.
Moves the unversioned docs content redirects that coder.com and the docs router (coder/docs-engine) hold for 2.38 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.Validation
Main's
docsredirectscheck(-base origin/release/2.38 -branch release/2.38) against this branch's manifest: 310 rules OK, 464 routes still resolve.This branch has no
docsredirectscheck, so CI does not lint the file. Backporting the checker is out of scope.Do not remove the matching rules from coder.com or the router until this is merged and 2.38 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.