Skip to content

[doc] Redirect template URLs that 404 since the move to _collections - #66459

Merged
dstrodtman merged 1 commit into
masterfrom
doc-1698-template-redirects
Sep 24, 2026
Merged

dstrodtman merged 1 commit into
masterfrom
doc-1698-template-redirects

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

The Ray example and tutorial templates are fetched at doc build time through sphinx-collections (doc/source/template_collections.py) and build under /_collections/<target>/. #63971 deleted the stale in-tree copies, but no redirects were added for the URLs those copies served.

Probing docs.ray.io shows where it broke:

  • releases-2.55.1 and earlier: the old path, such as /ray-overview/examples/e2e-rag/README.html, returns 200. The /_collections/ path returns 404.
  • releases-2.56.0 and later, including /latest and /master: the old path returns 404. The /_collections/ path returns 200.

So since 2.56.0 became /latest, external links and search results pointing at the old template pages have returned 404. Some of the old paths fall under the legacy catch-alls (/serve/tutorials/*, /train/examples/*, /tune/examples/*), which land readers on a generic index instead of the page they wanted.

What

This PR adds 63 page redirects to doc/redirects/current.yaml, one per removed template URL that was actually served on 2.55.1, each pointing at that page's /_collections/ path:

  • 40 move 1:1, so the target is /_collections/<same path>.
  • 23 lived under a content/ directory the sync no longer produces, so the target drops that segment. A few single-notebook templates now build only a README, so those point at the README: unstructured_data_ingestion, tune_pytorch_asha, and model_composition_recsys, which was renamed to model-composition-recsys.

The block sits right after the Ray Data rules and ahead of every wildcard rule, so the specific rules win over the catch-alls. page rules without force fire only on 404, so 2.55 and earlier keep serving their own in-tree copies.

Out of scope, and deliberately skipped:

  • 9 removed paths that already returned 404 on 2.55.1, because they were excluded from the build. These are the llamafactory-llm-fine-tune pages and two train/tutorials/content/*/README indexes.
  • 3 paths whose only 2.55.1 response was a catch-all 301, so they were never pages.

Related PRs

Testing

  • Built the URL list from git show --name-status 70eade0bd3a ([templates] removing outdated templates that are now being synced to ray docs at build time #63971), keeping deleted pages whose URL isn't produced at HEAD.
  • Probed every old URL on releases-2.55.1, and every candidate target on /en/master/. Targets were cross-checked against the _collections/ docnames in the live objects.inv. All 63 targets return 200.
  • rtd-redirects validate doc/redirects/current.yaml: 0 errors. It reports the same 44 pre-existing chain warnings as master and none from the new rules.
  • rtd-redirects diff-file --file doc/redirects/current.yaml --base upstream/master --head HEAD --repo .: 63 add, 0 update, 0 delete.
  • rtd-redirects plan --project anyscale-ray --file doc/redirects/current.yaml against the live project: 63 add, 0 update, 0 delete. The reorders are position shifts from the insertion.
  • pre-commit run --files doc/redirects/current.yaml: passes.
  • Five mcp-ray-serve paths contain spaces, and one also contains parentheses. Read the Docs matches redirects on the Django-decoded request path, so a %20 request should match the literal space in from. I'll confirm that with a live request after apply.

AI assistance

This PR was prepared with AI assistance (Claude Code). I reviewed every added rule and the probe results above.

🤖 Generated with Claude Code

The Ray example and tutorial templates now build from sphinx-collections
under /_collections/<target>/. #63971 deleted the in-tree copies, and from
Ray 2.56.0 on their old URLs return 404 with no redirect.

Add 63 page redirects, one per old URL that was served on 2.55.1, each to
the page's /_collections/ path. Page rules without force fire only on 404,
so 2.55 and earlier keep serving their own copies.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners September 24, 2026 16:21
@dstrodtman dstrodtman added docs An issue or change related to documentation go add ONLY when ready to merge, run all tests labels Sep 24, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates documentation redirect paths in doc/redirects/current.yaml to align with the new _collections directory structure. A review comment correctly identified that the redirect for langchain_agent_ray_serve incorrectly retains the content/ segment in the target path, which should be removed to prevent potential 404 errors.

Comment thread doc/redirects/current.yaml Resolved
@dstrodtman
dstrodtman merged commit 0721600 into master Sep 24, 2026
5 checks passed
@dstrodtman
dstrodtman deleted the doc-1698-template-redirects branch September 24, 2026 16:59
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ay-project#66459)

## Why are these changes needed?

The Ray example and tutorial templates are fetched at doc build time
through `sphinx-collections` (`doc/source/template_collections.py`) and
build under `/_collections/<target>/`. ray-project#63971 deleted the stale in-tree
copies, but no redirects were added for the URLs those copies served.

Probing docs.ray.io shows where it broke:

- `releases-2.55.1` and earlier: the old path, such as
`/ray-overview/examples/e2e-rag/README.html`, returns 200. The
`/_collections/` path returns 404.
- `releases-2.56.0` and later, including `/latest` and `/master`: the
old path returns 404. The `/_collections/` path returns 200.

So since 2.56.0 became `/latest`, external links and search results
pointing at the old template pages have returned 404. Some of the old
paths fall under the legacy catch-alls (`/serve/tutorials/*`,
`/train/examples/*`, `/tune/examples/*`), which land readers on a
generic index instead of the page they wanted.

## What

This PR adds 63 `page` redirects to `doc/redirects/current.yaml`, one
per removed template URL that was actually served on 2.55.1, each
pointing at that page's `/_collections/` path:

- 40 move 1:1, so the target is `/_collections/<same path>`.
- 23 lived under a `content/` directory the sync no longer produces, so
the target drops that segment. A few single-notebook templates now build
only a `README`, so those point at the `README`:
`unstructured_data_ingestion`, `tune_pytorch_asha`, and
`model_composition_recsys`, which was renamed to
`model-composition-recsys`.

The block sits right after the Ray Data rules and ahead of every
wildcard rule, so the specific rules win over the catch-alls. `page`
rules without `force` fire only on 404, so 2.55 and earlier keep serving
their own in-tree copies.

Out of scope, and deliberately skipped:

- 9 removed paths that already returned 404 on 2.55.1, because they were
excluded from the build. These are the `llamafactory-llm-fine-tune`
pages and two `train/tutorials/content/*/README` indexes.
- 3 paths whose only 2.55.1 response was a catch-all 301, so they were
never pages.

## Related PRs

- ray-project#63971 removed the in-tree template copies.
- ray-project#66427 fixes the postmerge redirect apply step. Once it merges, this
change goes live on the next postmerge run. Until then, a maintainer
applies it manually.
- Duplicate check: no open PR touches template redirects. The only other
open PRs that touch `doc/redirects/` are ray-project#66427 (CI apply gate) and
ray-project#66027 (release-gated `master.yaml`), and neither adds these rules.
ray-project#66027 also edits `current.yaml`, so whichever merges second might need
a trivial rebase.

## Testing

- Built the URL list from `git show --name-status 70eade0` (ray-project#63971),
keeping deleted pages whose URL isn't produced at HEAD.
- Probed every old URL on `releases-2.55.1`, and every candidate target
on `/en/master/`. Targets were cross-checked against the `_collections/`
docnames in the live `objects.inv`. All 63 targets return 200.
- `rtd-redirects validate doc/redirects/current.yaml`: 0 errors. It
reports the same 44 pre-existing chain warnings as master and none from
the new rules.
- `rtd-redirects diff-file --file doc/redirects/current.yaml --base
upstream/master --head HEAD --repo .`: 63 add, 0 update, 0 delete.
- `rtd-redirects plan --project anyscale-ray --file
doc/redirects/current.yaml` against the live project: 63 add, 0 update,
0 delete. The reorders are position shifts from the insertion.
- `pre-commit run --files doc/redirects/current.yaml`: passes.
- Five `mcp-ray-serve` paths contain spaces, and one also contains
parentheses. Read the Docs matches redirects on the Django-decoded
request path, so a `%20` request should match the literal space in
`from`. I'll confirm that with a live request after apply.

## AI assistance

This PR was prepared with AI assistance (Claude Code). I reviewed every
added rule and the probe results above.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants