Skip to content

[doc][core] Move four API reference pages into the Ray Core API section - #66751

Merged
dstrodtman merged 1 commit into
masterfrom
doc-1747-api-ref-page-moves
Oct 6, 2026
Merged

dstrodtman merged 1 commit into
masterfrom
doc-1747-api-ref-page-moves

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

Four API reference pages live outside the APIs tab, so the shared API sidebar and the API_PATH_PREFIXES page set don't include them. This PR moves them into core/api/:

Old path New path
ray-observability/reference/api.rst core/api/state.rst
cluster/running-applications/job-submission/jobs-package-ref.md core/api/job-submission.md
core/compiled-graph/compiled-graph-api.rst core/api/compiled-graph.rst
cluster/running-applications/autoscaling/reference.md core/api/autoscaler.md

This is a pure path change: all four files are 100% renames with no content edits. Everything else in the diff follows from the move:

  • Navigation. The Core API toctree (core/api/index.md) now lists all four pages. The old parent toctrees point at the new paths, so the pages stay reachable from their original sections.
  • Redirects. doc/redirects/current.yaml gains one page rule per moved page, plus wildcard rules for the generated per-symbol stubs, which move from each page's old doc/ directory to core/api/doc/. All rules use the default force: false. Existing rules that point at the old paths are left alone, so older doc versions keep resolving them.
  • Dead stub-directory patterns. Only these four pages generated stubs into ray-observability/reference/doc/, cluster/running-applications/job-submission/doc/, and core/compiled-graph/doc/. Their entries in conf.py (llms_txt_exclude, remove_from_toctrees), the doc/Makefile clean target, and doc/.gitignore are removed. Existing core/api/doc/* patterns cover the new location. One side effect: the compiled graph stubs were missing from remove_from_toctrees, so they're now pruned like every other API stub.
  • doc_api routing. The ray-observability/reference/ directory was in the doc_api rule only because the Core API toctree pulled in its api.rst. Now that the page lives in core/api/, the exception goes away in both .buildkite/test.rules.txt and _ALLOWED_ONLY_IN_RULE in ci/pipeline/test_doc_api_rules_sync.py. The remaining pages in that directory, cli.rst (click directives only), index.md, and system-metrics.rst, carry no autosummary or autoclass blocks, which are the only blocks the API consistency check parses. The test.rules.test.txt expectation moves to core/api/state.rst.

Effect on the Core API consistency check. The check walks the toctree from core/api/index.md, so it now also reads the job submission and compiled graph pages. The autoscaler page uses autofunction, which the check doesn't parse. I ran the check's Sphinx-free doc parser (ci/ray_ci/doc/autodoc.py) over the new walk. It finds 188 documented APIs, and the only names documented twice are ray.get, ray.put, ray.method, and ray.remote, all already in Core's intentional_duplicate_apis. ActorMethod.bind, documented in both core.rst and the compiled graph page, is also already exempt. None of the newly walked classes resolves to a private module path. I couldn't run the code-side half of the check locally because it needs a compiled Ray, so premerge's doc: check API doc consistency step is the gate for that half.

Stacking. This branch is stacked on #66605 (move Ray Core docs to doc/source/core), which touches the same surfaces: api_sidebar.py, apis/index.md, the redirects file, and the doc_api rules. Merge #66605 first. #66744 also edits doc/redirects/current.yaml, so expect a small rebase there.

Related issue number

None. This is groundwork for moving the API reference off Sphinx autodoc: every page the API reference generator needs to reproduce should live under an API_PATH_PREFIXES directory.

Checks

  • I've signed off every commit (DCO).
  • Duplicate-work check: gh pr list --repo ray-project/ray --state open --search "<area keywords>" found no open PR moving these pages. The overlapping PRs are [doc][core] Move Ray Core docs to doc/source/core and adopt index.md landings #66605, which this stacks on, and [docs] Group the Serve and Train API references and align API landing pages #66744, which only shares the redirects file.
  • bazel test //ci/pipeline:test_doc_api_rules_sync: PASSED.
  • rtd-redirects validate doc/redirects/current.yaml: 0 errors, 0 warnings. Chain notes went from 171 to 181, from the two-hop paths described above.
  • Tag dry run (Ray's determine_tests_to_run.py reference parser): core/api/state.rst and core/api/job-submission.md emit doc_api, and ray-observability/reference/{cli.rst,index.md} hit the prose skip rule.
  • make -C doc rtd-build (RtD-faithful, -W --keep-going, Python 3.11 and the docs lock): exactly one warning, _includes/_help.rst: document isn't included in any toctree. That orphan is in this branch's base ([doc][core] Move Ray Core docs to doc/source/core and adopt index.md landings #66605) and was already deleted on master by [doc] Delete the orphaned _includes/_help.rst #66750. With it removed locally, an incremental -W rebuild reports build succeeded. with zero warnings. The four pages render at core/api/{state,job-submission,compiled-graph,autoscaler}.html, and their 116 generated stubs render under core/api/doc/.
  • rtd-redirects simulate against [doc][core] Move Ray Core docs to doc/source/core and adopt index.md landings #66605 as the base, covering master (built HTML), latest, releases-2.55.0, and releases-2.40.0, with --prefix on all three old directories, sample stub URLs, and a stub rename map: 0 regressions and 0 new loops on every version. It still exits nonzero, for two reasons I checked by hand:
    • On master, 35 old stub URLs are flagged as "wrong landings" only because the before side is a git tree, which has no generated stubs. All 35 land on the identical stub under core/api/doc/ in one hop.
    • On every version, the synthetic sample stub (__simulate-sample__, a name that never existed) now lands on the Core API index instead of the observability landing page. Real stubs on older releases are still served directly, because the rules don't force.

AI assistance (Claude Code) was used to prepare this change. I reviewed every changed line.

@dstrodtman
dstrodtman requested review from a team as code owners October 5, 2026 20:02

@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 reorganizes the documentation structure by moving several API reference pages (including state, job-submission, compiled-graph, and autoscaler) under the centralized doc/source/core/api/ directory. It updates the corresponding build rules, toctrees, makefiles, and adds redirects to ensure backward compatibility. Feedback on this PR suggests adding the newly moved API reference hub pages (core/api/state, core/api/job-submission, and core/api/autoscaler) to the llms_txt_exclude list in doc/source/conf.py to keep them out of the LLM agent corpus, ensuring consistency with other Core API reference pages.

Comment thread doc/source/conf.py Resolved
@dstrodtman
dstrodtman force-pushed the doc-1747-api-ref-page-moves branch from fc4ec46 to 7a40195 Compare October 5, 2026 20:22
@ray-gardener ray-gardener Bot added the core Issues that should be addressed in Ray Core label Oct 6, 2026
@dstrodtman
dstrodtman force-pushed the doc-1710-ray-core-dir-move branch from 879e1dc to f561614 Compare October 6, 2026 16:28
@dstrodtman
dstrodtman requested a review from a team as a code owner October 6, 2026 16:28
Base automatically changed from doc-1710-ray-core-dir-move to master October 6, 2026 18:34
@dstrodtman
dstrodtman force-pushed the doc-1747-api-ref-page-moves branch from 7a40195 to a6bbb8c Compare October 6, 2026 18:34
Move the reference pages that sit outside the APIs tab into core/api/,
so every page the API-consistency check walks lives under an
API_PATH_PREFIXES directory:

- ray-observability/reference/api.rst -> core/api/state.rst
- cluster/running-applications/job-submission/jobs-package-ref.md
  -> core/api/job-submission.md
- core/compiled-graph/compiled-graph-api.rst -> core/api/compiled-graph.rst
- cluster/running-applications/autoscaling/reference.md
  -> core/api/autoscaler.md

Pure path change: toctree references follow the files, redirects cover
the old page and generated-stub URLs, and the build, llms.txt, and
gitignore patterns for the old stub directories are removed. With the
observability API page inside core/api/, the doc_api rule no longer
needs its ray-observability/reference/ exception.

Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1747-api-ref-page-moves branch from a6bbb8c to 423257c Compare October 6, 2026 18:36
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 6, 2026
@dstrodtman
dstrodtman enabled auto-merge (squash) October 6, 2026 19:03
@dstrodtman
dstrodtman merged commit 1a9ba71 into master Oct 6, 2026
8 checks passed
@dstrodtman
dstrodtman deleted the doc-1747-api-ref-page-moves branch October 6, 2026 19:20
dstrodtman added a commit that referenced this pull request Oct 7, 2026
)

## Why are these changes needed?

Stacked on #66744.

A Sphinx build of master logs 265 `document is referenced in multiple
toctrees` messages. They're info-level, so they don't fail the build,
but every one marks a page whose sidebar parent and breadcrumb Sphinx
has to choose arbitrarily. This PR removes 245 of them. The other 20 are
on Ray Core API pages and are left for separate follow-ups.

### Autosummary entries listed twice (240)

Most duplicates come from a hand-written API page that lists a class
with `:toctree: doc/` and then lists that class's methods in further
`:toctree:` blocks. The class stub, rendered from
`_templates/autosummary/class.rst`, already lists every documented
method in its own `:toctree:` autosummary, so each method stub ends up
with two parents. Similarly, `train/api/deprecated.rst` re-lists APIs
that the Train API pages also list, and `data/api/saving_data.rst`
re-lists `Dataset` methods that the Dataset page owns.

The fix drops `:toctree:` from the duplicated entries only. The tables
still render and link to the same stub pages, since autosummary links
entries by object reference. The stubs are still generated, because
autosummary recurses into generated stubs and the class stub's own
`:toctree:` block covers them. Where a block mixed duplicated and unique
entries, it's split into consecutive blocks in the original order, so
only the duplicated runs lose `:toctree:`. That split adds a small gap
between table rows on a few pages, for example `Learner` /
`Learner.build` / `Learner._make_module` in the RLlib Learner reference.

Files: RLlib `package_ref` (12 pages), Tune `api` (9 pages), Data
`saving_data` and `preprocessor`, Train `deprecated`.

### Hand-written navigation duplicates (3 pages)

- `cluster/vms/user-guides/community/index.md` had a hidden toctree
repeating `yarn`, `slurm`, and `lsf` from the visible toctree below it.
Removed the hidden one.
- `ray-references/faq.md`, an orphan page, listed `tune/faq` in a
toctree that competed with `tune/index`. It's now a plain `{doc}` link.
- `ray-observability/ray-distributed-debugger.md` sat in both
`ray-observability/index.md` and `user-guides/debug-apps/index.md`. Kept
it in the top-level observability toctree, which matches the file's
location, and removed it from the debug-apps toctree. The debug-apps
page still links it from its bullet list. **Reviewer call:** if the
debugger should live under Debugging Applications in the sidebar
instead, flip which toctree keeps it.

### Left for follow-ups (20)

These were deferred while #66605 (Ray Core directory move) and #66751
(API reference page moves) were in flight. Both have merged, and the
duplicates remain on the moved pages:

- 13 come from #66751 keeping each moved page in its original section's
toctree as well as in `core/api/index.md`: `core/api/job-submission.md`
and its eight `JobSubmissionClient` method stubs,
`job-submission/cli.md`, `core/api/autoscaler.md`,
`core/api/compiled-graph.rst`, and the `ActorMethod.bind` stub. Whether
those pages keep a second home in their original sections is a
navigation decision for that change, not a mechanical fix.
- 2 are `core/api/state.rst` and `ray-observability/reference/cli.rst`,
listed from both the observability reference index and the Core API
index.
- 5 are Core API stubs listed twice within `core/api/`: `ray.get`,
`ray.put`, and `ray.method` (`core` and `direct-transport`),
`ActorClass.options` (the `ActorClass` stub and `core`), and
`ray.remote` (twice in `core`).

## Related issue number

None.

## Checks

- Duplicate-work check: `gh pr list --repo ray-project/ray --state open
--search "toctree"` and a review of my open docs PRs found no other PR
addressing these messages. None of my other open PRs touch the files
changed here.
- `pre-commit run --files <changed files>` passed.
- The duplicate list comes from the RtD build log for #66744 (build
4527202). Each removed `:toctree:` entry was matched by fully qualified
name against a document that log reports as having a second parent, and
only entries on that list were changed.
- RtD preview build 4532297 succeeded and logged 18 `multiple toctrees`
messages, against 263 for #66744 before this change. It reported no
Sphinx warnings and no missing autosummary stubs. That build predates
the base branch's merge of #66605 and #66751, which brought the leftover
count to 20.
- After merging the current base, this branch's tree is identical to the
base plus the original dedupe commit, checked by applying that commit's
patch to the base tree and comparing tree hashes.

This PR was prepared with AI assistance (Claude Code).

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

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 7, 2026
## Why are these changes needed?

Fourteen guide pages and notebooks run Sphinx autodoc directly. Some of
them repeat an API reference entry, and others are the only place an API
is documented at all. This PR moves every one of those APIs into an API
reference page under `API_PATH_PREFIXES` and replaces the guide-page
directives with cross-references. After it merges, autodoc runs only on
API reference pages, which is what a future move of the API reference
off Sphinx autodoc needs.

**New API reference entries**

- **Ray integrations API** (`ray-more-libs/api/`, new): Ray on Spark
(`setup_ray_cluster`, `shutdown_ray_cluster`,
`setup_global_ray_cluster`), Ray Collective, and Dask on Ray
(`RayDaskCallback` and its `_ray_*` hook methods). The section is
registered in `API_PATH_PREFIXES`, the `doc_api` rule, the APIs landing
toctree, and the `llms_txt_exclude` and `remove_from_toctrees` stub
patterns.
- Ray Collective lists everything the old `automodule ... :members:`
rendered (26 documented functions in `ray.util.collective.collective`,
plus `register_collective_backend`), grouped by purpose. Only
`register_collective_backend` carries an annotation
(`PublicAPI(stability="alpha")`), so Ray Core reviewers might want to
trim internals such as `GroupManager` and `get_group_handle`.
- **RLlib:** the nine algorithm-specific config classes (`PPOConfig`
through `MARWILConfig`) go into `algorithm-config.rst`. They use the
existing `class_without_autosummary.rst` template, so each class gets
one page and no per-member stubs. `MemoryTrackingCallbacks` goes into
`callback.rst`, also with the one-page template, and `OldAPIStack` into
`utils.rst`.
- **Ray Core:** `PublicAPI`, `DeveloperAPI`, and `Deprecated` go into a
new "API stability annotations" section, and `AutoscalingCluster` into a
new "Testing utilities" section, both in `core/api/utility.rst`.
`ray.autoscaler.sdk.request_resources` loses its `:noindex:`, because it
had no indexed entry anywhere.

**Guide pages now cross-reference instead of rendering**

`rllib/algorithms.md`, `rllib/callback.md`, `rllib/dev.md`,
`ray-contribute/stability.md` (its `public-api-def` labels are kept),
`ray-contribute/fake-autoscaler.md`, `core/miscellaneous.md`,
`serve/advanced-guides/gang-scheduling.md`,
`cluster/vms/user-guides/community/spark.md`,
`ray-more-libs/ray-collective.md`, `ray-more-libs/dask-on-ray.md`, and
the Aim, Comet, MLflow, and Wandb Tune notebooks.

`DockerCluster` lives in `ray.autoscaler._private`, so instead of an API
entry, `fake-autoscaler.md` now links to its source.

**Redirects:** `/ray-more-libs/doc/*` → `/ray-more-libs/api/doc/:splat`
covers the Dask stubs that moved. The other APIs were rendered inline on
guide pages, so they had no standalone URL to redirect.

**Base:** #66605 and #66751 have merged, so this PR is rebased onto
master as a single commit. The content is unchanged from the version
reviewed against #66751.

## Related issue number

None. This follows up #66751.

## Checks

- [x] I've signed off every commit (DCO).
- [x] Duplicate-work check: `gh pr list --repo ray-project/ray --state
open --search "<area keywords>"` found no open PR covering these moves.
- [x] Autodoc census of `doc/source/` on this branch: no autodoc
directive outside `API_PATH_PREFIXES` except a syntax example inside a
code fence in `ray-contribute/docs.md`, which Sphinx never runs.
- [x] I ran `ci/ray_ci/doc/autodoc.py`, the API consistency check's own
doc parser, over the Core and RLlib walks. Every new entry parses to a
resolvable dotted name. An early draft listed fully qualified names
under an unrelated `currentmodule`, which the parser reads as
unresolvable; each new block now sets its own `currentmodule`. The only
duplicate names are ones already documented twice on master. I couldn't
run the code-side half of the check locally, so premerge is the gate for
that half.
- [x] `bazel test //ci/pipeline:test_doc_api_rules_sync`: PASSED with
the new `ray-more-libs/api/` prefix.
- [x] Tag dry run: `ray-more-libs/api/*` emits `doc_api`, and the edited
guide pages hit the prose skip rule.
- [x] `rtd-redirects validate`: 0 errors.
- [x] `make -C doc rtd-build` (RtD-faithful, `-W`), with the base
branch's orphaned `_includes/_help.rst` set aside (#66750 already
deleted it on master). The full build flagged one warning: `BCConfig`
inherits `training()` from `MARWILConfig` rather than overriding it, so
the BC line now links to the class and to `MARWILConfig.training()`.
After that fix, an incremental `-W` rebuild reports `build succeeded.` I
confirmed in the HTML that every new cross-reference resolves to its API
page or stub.
- [x] `MemoryTrackingCallbacks` uses the one-page template. The default
template generated 20 stubs, almost all for members inherited from
`RLlibCallback`, which would have shadowed the `RLlibCallback` entries.
- [x] `rtd-redirects simulate` for the Dask stub rule on master, latest,
and `releases-2.40.0`: no regressions, wrong landings, or new loops. Old
stub URLs reach the new stubs in one hop.

AI assistance (Claude Code) was used to prepare this change. I reviewed
every changed line.

Signed-off-by: Douglas Strodtman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core 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