Skip to content

[docs] Fix content rot in ray-contribute docs and testing-tips - #64770

Merged
elliot-barn merged 3 commits into
ray-project:masterfrom
dstrodtman:doc-1385-contribute-content-rot
Jul 17, 2026
Merged

elliot-barn merged 3 commits into
ray-project:masterfrom
dstrodtman:doc-1385-contribute-content-rot

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why

The ray-contribute pages were recently converted rST → MyST and soft-wrapped, but those were format-only passes and left several content-level problems in doc/source/ray-contribute/docs.md and testing-tips.md. This PR fixes the stale content and reconciles contradictions with writing-style.md and the shipped tooling.

What changed

  • Modernize the RLlib notebook example (docs.md, "Creating a notebook example"). The example used the long-removed ray.rllib.agents.ppo / PPOTrainer API, CartPole-v0, and an unused from ray import serve import. Replaced with the current PPOConfig().environment("CartPole-v1") → build_algo() → train() pattern, matching the canonical snippet in doc/source/rllib/getting-started.rst.
  • Fix the API-reference example (docs.md, "Adding API references"). It documented ray.tune.integration.docker.DockerSyncer (module removed) and ray.tune.integration.keras.TuneReportCallback (deprecated), and claimed the snippet came from tune/api/integration.rst (which now uses autosummary, not autofunction/autoclass). Switched to two current public APIs, ray.tune.register_env and ray.tune.Tuner, and pointed the "change the source" link at the live registry.py on master.
  • Reconcile the Vale scope (docs.md). It said Vale is enforced only on the Ray Data docs; the CI lint (ci/lint/check-documentation-style.sh) runs Vale on both doc/source/data and doc/source/ray-overview/examples. Updated to "the Ray Data documentation and the example gallery," matching writing-style.md.
  • State the MyST-for-new-pages policy (docs.md). It presented rST and MyST as an equal free choice. Updated to state that new pages must be MyST Markdown and that a lint check rejects newly added .rst files, matching writing-style.md.
  • Drop the stale TravisCI reference (testing-tips.md). Ray uses Buildkite, not TravisCI. Generalized the "limited cores" example to a CI environment and removed the dead TravisCI link.
  • De-pin two hard-coded commit SHAs to master (docs.md): the WordList.yml link and the API-reference source link, so they track current content instead of rotting against a frozen commit.

Not a duplicate

No open PR touches doc/source/ray-contribute/docs.md or testing-tips.md (checked gh pr list --search). PR #64450 in the same area is a separate topic (running the API consistency check locally).

Testing

  • Verified every referenced API against the source tree in this checkout: ray.tune.register_env (python/ray/tune/registry.py, exported in ray.tune), ray.tune.Tuner (@PublicAPI(stability="beta")), and confirmed ray.rllib.agents / PPOTrainer and ray.tune.integration.docker are gone.
  • The changed RLlib snippet is illustrative MyST (a fenced example and a rendered block), not a CI-executed code cell, so no automated test runs it. It mirrors the tested canonical pattern in getting-started.rst.
  • I did not run the full Sphinx docs build in this environment. These are prose-only changes to two non-code pages with no new files or cross-references, so build risk is minimal, but the docs build in CI (and a local make rtd-build) is the authoritative check.

AI assistance (Claude Code) was used to prepare this change.

@dstrodtman
dstrodtman requested review from a team as code owners July 15, 2026 13:35

@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 the Ray contribution documentation. Key changes include clarifying that new documentation pages must be written in MyST Markdown (.md), updating API reference examples to use modern APIs (such as ray.tune.register_env, ray.tune.Tuner, and PPOConfig), updating Vale linting details, and removing outdated references to TravisCI in the testing tips. The feedback suggests changing "common markdown compliant" to "CommonMark-compliant" for technical accuracy, as CommonMark is a specific standardized specification.

Comment thread doc/source/ray-contribute/docs.md Resolved
@dstrodtman dstrodtman added the docs-go RtD-only checks for docs-only changes. Doesn't run full library doc-test suites. label Jul 15, 2026
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Jul 15, 2026
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Jul 16, 2026
dstrodtman pushed a commit to ArturNiederfahrenhorst/ray that referenced this pull request Jul 16, 2026
(documented-exactly-once) policies to the API-doc consistency check, and
(whose white_list_apis was left empty). The stricter check now flags ~30
pre-existing RLlib doc entries, failing the "doc: check API doc
consistency" premerge job on every PR that merges current master.

This fixes the RLlib side:

Unresolved doc entries:
- De-double autoclass targets that combined `.. currentmodule::` with a
  fully-qualified name (RLlink, ConnectorV2, ConnectorPipelineV2, the
  observation preprocessors, and the RLModule `apis` classes) by making the
  autoclass argument relative to its currentmodule.
- RLModuleSpec dataclass fields -> `.. autoattribute:: ... :no-index:`
  (mirrors the existing MultiRLModuleSpec block).
- RLModule instance attributes (observation_space, action_space,
  inference_only, model_config) are assigned in setup(), not on the class,
  so they resolve to None; exempt them via doc_only_whitelist.

Documented private/dunder objects:
- Whitelist the intentional override contract (RLModule._forward*,
  Learner._make_module).
- Remove doc entries for internal helpers (Learner._check_is_built /
  _check_registered_optimizer / _set_optimizer_lr / _get_clip_function,
  Scheduler._create_tensor_variable, OfflineData/OfflinePreLearner privates,
  SingleAgentEpisode/MultiAgentEpisode.__len__).

Duplicate documentation:
- Mark intentional cross-page duplicates as intentional_duplicate_apis
  (AlgorithmConfig.build_learner / build_learner_group / learners;
  Checkpointable.save_to_path / restore_from_path, inherited and shown on
  each subclass page).

Not a duplicate of open work: ray-project#64777 changes which CI tag runs the check
and ray-project#64770 is unrelated docs content; no open PR touches
cmd_check_api_discrepancy.py or the RLlib exemptions.

Test: `python ci/ray_ci/doc/cmd_check_api_discrepancy.py <ray_dir> rllib`
exits 0 (was exit 1). AI assistance (Claude Code) was used; the change has
been reviewed and is defended by the human submitter.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Artur Niederfahrenhorst <[email protected]>
setup_hooks.sh also installs the prepare-commit-msg hook that adds the
Signed-off-by trailer, but getting-involved.md described it only as a
linter hook. Note the DCO requirement and the manual 'git commit -s'
fallback so contributors don't hit a failing DCO check unexplained.

Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman

Copy link
Copy Markdown
Contributor Author

Added a commit surfacing the DCO sign-off requirement in getting-involved.md: setup_hooks.sh also installs the prepare-commit-msg hook that adds the Signed-off-by trailer, but the step described it only as a linter hook. The note now covers the DCO requirement and the manual git commit -s fallback. Scope is now 3 files; the docs.md/testing-tips.md changes are unchanged.

@elliot-barn
elliot-barn merged commit 493e689 into ray-project:master Jul 17, 2026
3 checks passed
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…roject#64770)

## Why

The `ray-contribute` pages were recently converted rST → MyST and
soft-wrapped, but those were format-only passes and left several
content-level problems in `doc/source/ray-contribute/docs.md` and
`testing-tips.md`. This PR fixes the stale content and reconciles
contradictions with `writing-style.md` and the shipped tooling.

## What changed

- **Modernize the RLlib notebook example** (`docs.md`, "Creating a
notebook example"). The example used the long-removed
`ray.rllib.agents.ppo` / `PPOTrainer` API, `CartPole-v0`, and an unused
`from ray import serve` import. Replaced with the current
`PPOConfig().environment("CartPole-v1")` → `build_algo()` → `train()`
pattern, matching the canonical snippet in
`doc/source/rllib/getting-started.rst`.
- **Fix the API-reference example** (`docs.md`, "Adding API
references"). It documented `ray.tune.integration.docker.DockerSyncer`
(module removed) and `ray.tune.integration.keras.TuneReportCallback`
(deprecated), and claimed the snippet came from
`tune/api/integration.rst` (which now uses `autosummary`, not
`autofunction`/`autoclass`). Switched to two current public APIs,
`ray.tune.register_env` and `ray.tune.Tuner`, and pointed the "change
the source" link at the live `registry.py` on `master`.
- **Reconcile the Vale scope** (`docs.md`). It said Vale is enforced
only on the Ray Data docs; the CI lint
(`ci/lint/check-documentation-style.sh`) runs Vale on both
`doc/source/data` and `doc/source/ray-overview/examples`. Updated to
"the Ray Data documentation and the example gallery," matching
`writing-style.md`.
- **State the MyST-for-new-pages policy** (`docs.md`). It presented rST
and MyST as an equal free choice. Updated to state that new pages must
be MyST Markdown and that a lint check rejects newly added `.rst` files,
matching `writing-style.md`.
- **Drop the stale TravisCI reference** (`testing-tips.md`). Ray uses
Buildkite, not TravisCI. Generalized the "limited cores" example to a CI
environment and removed the dead TravisCI link.
- **De-pin two hard-coded commit SHAs** to `master` (`docs.md`): the
`WordList.yml` link and the API-reference source link, so they track
current content instead of rotting against a frozen commit.

## Not a duplicate

No open PR touches `doc/source/ray-contribute/docs.md` or
`testing-tips.md` (checked `gh pr list --search`). PR ray-project#64450 in the same
area is a separate topic (running the API consistency check locally).

## Testing

- Verified every referenced API against the source tree in this
checkout: `ray.tune.register_env` (`python/ray/tune/registry.py`,
exported in `ray.tune`), `ray.tune.Tuner`
(`@PublicAPI(stability="beta")`), and confirmed `ray.rllib.agents` /
`PPOTrainer` and `ray.tune.integration.docker` are gone.
- The changed RLlib snippet is illustrative MyST (a fenced example and a
rendered block), not a CI-executed code cell, so no automated test runs
it. It mirrors the tested canonical pattern in `getting-started.rst`.
- I did not run the full Sphinx docs build in this environment. These
are prose-only changes to two non-code pages with no new files or
cross-references, so build risk is minimal, but the docs build in CI
(and a local `make rtd-build`) is the authoritative check.

AI assistance (Claude Code) was used to prepare this change.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[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 docs An issue or change related to documentation docs-go RtD-only checks for docs-only changes. Doesn't run full library doc-test suites. go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants