Skip to content

[ci] Drop the doc tag from the API-surface consistency checks - #64777

Closed
dstrodtman wants to merge 3 commits into
ray-project:masterfrom
dstrodtman:doc-1387-drop-doc-tag-api-checks
Closed

dstrodtman wants to merge 3 commits into
ray-project:masterfrom
dstrodtman:doc-1387-drop-doc-tag-api-checks

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Draft — do not merge before the stub-generation decouple PR (#64423) lands. This is the final cleanup in the doc-CI tag reorg and is coupled to that PR; see Coordination below. Batch the review with #64775 and #64423.

Why

The two API-surface premerge steps in .buildkite/doc.rayci.yml

  • doc: check API annotations (api_annotations)
  • doc: check API doc consistency (api_policy_check)

each carry the full library tag list plus the blanket doc tag. They are code/doc surface-consistency checks — they verify that the annotated public API and the documented API surface agree — not documentation-quality validation. The doc tag on them is now redundant:

Concretely, the doc tag currently makes these two steps fire on .vale config, top-level doc/*.py/doc/*.rst, docs dependency locks, .readthedocs.yaml, and edits to doc.rayci.yml itself. None of those can change the API surface.

What

Remove the doc tag from both steps. They keep their full library tag list (core_python, dashboard, ray_client, data, serve, ml, tune, train, llm, rllib, rllib_gpu) and the docs-go skip, so a library code change still runs them exactly as before. After this, their trigger set is purely code and library tags.

Coordination / merge order

api_policy_check today generates its autosummary stub fixtures as a side effect of a full make -C doc/ html render, so it still has a genuine rendering dependency. #64423 removes that (stubs generated standalone). Only once #64423 is in does api_policy_check have no rendering dependency and can its trigger set safely be code-and-library-tags only. Hold this merge until #64423 lands.

No file overlap with #64423 or #64775 — this touches only doc.rayci.yml, which neither of those PRs modifies — so it applies cleanly on master; the dependency is purely merge-ordering.

Verification

  • Routing analysis against .buildkite/test.rules.txt: after the drop, both steps are triggered only by their retained library tags; doc/source/** paths (including conf.py and the stub-generation machinery) route to # pass and never emitted doc, so no API-surface coverage is lost. The steps stop firing on Vale/deplock/narrative-doc changes and on self-edits to doc.rayci.yml, all intended.
  • Remaining gate: confirm the tag composition on a real premerge run — that both steps still fire on a library code change and no longer fire on a doc-validation-infra change.

AI assistance was used to prepare this change; the author has reviewed every changed line and will confirm the premerge tag composition before taking it out of draft.

Not a duplicate

Searched open Ray PRs for the API-surface check steps and the doc tag reorg; the related PRs (#64775, #64423, #64420) deliberately leave these two steps' tags alone. This is the tracked follow-up that completes that reorg.

The api_annotations and api_policy_check premerge steps verify that the
annotated and documented API surfaces agree. They are code/doc
surface-consistency checks, not documentation validation, so the blanket
doc tag on them is redundant now that executable doc example tests route
to dedicated per-library tags. Both steps keep their full library tag
list and the docs-go skip, so a library code change still runs them
exactly as before; their trigger set is now purely code and library
tags.

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

@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 removes the doc tag from the doc_api_annotations and doc_api_policy_check steps in the Buildkite configuration file .buildkite/doc.rayci.yml. There are no review comments, and I have no feedback to provide.

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]>
@dstrodtman
dstrodtman marked this pull request as ready for review August 5, 2026 13:44
@dstrodtman
dstrodtman requested a review from a team as a code owner August 5, 2026 13:44

@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 Buildkite configuration in .buildkite/doc.rayci.yml by removing the doc tag from the doc_api_annotations and doc_api_policy_check steps. There are no review comments, so no additional feedback is provided.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 1b3b0b7. Configure here.

Comment thread .buildkite/doc.rayci.yml
- llm
- rllib
- rllib_gpu
- doc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

API check loses doc-infra coverage

Medium Severity

Dropping the doc tag from api_policy_check stops that step from running when its own inputs change. doc/source/api_autogen.py and doc/source/api_mock_imports.py both emit doc (see test.rules.txt / test.rules.test.txt), and lint.sh api_policy_check invokes them directly. After this change, edits to that stub/mock machinery no longer trigger the consistency check on premerge; the PR claim that those paths route to # pass does not match the current rules.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1b3b0b7. Configure here.

@dstrodtman

Copy link
Copy Markdown
Contributor Author

Closing this unmerged: #64775 landed and inverted the premise this PR was built on.

The rationale here was that after #64775, executable doc assets route to per-library tags and prose can't change the API surface, so doc on the two API-surface checks is redundant. That reasoning covers executable doc assets and prose but misses the third category #64775 created. The doc tag is no longer the broad prose tag it was when this PR was opened — it now belongs to the documentation validation infra block in test.rules.txt, which contains doc/source/conf.py, api_autogen.py, api_mock_imports.py, custom_directives.py, doc/source/_ext/, and doc/requirements-doc.txt, plus python/deplocks/docs/*.lock and ci/raydepsets/configs/docs.depsets.yaml from the deplock rule.

Those are the direct inputs to lint.sh api_policy_check. So dropping doc here would stop the consistency check firing when its own stub generator, its mock list, or the docs dependency locks change. Cursor Bugbot flagged the same thing on .buildkite/doc.rayci.yml:75 and is correct, including that this PR's description claim about those paths routing to # pass doesn't match the current rules.

The over-triggering instinct behind this PR is still right — .vale.ini, the gallery configs, and .readthedocs.yaml all emit doc and can't affect the API surface. But the fix isn't dropping doc from these steps, it's splitting the tag so the autodoc machinery routes to the API checks and the pure-rendering surface doesn't. #64812 already introduces a doc_api tag for the per-library API reference directories, which are prose-skipped today and currently trigger no check at all. Extending that tag to cover the machinery files above gets the cleanup this PR wanted with no coverage loss, in one change instead of two.

Continuing in #64812.

@dstrodtman dstrodtman closed this Aug 5, 2026
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.

1 participant