Skip to content

docs: own the legacy content redirects on 2.39 - #32640

Merged
nickvigilante merged 1 commit into
release/2.39from
docs/redirects-backport-2.39
Nov 23, 2026
Merged

nickvigilante merged 1 commit into
release/2.39from
docs/redirects-backport-2.39

Conversation

@nickvigilante

Copy link
Copy Markdown
Collaborator

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.

  • 314 rules, built from coder.com's redirects.json and the router's static redirects.json.
    URL-scheme rules (coder-oss, coder, v1, v2, code-server) and tagged-release patterns stay in the router.
  • Destinations are 2.39's own pages, so they differ from main's file where the docs tree has since moved.
  • about/architecture goes to /.
    The retired security advisory goes to GitHub Security Advisories, because its old blob URL returns 404.
    contributing/* becomes nine exact rules, because about/contributing has no pages.
    The ai-bridge and agent-boundaries exact rules sit above their wildcards.
  • The file keeps its 5 existing rules, omits the router's /docs/about rule (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/docsredirectscheck and go 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:

  1. /docs to /docs within one version (a wildcard or branch slug such as @main next): the version's docs/redirects.json in coder/coder.
  2. /docs to /docs across versions: the router's redirects.json in coder/docs-engine.
  3. Non-/docs source to a /docs destination: coder.com and coder.com-new.
  4. /docs source to a non-/docs destination: the router's redirects.json.
  5. Unversioned /docs/x to /docs/y is mainline same-version content, so it belongs to the release branch that is mainline.

Findings behind this PR:

  • coder.com and the router held about 300 unversioned content rules, many with destinations from the old docs tree.
    The router README says static rules answer before a version's own rules on the mainline, so the stale copies win.
  • docs/redirects.json existed on main and release/2.39 only.
    2.39 is mainline until 2.40 ships, and 2.38 becomes the mainline after that.
  • Where destinations conflict, the current tree for that branch wins.

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.

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.
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hey @nickvigilante!

This PR is targeting the release/2.39 release branch, but its title does not start with fix: or fix(scope):.

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:

fix: description of the bug fix
fix(scope): description of the bug fix

If this is not a bug fix, it likely should not target a release branch.

@Jesswinters Jesswinters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/about rule is fine. about has no page of its own on 2.39 (only about/screenshots), so the router's static rule keeps answering it until the router is slimmed. When that happens, keep /docs/about → /docs in the router, or add an exempt form here, so /docs/about doesn't start returning a 404.
  • The sibling 2.38 file (#32639) lacks this file's older templates, templates/* and workspaces rules. I suggested adding them there for parity.
  • CI is green.

This review was generated by Coder Agents on behalf of @Jesswinters.

@nickvigilante
nickvigilante enabled auto-merge (squash) November 23, 2026 23:03
@nickvigilante
nickvigilante merged commit 41f423b into release/2.39 Nov 23, 2026
55 checks passed
@nickvigilante
nickvigilante deleted the docs/redirects-backport-2.39 branch November 23, 2026 23:36

This branch had an error being deployed

1 failed deployment
docs-preview — c395f5d1 Deployed Nov 23, 2026 by nickvigilante via cleanup #373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants