Repository navigation
[docs] Fix content rot in ray-contribute docs and testing-tips - #64770
Conversation
Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
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.
Signed-off-by: Douglas Strodtman <[email protected]>
(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]>
|
Added a commit surfacing the DCO sign-off requirement in |
…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]>
Why
The
ray-contributepages were recently converted rST → MyST and soft-wrapped, but those were format-only passes and left several content-level problems indoc/source/ray-contribute/docs.mdandtesting-tips.md. This PR fixes the stale content and reconciles contradictions withwriting-style.mdand the shipped tooling.What changed
docs.md, "Creating a notebook example"). The example used the long-removedray.rllib.agents.ppo/PPOTrainerAPI,CartPole-v0, and an unusedfrom ray import serveimport. Replaced with the currentPPOConfig().environment("CartPole-v1")→build_algo()→train()pattern, matching the canonical snippet indoc/source/rllib/getting-started.rst.docs.md, "Adding API references"). It documentedray.tune.integration.docker.DockerSyncer(module removed) andray.tune.integration.keras.TuneReportCallback(deprecated), and claimed the snippet came fromtune/api/integration.rst(which now usesautosummary, notautofunction/autoclass). Switched to two current public APIs,ray.tune.register_envandray.tune.Tuner, and pointed the "change the source" link at the liveregistry.pyonmaster.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 bothdoc/source/dataanddoc/source/ray-overview/examples. Updated to "the Ray Data documentation and the example gallery," matchingwriting-style.md.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.rstfiles, matchingwriting-style.md.testing-tips.md). Ray uses Buildkite, not TravisCI. Generalized the "limited cores" example to a CI environment and removed the dead TravisCI link.master(docs.md): theWordList.ymllink 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.mdortesting-tips.md(checkedgh pr list --search). PR #64450 in the same area is a separate topic (running the API consistency check locally).Testing
ray.tune.register_env(python/ray/tune/registry.py, exported inray.tune),ray.tune.Tuner(@PublicAPI(stability="beta")), and confirmedray.rllib.agents/PPOTrainerandray.tune.integration.dockerare gone.getting-started.rst.make rtd-build) is the authoritative check.AI assistance (Claude Code) was used to prepare this change.