Skip to content

[doc] Document the documentation CI checks and the local API-check recipe - #65285

Merged
dstrodtman merged 4 commits into
ray-project:masterfrom
dstrodtman:doc-1426-ci-docs-steps-refresh
Aug 7, 2026
Merged

dstrodtman merged 4 commits into
ray-project:masterfrom
dstrodtman:doc-1426-ci-docs-steps-refresh

Conversation

@dstrodtman

@dstrodtman dstrodtman commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Why this change

doc/source/ray-contribute/ci.md explains what CI runs on a PR, but stops at microcheck and the go label. It says nothing about what runs when the PR changes documentation, which is the case the page's likely reader is in.

This adds that, and folds in a recipe for reproducing the API consistency check locally.

What's new

"Documentation CI checks" covers, in the order a contributor meets them:

  • The Read the Docs render gate, including that fail_on_warning: true makes any Sphinx warning a build failure, and when the preview build skips.
  • The two API surface checks, and the doc_api tag that lets an API reference page edit reach them even though it's a documentation change.
  • The per-library <library>: docs example tests steps, with a table mapping path to step to tag, plus the Ray Core fallback and the Ray LLM exception.
  • That a prose-only or image-only change runs no library test steps at all.
  • The docs-go label and the lint: validate docs-go scope guard that bounds it.
  • The two post-merge-only steps, doc: build and doc: linkcheck.

"Running the API consistency check locally" documents the three phases of api_policy_check, what the docbuild image does and doesn't install (the deep-learning backends are mocked even in CI), and a uv recipe that gets close enough for iteration.

It also updates one example commit message under the microcheck section that named the old serve doc tests step label.

doc/.claude/CLAUDE.md carried the same staleness, so it's fixed in the same PR. It still said the doc tag "covers content under doc/", which stopped being true when #64775 landed. It now describes the three-way split (doc for build and validation infra, <lib>_doc for executable doc assets, doc_api for the API reference surface), records that prose and images trigger nothing, and documents the docs-go label and its scope guard. Two smaller drifts are corrected alongside: the docs deplock rule emits doc_api now too, and the "tag it doc" advice pointed at a tag that no longer selects content steps.

This file is an agent instruction file rather than published documentation, so it's worth saying why it rides along here instead of going out separately. AGENTS.md requires a dedicated PR for changes to itself, which this isn't. doc/.claude/ is on the skip rule in test.rules.txt and excluded from the Read the Docs build guard, so including it changes this PR's trigger set by nothing. And it's the same factual correction as the page, from the same source reading — splitting them would mean verifying the same CI configuration twice and risking the two descriptions drifting apart again.

Not a duplicate

This supersedes two of my own open PRs and replaces both:

Both branched from the same pre-#64775 commit and added an identically titled section, so they also conflicted with each other. Combining them is cheaper to review than rebasing two PRs that overlap.

I'm not aware of another open PR touching this page. Checked with gh pr list --repo ray-project/ray --state open --search "ray-contribute ci.md".

Verification

Every factual claim was checked against master at 695a8814ea rather than carried over from the superseded PRs:

  • Step labels, tags, and if: guards read from .buildkite/doc.rayci.yml, core.rayci.yml, data.rayci.yml, ml.rayci.yml, rllib.rayci.yml, serve.rayci.yml, and lint.rayci.yml.
  • Path-to-tag routing read from .buildkite/test.rules.txt.
  • The render gate behavior read from .readthedocs.yaml (fail_on_warning: true, the post_checkout skip guard) and doc/Makefile.
  • The mocked-backend claim checked against ci/docker/doc.build.Dockerfile, which stages the ray-core and ray-dashboard artifacts and installs only the docs lock, and doc/source/api_mock_imports.py, which lists torch, transformers, and tensorflow. This corrects [doc] Add a documentation CI steps overview to the PR CI guide #64842, which claimed the base images supply those libraries for real.
  • doc: build's upload behavior read from ci/ray_ci/doc/cmd_build.py (postmerge, master only).
  • The docs/readthedocs.com:anyscale-ray check name confirmed from the status checks on an open PR.

Commands run:

vale --config=.vale.ini doc/source/ray-contribute/ci.md
python doc/test_no_new_rst.py
pre-commit run --files doc/source/ray-contribute/ci.md

test_no_new_rst.py passes. pre-commit reports no applicable hooks for a Markdown file under doc/source/. Vale surfaces no new findings in the added text beyond spelling hits on project vocabulary (Buildkite, premerge, docbuild, autodoc, autosummary, toctree); note that CI's documentation_style lint scopes Vale to doc/source/data and doc/source/ray-overview/examples, so this page isn't in its path set.

The same source reading backs the doc/.claude/CLAUDE.md edit; it asserts nothing the page doesn't.

Rendering verified by parsing the page with myst-parser using the repo's myst_heading_anchors = 4: the table, the {warning} directive, and the heading hierarchy all parse, with no skipped heading levels. Both cross-references (writing-code-snippets.md, docs.md#building-the-ray-documentation) point at existing .md sources and an existing heading. The Read the Docs preview on this PR is the real render check.

AI assistance

AI assistance (Claude Code) was used to draft this change and to cross-check the claims against the CI configuration. I've reviewed every line.

…cipe

Adds two sections to the PR CI guide:

- "Documentation CI checks", an overview of what actually runs when a PR
  changes files under doc/: the Read the Docs render gate, the two API
  surface checks and their doc_api tag, the per-library docs example test
  steps and their path scoping, the docs-go label and its scope guard,
  and the two post-merge-only steps.
- "Running the API consistency check locally", a recipe for reproducing
  doc: check API doc consistency outside CI, plus what the docbuild image
  does and does not install.

Also updates the example commit message under the microcheck section,
which named the old "serve doc tests" step label.

Supersedes ray-project#64450 and ray-project#64842, which each added one of these sections
against a pre-rework master.

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 updates the CI documentation in doc/source/ray-contribute/ci.md by adding comprehensive sections on documentation CI checks and instructions for running the API consistency check locally. A review comment correctly points out an incorrect path to setup-dev.py in the local setup instructions, which should be updated to python/setup-dev.py instead of python/ray/setup-dev.py.

Comment thread doc/source/ray-contribute/ci.md Resolved
doc/.claude/CLAUDE.md still described the pre-ray-project#64775 model, where a
single doc tag covered content under doc/. Replaces that with the
current three-way split (doc for build and validation infra, <lib>_doc
for executable doc assets, doc_api for the API reference surface), notes
that prose and images trigger nothing, and adds the docs-go label and
its scope guard.

Also corrects two smaller drifts: the docs deplock rule now emits
doc_api as well, and the 'tag it doc' advice under 'When to revise the
test rules' pointed at a tag that no longer selects content steps.

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

The API consistency check takes six team names (core, data, serve,
train, tune, rllib) while the docs example test steps are named after
five libraries (core, data, ml, rllib, serve). Two don't translate
directly: ml covers train and tune, and there is no llm team because
ray.data.llm is walked under data and ray.serve.llm under serve.

Addresses review feedback left on ray-project#64842, which this branch supersedes.

Signed-off-by: Douglas Strodtman <[email protected]>
@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core labels Aug 7, 2026
@dstrodtman dstrodtman added the docs-go RtD-only checks for docs-only changes. Doesn't run full library doc-test suites. label Aug 7, 2026

@ronny-anyscale ronny-anyscale 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.

pew

Comment thread doc/.claude/CLAUDE.md Resolved
Comment thread doc/source/ray-contribute/ci.md Resolved
Comment thread doc/source/ray-contribute/ci.md Resolved
Apply Ronny's review feedback on the docs-go section:

- Mark up the label in the heading as inline code. Inline code in
  headings is well-precedented under doc/source/ and the MyST anchor
  is unchanged, so no cross-reference breaks.
- Say that the label is optional and that its point is skipping
  time-intensive checks, rather than implying it's expected.
- Answer who applies it. Like the go label, it needs write access, so
  an external contributor asks a reviewer. The doc/.claude agent file
  gains the same clause so an agent suggests the label to a reviewer
  instead of assuming the author can add it.

Also link the API-check team-name mismatch to the per-library section
by anchor instead of the vaguer 'steps above'.

Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Aug 7, 2026
@dstrodtman
dstrodtman merged commit 2430e00 into ray-project:master Aug 7, 2026
7 checks passed
dstrodtman added a commit that referenced this pull request Aug 10, 2026
…65292)

## Why

A Markdown-only PR (#65285, one file under `doc/`) ran all 15 lint steps
and took 27+ minutes on `microcheck` ([build
51723](https://buildkite.com/ray-project/microcheck/builds/51723)).
`clang_format`, `bazel_buildifier`, `bazel_team`, `copyright_format`,
`dashboard_format`, `pytest_format`, `semgrep_lint`, and `test_coverage`
all ran against a one-file prose change. None of them can fail on
Markdown.

Almost none of that time was lint work. Aggregated across the lint
group: **~2,730s of checkout against ~1,275s of actual linting.**
`dashboard_format` spent 858s cloning to do 143s of work.

Two things made every step run:

1. `always.rules.txt` had no file-shape scoping at all — a bare `*`
catch-all emitting `always lint` for every changed file.
2. The lint steps carried `always` *in addition to* `lint`, so scoping
the `lint` tag alone would have changed nothing.

This PR doesn't address the per-job clone cost, which is
infrastructure-side and much the larger win. It removes 10 of 15 jobs
that pay it, which is where the pathological tail (858s, 1028s) came
from.

## What

**Skip the code-oriented lint steps on prose-only PRs**

- `always.rules.txt`: add a rule ahead of the catch-all that emits
`always` **without** `lint` for `.md`, `.rst`, image assets, and
`doc/.claude/`. The path set matches the existing prose skip rule in
`test.rules.txt` so the two files agree on what prose is.
- `lint.rayci.yml`: split the `lint-small` matrix in two. Steps a prose
change can actually fail keep `always`; the code-oriented steps carry
`lint` alone and are filtered out on a prose-only diff. Same for
pydoclint.
- `lint.sh`: add `pre_commit_docs`, running the three hooks that
actually reach prose (`trailing-whitespace`, `end-of-file-fixer`,
`check-added-large-files`). The other 20 hooks in `pre_commit` are
scoped to Python, C++, BUILD, TS/TSX, or shell. `pre_commit` runs every
hook with `--all-files`, so its 443s is independent of the diff — this
keeps the prose coverage without keeping the cost.

**No new tag is needed.** `always` is emitted for every file by the
catch-all, so `lint` alone carries the split, and now means "the diff
contains a file that is not documentation prose."

**Fail-safe by construction.** Tags union across changed files, so one
non-prose file anywhere in a diff re-emits `lint` and the full matrix
runs — mixed PRs lose no coverage. Non-PR builds bypass rule evaluation
entirely (`needRunAllTags` returns `["*"]` for master, release branches,
and manual builds), so **post-merge lint coverage is unchanged.**

The microcheck pipeline's hardcoded `RAYCI_SELECT=...,tag:lint` is not a
blocker: `stepFilter.accept` is `acceptSelectHit(step) &&
acceptTagHit(step)`, so selects and rule-emitted tags are ANDed.
`tag:lint` only makes these steps *eligible*; the rules still have to
emit `lint`. So the whole change lands in this repo, with no
pipeline-definition change.

**Make `banned_words` cover Markdown** (second commit)

While classifying which lint steps are prose-relevant, I found
`check-banned-words.sh` describes itself as checking "Python and doc
files" but only included `*.py` and `*.rst`. Since
`doc/test_no_new_rst.py` rejects newly added `.rst` files, the check was
blind to the format every new Ray doc page is written in.

- Add `*.md` and `*.ipynb` to the includes.
- Report every banned word before failing instead of exiting on the
first match — this step pays a full clone, so the old behavior cost a CI
round-trip per misspelling.
- Fix the one occurrence this surfaced: `Kuberay` → `KubeRay` in
`doc/source/cluster/kubernetes/user-guides/tpu.md`.

The banned list itself is unchanged (`RLLib`, `Rllib`, `Kuberay`). I
added a comment noting the case-sensitive match is deliberate, since it
reads like a bug otherwise.

One occurrence is deliberately left: `Kuberay` in a Buildkite step label
in `.buildkite/release-automation/pre_release.rayci.yml`. `.yml` stays
out of the check's includes because config files aren't doc files, and
fixing it would pull another CODEOWNERS group in for one word. Happy to
include it if reviewers would rather.

## A note on scope

The narrower-than-obvious path set is intentional. Executable assets
under `doc/` such as `.py` and `.ipynb` are **not** exempt, because
`pre_commit` is the only premerge step that runs black, ruff, and mypy
over `doc/source/*.py` at all — exempting all of `doc/` would let a
`conf.py` formatting violation reach master. This is also why the
exemption isn't wired to the `docs-go` scope definition: that label is
an author-asserted escape hatch with a fail-closed guard, whereas this
exemption is automatic, so it stays limited to file types that cannot
carry code.

Note this PR is itself a mixed diff and so runs the full lint matrix —
it can't demonstrate its own skip. A subsequent prose-only PR is the
live proof.

## Testing

**Rule evaluation** — verified against the `ray-project/rayci` Go
evaluator (the authority for tag computation), not the in-repo reference
parser:

```
cd rayci && go run . -buildkite-dir <ray>/.buildkite test-rules
```

130 cases pass. Added cases to `always.rules.test.txt` covering prose,
images, and `doc/.claude/` (expect `always`), plus the negative cases
`doc/source/conf.py`, `.ipynb`, `examples.yml`, `doc/BUILD.bazel`, and
prose outside `doc/` (expect `always lint`). Confirmed non-vacuous by
appending a deliberately wrong expectation, which failed as expected —
worth noting that the `RAYCI_TEST_RULE_FILES` env var mentioned in
`test-rules`' usage text is not actually implemented, so passing it
makes the run auto-discover nothing and exit 0.

**Step selection** — simulated `acceptTagHit` against the new
`lint.rayci.yml`:

- emitted tags `{always}` → the 5 prose steps run, the 10 code-oriented
steps are filtered
- emitted tags `{always, lint}` → all 15 run

**`pre_commit_docs`** — ran the three hooks locally: all pass, 39s
versus 443s for the full `pre_commit` step.

**`banned_words`** — `./ci/lint/check-banned-words.sh` passes on the
tree. Verified non-vacuous: a temporary `doc/canary_banned.md`
containing all three words is now caught, reports all three in one run,
and exits 1; the previous version of the script passed that same file
silently.

**Lint on the changed files** — `shellcheck` and `bash -n` on both shell
scripts; pre-commit whitespace hooks clean.

## Not a duplicate

Searched open PRs for `always.rules`, `lint.rayci`, and the lint
matrix/microcheck area — no open PR touches `always.rules.txt`, the lint
matrix split, or `check-banned-words.sh`.

## AI assistance

AI assistance (Claude Code) was used for this change. I reviewed every
changed line and ran the test commands above locally.

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

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Artimislyy pushed a commit to Artimislyy/ray that referenced this pull request Aug 11, 2026
…cipe (ray-project#65285)

## Why this change

`doc/source/ray-contribute/ci.md` explains what CI runs on a PR, but
stops at `microcheck` and the `go` label. It says nothing about what
runs when the PR changes documentation, which is the case the page's
likely reader is in.

This adds that, and folds in a recipe for reproducing the API
consistency check locally.

### What's new

**"Documentation CI checks"** covers, in the order a contributor meets
them:

- The Read the Docs render gate, including that `fail_on_warning: true`
makes any Sphinx warning a build failure, and when the preview build
skips.
- The two API surface checks, and the `doc_api` tag that lets an API
reference page edit reach them even though it's a documentation change.
- The per-library `<library>: docs example tests` steps, with a table
mapping path to step to tag, plus the Ray Core fallback and the Ray LLM
exception.
- That a prose-only or image-only change runs no library test steps at
all.
- The `docs-go` label and the `lint: validate docs-go scope` guard that
bounds it.
- The two post-merge-only steps, `doc: build` and `doc: linkcheck`.

**"Running the API consistency check locally"** documents the three
phases of `api_policy_check`, what the `docbuild` image does and doesn't
install (the deep-learning backends are mocked even in CI), and a `uv`
recipe that gets close enough for iteration.

It also updates one example commit message under the `microcheck`
section that named the old `serve doc tests` step label.

**`doc/.claude/CLAUDE.md`** carried the same staleness, so it's fixed in
the same PR. It still said the `doc` tag "covers content under `doc/`",
which stopped being true when ray-project#64775 landed. It now describes the
three-way split (`doc` for build and validation infra, `<lib>_doc` for
executable doc assets, `doc_api` for the API reference surface), records
that prose and images trigger nothing, and documents the `docs-go` label
and its scope guard. Two smaller drifts are corrected alongside: the
docs deplock rule emits `doc_api` now too, and the "tag it `doc`" advice
pointed at a tag that no longer selects content steps.

This file is an agent instruction file rather than published
documentation, so it's worth saying why it rides along here instead of
going out separately. `AGENTS.md` requires a dedicated PR for changes to
itself, which this isn't. `doc/.claude/` is on the skip rule in
`test.rules.txt` and excluded from the Read the Docs build guard, so
including it changes this PR's trigger set by nothing. And it's the same
factual correction as the page, from the same source reading — splitting
them would mean verifying the same CI configuration twice and risking
the two descriptions drifting apart again.

## Not a duplicate

This supersedes two of my own open PRs and replaces both:

- ray-project#64842 added a documentation CI overview. It was written before ray-project#64775
landed and describes the pre-rework model, where a single `doc` tag
selected the per-team doc test steps. That's no longer how routing
works, so landing it as-is would have documented the wrong thing.
- ray-project#64450 added the local API-check section. Its content is carried over
here essentially unchanged.

Both branched from the same pre-ray-project#64775 commit and added an identically
titled section, so they also conflicted with each other. Combining them
is cheaper to review than rebasing two PRs that overlap.

I'm not aware of another open PR touching this page. Checked with `gh pr
list --repo ray-project/ray --state open --search "ray-contribute
ci.md"`.

## Verification

Every factual claim was checked against `master` at `695a8814ea` rather
than carried over from the superseded PRs:

- Step labels, tags, and `if:` guards read from
`.buildkite/doc.rayci.yml`, `core.rayci.yml`, `data.rayci.yml`,
`ml.rayci.yml`, `rllib.rayci.yml`, `serve.rayci.yml`, and
`lint.rayci.yml`.
- Path-to-tag routing read from `.buildkite/test.rules.txt`.
- The render gate behavior read from `.readthedocs.yaml`
(`fail_on_warning: true`, the `post_checkout` skip guard) and
`doc/Makefile`.
- The mocked-backend claim checked against
`ci/docker/doc.build.Dockerfile`, which stages the `ray-core` and
`ray-dashboard` artifacts and installs only the docs lock, and
`doc/source/api_mock_imports.py`, which lists `torch`, `transformers`,
and `tensorflow`. This corrects ray-project#64842, which claimed the base images
supply those libraries for real.
- `doc: build`'s upload behavior read from `ci/ray_ci/doc/cmd_build.py`
(postmerge, `master` only).
- The `docs/readthedocs.com:anyscale-ray` check name confirmed from the
status checks on an open PR.

Commands run:

```
vale --config=.vale.ini doc/source/ray-contribute/ci.md
python doc/test_no_new_rst.py
pre-commit run --files doc/source/ray-contribute/ci.md
```

`test_no_new_rst.py` passes. `pre-commit` reports no applicable hooks
for a Markdown file under `doc/source/`. Vale surfaces no new findings
in the added text beyond spelling hits on project vocabulary
(`Buildkite`, `premerge`, `docbuild`, `autodoc`, `autosummary`,
`toctree`); note that CI's `documentation_style` lint scopes Vale to
`doc/source/data` and `doc/source/ray-overview/examples`, so this page
isn't in its path set.

The same source reading backs the `doc/.claude/CLAUDE.md` edit; it
asserts nothing the page doesn't.

Rendering verified by parsing the page with `myst-parser` using the
repo's `myst_heading_anchors = 4`: the table, the `{warning}` directive,
and the heading hierarchy all parse, with no skipped heading levels.
Both cross-references (`writing-code-snippets.md`,
`docs.md#building-the-ray-documentation`) point at existing `.md`
sources and an existing heading. The Read the Docs preview on this PR is
the real render check.

## AI assistance

AI assistance (Claude Code) was used to draft this change and to
cross-check the claims against the CI configuration. I've reviewed every
line.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Artimislyy pushed a commit to Artimislyy/ray that referenced this pull request Aug 11, 2026
…ay-project#65292)

## Why

A Markdown-only PR (ray-project#65285, one file under `doc/`) ran all 15 lint steps
and took 27+ minutes on `microcheck` ([build
51723](https://buildkite.com/ray-project/microcheck/builds/51723)).
`clang_format`, `bazel_buildifier`, `bazel_team`, `copyright_format`,
`dashboard_format`, `pytest_format`, `semgrep_lint`, and `test_coverage`
all ran against a one-file prose change. None of them can fail on
Markdown.

Almost none of that time was lint work. Aggregated across the lint
group: **~2,730s of checkout against ~1,275s of actual linting.**
`dashboard_format` spent 858s cloning to do 143s of work.

Two things made every step run:

1. `always.rules.txt` had no file-shape scoping at all — a bare `*`
catch-all emitting `always lint` for every changed file.
2. The lint steps carried `always` *in addition to* `lint`, so scoping
the `lint` tag alone would have changed nothing.

This PR doesn't address the per-job clone cost, which is
infrastructure-side and much the larger win. It removes 10 of 15 jobs
that pay it, which is where the pathological tail (858s, 1028s) came
from.

## What

**Skip the code-oriented lint steps on prose-only PRs**

- `always.rules.txt`: add a rule ahead of the catch-all that emits
`always` **without** `lint` for `.md`, `.rst`, image assets, and
`doc/.claude/`. The path set matches the existing prose skip rule in
`test.rules.txt` so the two files agree on what prose is.
- `lint.rayci.yml`: split the `lint-small` matrix in two. Steps a prose
change can actually fail keep `always`; the code-oriented steps carry
`lint` alone and are filtered out on a prose-only diff. Same for
pydoclint.
- `lint.sh`: add `pre_commit_docs`, running the three hooks that
actually reach prose (`trailing-whitespace`, `end-of-file-fixer`,
`check-added-large-files`). The other 20 hooks in `pre_commit` are
scoped to Python, C++, BUILD, TS/TSX, or shell. `pre_commit` runs every
hook with `--all-files`, so its 443s is independent of the diff — this
keeps the prose coverage without keeping the cost.

**No new tag is needed.** `always` is emitted for every file by the
catch-all, so `lint` alone carries the split, and now means "the diff
contains a file that is not documentation prose."

**Fail-safe by construction.** Tags union across changed files, so one
non-prose file anywhere in a diff re-emits `lint` and the full matrix
runs — mixed PRs lose no coverage. Non-PR builds bypass rule evaluation
entirely (`needRunAllTags` returns `["*"]` for master, release branches,
and manual builds), so **post-merge lint coverage is unchanged.**

The microcheck pipeline's hardcoded `RAYCI_SELECT=...,tag:lint` is not a
blocker: `stepFilter.accept` is `acceptSelectHit(step) &&
acceptTagHit(step)`, so selects and rule-emitted tags are ANDed.
`tag:lint` only makes these steps *eligible*; the rules still have to
emit `lint`. So the whole change lands in this repo, with no
pipeline-definition change.

**Make `banned_words` cover Markdown** (second commit)

While classifying which lint steps are prose-relevant, I found
`check-banned-words.sh` describes itself as checking "Python and doc
files" but only included `*.py` and `*.rst`. Since
`doc/test_no_new_rst.py` rejects newly added `.rst` files, the check was
blind to the format every new Ray doc page is written in.

- Add `*.md` and `*.ipynb` to the includes.
- Report every banned word before failing instead of exiting on the
first match — this step pays a full clone, so the old behavior cost a CI
round-trip per misspelling.
- Fix the one occurrence this surfaced: `Kuberay` → `KubeRay` in
`doc/source/cluster/kubernetes/user-guides/tpu.md`.

The banned list itself is unchanged (`RLLib`, `Rllib`, `Kuberay`). I
added a comment noting the case-sensitive match is deliberate, since it
reads like a bug otherwise.

One occurrence is deliberately left: `Kuberay` in a Buildkite step label
in `.buildkite/release-automation/pre_release.rayci.yml`. `.yml` stays
out of the check's includes because config files aren't doc files, and
fixing it would pull another CODEOWNERS group in for one word. Happy to
include it if reviewers would rather.

## A note on scope

The narrower-than-obvious path set is intentional. Executable assets
under `doc/` such as `.py` and `.ipynb` are **not** exempt, because
`pre_commit` is the only premerge step that runs black, ruff, and mypy
over `doc/source/*.py` at all — exempting all of `doc/` would let a
`conf.py` formatting violation reach master. This is also why the
exemption isn't wired to the `docs-go` scope definition: that label is
an author-asserted escape hatch with a fail-closed guard, whereas this
exemption is automatic, so it stays limited to file types that cannot
carry code.

Note this PR is itself a mixed diff and so runs the full lint matrix —
it can't demonstrate its own skip. A subsequent prose-only PR is the
live proof.

## Testing

**Rule evaluation** — verified against the `ray-project/rayci` Go
evaluator (the authority for tag computation), not the in-repo reference
parser:

```
cd rayci && go run . -buildkite-dir <ray>/.buildkite test-rules
```

130 cases pass. Added cases to `always.rules.test.txt` covering prose,
images, and `doc/.claude/` (expect `always`), plus the negative cases
`doc/source/conf.py`, `.ipynb`, `examples.yml`, `doc/BUILD.bazel`, and
prose outside `doc/` (expect `always lint`). Confirmed non-vacuous by
appending a deliberately wrong expectation, which failed as expected —
worth noting that the `RAYCI_TEST_RULE_FILES` env var mentioned in
`test-rules`' usage text is not actually implemented, so passing it
makes the run auto-discover nothing and exit 0.

**Step selection** — simulated `acceptTagHit` against the new
`lint.rayci.yml`:

- emitted tags `{always}` → the 5 prose steps run, the 10 code-oriented
steps are filtered
- emitted tags `{always, lint}` → all 15 run

**`pre_commit_docs`** — ran the three hooks locally: all pass, 39s
versus 443s for the full `pre_commit` step.

**`banned_words`** — `./ci/lint/check-banned-words.sh` passes on the
tree. Verified non-vacuous: a temporary `doc/canary_banned.md`
containing all three words is now caught, reports all three in one run,
and exits 1; the previous version of the script passed that same file
silently.

**Lint on the changed files** — `shellcheck` and `bash -n` on both shell
scripts; pre-commit whitespace hooks clean.

## Not a duplicate

Searched open PRs for `always.rules`, `lint.rayci`, and the lint
matrix/microcheck area — no open PR touches `always.rules.txt`, the lint
matrix split, or `check-banned-words.sh`.

## AI assistance

AI assistance (Claude Code) was used for this change. I reviewed every
changed line and ran the test commands above locally.

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

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…cipe (ray-project#65285)

## Why this change

`doc/source/ray-contribute/ci.md` explains what CI runs on a PR, but
stops at `microcheck` and the `go` label. It says nothing about what
runs when the PR changes documentation, which is the case the page's
likely reader is in.

This adds that, and folds in a recipe for reproducing the API
consistency check locally.

### What's new

**"Documentation CI checks"** covers, in the order a contributor meets
them:

- The Read the Docs render gate, including that `fail_on_warning: true`
makes any Sphinx warning a build failure, and when the preview build
skips.
- The two API surface checks, and the `doc_api` tag that lets an API
reference page edit reach them even though it's a documentation change.
- The per-library `<library>: docs example tests` steps, with a table
mapping path to step to tag, plus the Ray Core fallback and the Ray LLM
exception.
- That a prose-only or image-only change runs no library test steps at
all.
- The `docs-go` label and the `lint: validate docs-go scope` guard that
bounds it.
- The two post-merge-only steps, `doc: build` and `doc: linkcheck`.

**"Running the API consistency check locally"** documents the three
phases of `api_policy_check`, what the `docbuild` image does and doesn't
install (the deep-learning backends are mocked even in CI), and a `uv`
recipe that gets close enough for iteration.

It also updates one example commit message under the `microcheck`
section that named the old `serve doc tests` step label.

**`doc/.claude/CLAUDE.md`** carried the same staleness, so it's fixed in
the same PR. It still said the `doc` tag "covers content under `doc/`",
which stopped being true when ray-project#64775 landed. It now describes the
three-way split (`doc` for build and validation infra, `<lib>_doc` for
executable doc assets, `doc_api` for the API reference surface), records
that prose and images trigger nothing, and documents the `docs-go` label
and its scope guard. Two smaller drifts are corrected alongside: the
docs deplock rule emits `doc_api` now too, and the "tag it `doc`" advice
pointed at a tag that no longer selects content steps.

This file is an agent instruction file rather than published
documentation, so it's worth saying why it rides along here instead of
going out separately. `AGENTS.md` requires a dedicated PR for changes to
itself, which this isn't. `doc/.claude/` is on the skip rule in
`test.rules.txt` and excluded from the Read the Docs build guard, so
including it changes this PR's trigger set by nothing. And it's the same
factual correction as the page, from the same source reading — splitting
them would mean verifying the same CI configuration twice and risking
the two descriptions drifting apart again.

## Not a duplicate

This supersedes two of my own open PRs and replaces both:

- ray-project#64842 added a documentation CI overview. It was written before ray-project#64775
landed and describes the pre-rework model, where a single `doc` tag
selected the per-team doc test steps. That's no longer how routing
works, so landing it as-is would have documented the wrong thing.
- ray-project#64450 added the local API-check section. Its content is carried over
here essentially unchanged.

Both branched from the same pre-ray-project#64775 commit and added an identically
titled section, so they also conflicted with each other. Combining them
is cheaper to review than rebasing two PRs that overlap.

I'm not aware of another open PR touching this page. Checked with `gh pr
list --repo ray-project/ray --state open --search "ray-contribute
ci.md"`.

## Verification

Every factual claim was checked against `master` at `695a8814ea` rather
than carried over from the superseded PRs:

- Step labels, tags, and `if:` guards read from
`.buildkite/doc.rayci.yml`, `core.rayci.yml`, `data.rayci.yml`,
`ml.rayci.yml`, `rllib.rayci.yml`, `serve.rayci.yml`, and
`lint.rayci.yml`.
- Path-to-tag routing read from `.buildkite/test.rules.txt`.
- The render gate behavior read from `.readthedocs.yaml`
(`fail_on_warning: true`, the `post_checkout` skip guard) and
`doc/Makefile`.
- The mocked-backend claim checked against
`ci/docker/doc.build.Dockerfile`, which stages the `ray-core` and
`ray-dashboard` artifacts and installs only the docs lock, and
`doc/source/api_mock_imports.py`, which lists `torch`, `transformers`,
and `tensorflow`. This corrects ray-project#64842, which claimed the base images
supply those libraries for real.
- `doc: build`'s upload behavior read from `ci/ray_ci/doc/cmd_build.py`
(postmerge, `master` only).
- The `docs/readthedocs.com:anyscale-ray` check name confirmed from the
status checks on an open PR.

Commands run:

```
vale --config=.vale.ini doc/source/ray-contribute/ci.md
python doc/test_no_new_rst.py
pre-commit run --files doc/source/ray-contribute/ci.md
```

`test_no_new_rst.py` passes. `pre-commit` reports no applicable hooks
for a Markdown file under `doc/source/`. Vale surfaces no new findings
in the added text beyond spelling hits on project vocabulary
(`Buildkite`, `premerge`, `docbuild`, `autodoc`, `autosummary`,
`toctree`); note that CI's `documentation_style` lint scopes Vale to
`doc/source/data` and `doc/source/ray-overview/examples`, so this page
isn't in its path set.

The same source reading backs the `doc/.claude/CLAUDE.md` edit; it
asserts nothing the page doesn't.

Rendering verified by parsing the page with `myst-parser` using the
repo's `myst_heading_anchors = 4`: the table, the `{warning}` directive,
and the heading hierarchy all parse, with no skipped heading levels.
Both cross-references (`writing-code-snippets.md`,
`docs.md#building-the-ray-documentation`) point at existing `.md`
sources and an existing heading. The Read the Docs preview on this PR is
the real render check.

## AI assistance

AI assistance (Claude Code) was used to draft this change and to
cross-check the claims against the CI configuration. I've reviewed every
line.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ay-project#65292)

## Why

A Markdown-only PR (ray-project#65285, one file under `doc/`) ran all 15 lint steps
and took 27+ minutes on `microcheck` ([build
51723](https://buildkite.com/ray-project/microcheck/builds/51723)).
`clang_format`, `bazel_buildifier`, `bazel_team`, `copyright_format`,
`dashboard_format`, `pytest_format`, `semgrep_lint`, and `test_coverage`
all ran against a one-file prose change. None of them can fail on
Markdown.

Almost none of that time was lint work. Aggregated across the lint
group: **~2,730s of checkout against ~1,275s of actual linting.**
`dashboard_format` spent 858s cloning to do 143s of work.

Two things made every step run:

1. `always.rules.txt` had no file-shape scoping at all — a bare `*`
catch-all emitting `always lint` for every changed file.
2. The lint steps carried `always` *in addition to* `lint`, so scoping
the `lint` tag alone would have changed nothing.

This PR doesn't address the per-job clone cost, which is
infrastructure-side and much the larger win. It removes 10 of 15 jobs
that pay it, which is where the pathological tail (858s, 1028s) came
from.

## What

**Skip the code-oriented lint steps on prose-only PRs**

- `always.rules.txt`: add a rule ahead of the catch-all that emits
`always` **without** `lint` for `.md`, `.rst`, image assets, and
`doc/.claude/`. The path set matches the existing prose skip rule in
`test.rules.txt` so the two files agree on what prose is.
- `lint.rayci.yml`: split the `lint-small` matrix in two. Steps a prose
change can actually fail keep `always`; the code-oriented steps carry
`lint` alone and are filtered out on a prose-only diff. Same for
pydoclint.
- `lint.sh`: add `pre_commit_docs`, running the three hooks that
actually reach prose (`trailing-whitespace`, `end-of-file-fixer`,
`check-added-large-files`). The other 20 hooks in `pre_commit` are
scoped to Python, C++, BUILD, TS/TSX, or shell. `pre_commit` runs every
hook with `--all-files`, so its 443s is independent of the diff — this
keeps the prose coverage without keeping the cost.

**No new tag is needed.** `always` is emitted for every file by the
catch-all, so `lint` alone carries the split, and now means "the diff
contains a file that is not documentation prose."

**Fail-safe by construction.** Tags union across changed files, so one
non-prose file anywhere in a diff re-emits `lint` and the full matrix
runs — mixed PRs lose no coverage. Non-PR builds bypass rule evaluation
entirely (`needRunAllTags` returns `["*"]` for master, release branches,
and manual builds), so **post-merge lint coverage is unchanged.**

The microcheck pipeline's hardcoded `RAYCI_SELECT=...,tag:lint` is not a
blocker: `stepFilter.accept` is `acceptSelectHit(step) &&
acceptTagHit(step)`, so selects and rule-emitted tags are ANDed.
`tag:lint` only makes these steps *eligible*; the rules still have to
emit `lint`. So the whole change lands in this repo, with no
pipeline-definition change.

**Make `banned_words` cover Markdown** (second commit)

While classifying which lint steps are prose-relevant, I found
`check-banned-words.sh` describes itself as checking "Python and doc
files" but only included `*.py` and `*.rst`. Since
`doc/test_no_new_rst.py` rejects newly added `.rst` files, the check was
blind to the format every new Ray doc page is written in.

- Add `*.md` and `*.ipynb` to the includes.
- Report every banned word before failing instead of exiting on the
first match — this step pays a full clone, so the old behavior cost a CI
round-trip per misspelling.
- Fix the one occurrence this surfaced: `Kuberay` → `KubeRay` in
`doc/source/cluster/kubernetes/user-guides/tpu.md`.

The banned list itself is unchanged (`RLLib`, `Rllib`, `Kuberay`). I
added a comment noting the case-sensitive match is deliberate, since it
reads like a bug otherwise.

One occurrence is deliberately left: `Kuberay` in a Buildkite step label
in `.buildkite/release-automation/pre_release.rayci.yml`. `.yml` stays
out of the check's includes because config files aren't doc files, and
fixing it would pull another CODEOWNERS group in for one word. Happy to
include it if reviewers would rather.

## A note on scope

The narrower-than-obvious path set is intentional. Executable assets
under `doc/` such as `.py` and `.ipynb` are **not** exempt, because
`pre_commit` is the only premerge step that runs black, ruff, and mypy
over `doc/source/*.py` at all — exempting all of `doc/` would let a
`conf.py` formatting violation reach master. This is also why the
exemption isn't wired to the `docs-go` scope definition: that label is
an author-asserted escape hatch with a fail-closed guard, whereas this
exemption is automatic, so it stays limited to file types that cannot
carry code.

Note this PR is itself a mixed diff and so runs the full lint matrix —
it can't demonstrate its own skip. A subsequent prose-only PR is the
live proof.

## Testing

**Rule evaluation** — verified against the `ray-project/rayci` Go
evaluator (the authority for tag computation), not the in-repo reference
parser:

```
cd rayci && go run . -buildkite-dir <ray>/.buildkite test-rules
```

130 cases pass. Added cases to `always.rules.test.txt` covering prose,
images, and `doc/.claude/` (expect `always`), plus the negative cases
`doc/source/conf.py`, `.ipynb`, `examples.yml`, `doc/BUILD.bazel`, and
prose outside `doc/` (expect `always lint`). Confirmed non-vacuous by
appending a deliberately wrong expectation, which failed as expected —
worth noting that the `RAYCI_TEST_RULE_FILES` env var mentioned in
`test-rules`' usage text is not actually implemented, so passing it
makes the run auto-discover nothing and exit 0.

**Step selection** — simulated `acceptTagHit` against the new
`lint.rayci.yml`:

- emitted tags `{always}` → the 5 prose steps run, the 10 code-oriented
steps are filtered
- emitted tags `{always, lint}` → all 15 run

**`pre_commit_docs`** — ran the three hooks locally: all pass, 39s
versus 443s for the full `pre_commit` step.

**`banned_words`** — `./ci/lint/check-banned-words.sh` passes on the
tree. Verified non-vacuous: a temporary `doc/canary_banned.md`
containing all three words is now caught, reports all three in one run,
and exits 1; the previous version of the script passed that same file
silently.

**Lint on the changed files** — `shellcheck` and `bash -n` on both shell
scripts; pre-commit whitespace hooks clean.

## Not a duplicate

Searched open PRs for `always.rules`, `lint.rayci`, and the lint
matrix/microcheck area — no open PR touches `always.rules.txt`, the lint
matrix split, or `check-banned-words.sh`.

## AI assistance

AI assistance (Claude Code) was used for this change. I reviewed every
changed line and ran the test commands above locally.

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

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: 400Ping <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…cipe (ray-project#65285)

## Why this change

`doc/source/ray-contribute/ci.md` explains what CI runs on a PR, but
stops at `microcheck` and the `go` label. It says nothing about what
runs when the PR changes documentation, which is the case the page's
likely reader is in.

This adds that, and folds in a recipe for reproducing the API
consistency check locally.

### What's new

**"Documentation CI checks"** covers, in the order a contributor meets
them:

- The Read the Docs render gate, including that `fail_on_warning: true`
makes any Sphinx warning a build failure, and when the preview build
skips.
- The two API surface checks, and the `doc_api` tag that lets an API
reference page edit reach them even though it's a documentation change.
- The per-library `<library>: docs example tests` steps, with a table
mapping path to step to tag, plus the Ray Core fallback and the Ray LLM
exception.
- That a prose-only or image-only change runs no library test steps at
all.
- The `docs-go` label and the `lint: validate docs-go scope` guard that
bounds it.
- The two post-merge-only steps, `doc: build` and `doc: linkcheck`.

**"Running the API consistency check locally"** documents the three
phases of `api_policy_check`, what the `docbuild` image does and doesn't
install (the deep-learning backends are mocked even in CI), and a `uv`
recipe that gets close enough for iteration.

It also updates one example commit message under the `microcheck`
section that named the old `serve doc tests` step label.

**`doc/.claude/CLAUDE.md`** carried the same staleness, so it's fixed in
the same PR. It still said the `doc` tag "covers content under `doc/`",
which stopped being true when ray-project#64775 landed. It now describes the
three-way split (`doc` for build and validation infra, `<lib>_doc` for
executable doc assets, `doc_api` for the API reference surface), records
that prose and images trigger nothing, and documents the `docs-go` label
and its scope guard. Two smaller drifts are corrected alongside: the
docs deplock rule emits `doc_api` now too, and the "tag it `doc`" advice
pointed at a tag that no longer selects content steps.

This file is an agent instruction file rather than published
documentation, so it's worth saying why it rides along here instead of
going out separately. `AGENTS.md` requires a dedicated PR for changes to
itself, which this isn't. `doc/.claude/` is on the skip rule in
`test.rules.txt` and excluded from the Read the Docs build guard, so
including it changes this PR's trigger set by nothing. And it's the same
factual correction as the page, from the same source reading — splitting
them would mean verifying the same CI configuration twice and risking
the two descriptions drifting apart again.

## Not a duplicate

This supersedes two of my own open PRs and replaces both:

- ray-project#64842 added a documentation CI overview. It was written before ray-project#64775
landed and describes the pre-rework model, where a single `doc` tag
selected the per-team doc test steps. That's no longer how routing
works, so landing it as-is would have documented the wrong thing.
- ray-project#64450 added the local API-check section. Its content is carried over
here essentially unchanged.

Both branched from the same pre-ray-project#64775 commit and added an identically
titled section, so they also conflicted with each other. Combining them
is cheaper to review than rebasing two PRs that overlap.

I'm not aware of another open PR touching this page. Checked with `gh pr
list --repo ray-project/ray --state open --search "ray-contribute
ci.md"`.

## Verification

Every factual claim was checked against `master` at `695a8814ea` rather
than carried over from the superseded PRs:

- Step labels, tags, and `if:` guards read from
`.buildkite/doc.rayci.yml`, `core.rayci.yml`, `data.rayci.yml`,
`ml.rayci.yml`, `rllib.rayci.yml`, `serve.rayci.yml`, and
`lint.rayci.yml`.
- Path-to-tag routing read from `.buildkite/test.rules.txt`.
- The render gate behavior read from `.readthedocs.yaml`
(`fail_on_warning: true`, the `post_checkout` skip guard) and
`doc/Makefile`.
- The mocked-backend claim checked against
`ci/docker/doc.build.Dockerfile`, which stages the `ray-core` and
`ray-dashboard` artifacts and installs only the docs lock, and
`doc/source/api_mock_imports.py`, which lists `torch`, `transformers`,
and `tensorflow`. This corrects ray-project#64842, which claimed the base images
supply those libraries for real.
- `doc: build`'s upload behavior read from `ci/ray_ci/doc/cmd_build.py`
(postmerge, `master` only).
- The `docs/readthedocs.com:anyscale-ray` check name confirmed from the
status checks on an open PR.

Commands run:

```
vale --config=.vale.ini doc/source/ray-contribute/ci.md
python doc/test_no_new_rst.py
pre-commit run --files doc/source/ray-contribute/ci.md
```

`test_no_new_rst.py` passes. `pre-commit` reports no applicable hooks
for a Markdown file under `doc/source/`. Vale surfaces no new findings
in the added text beyond spelling hits on project vocabulary
(`Buildkite`, `premerge`, `docbuild`, `autodoc`, `autosummary`,
`toctree`); note that CI's `documentation_style` lint scopes Vale to
`doc/source/data` and `doc/source/ray-overview/examples`, so this page
isn't in its path set.

The same source reading backs the `doc/.claude/CLAUDE.md` edit; it
asserts nothing the page doesn't.

Rendering verified by parsing the page with `myst-parser` using the
repo's `myst_heading_anchors = 4`: the table, the `{warning}` directive,
and the heading hierarchy all parse, with no skipped heading levels.
Both cross-references (`writing-code-snippets.md`,
`docs.md#building-the-ray-documentation`) point at existing `.md`
sources and an existing heading. The Read the Docs preview on this PR is
the real render check.

## AI assistance

AI assistance (Claude Code) was used to draft this change and to
cross-check the claims against the CI configuration. I've reviewed every
line.

---------

Signed-off-by: Douglas Strodtman <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…ay-project#65292)

## Why

A Markdown-only PR (ray-project#65285, one file under `doc/`) ran all 15 lint steps
and took 27+ minutes on `microcheck` ([build
51723](https://buildkite.com/ray-project/microcheck/builds/51723)).
`clang_format`, `bazel_buildifier`, `bazel_team`, `copyright_format`,
`dashboard_format`, `pytest_format`, `semgrep_lint`, and `test_coverage`
all ran against a one-file prose change. None of them can fail on
Markdown.

Almost none of that time was lint work. Aggregated across the lint
group: **~2,730s of checkout against ~1,275s of actual linting.**
`dashboard_format` spent 858s cloning to do 143s of work.

Two things made every step run:

1. `always.rules.txt` had no file-shape scoping at all — a bare `*`
catch-all emitting `always lint` for every changed file.
2. The lint steps carried `always` *in addition to* `lint`, so scoping
the `lint` tag alone would have changed nothing.

This PR doesn't address the per-job clone cost, which is
infrastructure-side and much the larger win. It removes 10 of 15 jobs
that pay it, which is where the pathological tail (858s, 1028s) came
from.

## What

**Skip the code-oriented lint steps on prose-only PRs**

- `always.rules.txt`: add a rule ahead of the catch-all that emits
`always` **without** `lint` for `.md`, `.rst`, image assets, and
`doc/.claude/`. The path set matches the existing prose skip rule in
`test.rules.txt` so the two files agree on what prose is.
- `lint.rayci.yml`: split the `lint-small` matrix in two. Steps a prose
change can actually fail keep `always`; the code-oriented steps carry
`lint` alone and are filtered out on a prose-only diff. Same for
pydoclint.
- `lint.sh`: add `pre_commit_docs`, running the three hooks that
actually reach prose (`trailing-whitespace`, `end-of-file-fixer`,
`check-added-large-files`). The other 20 hooks in `pre_commit` are
scoped to Python, C++, BUILD, TS/TSX, or shell. `pre_commit` runs every
hook with `--all-files`, so its 443s is independent of the diff — this
keeps the prose coverage without keeping the cost.

**No new tag is needed.** `always` is emitted for every file by the
catch-all, so `lint` alone carries the split, and now means "the diff
contains a file that is not documentation prose."

**Fail-safe by construction.** Tags union across changed files, so one
non-prose file anywhere in a diff re-emits `lint` and the full matrix
runs — mixed PRs lose no coverage. Non-PR builds bypass rule evaluation
entirely (`needRunAllTags` returns `["*"]` for master, release branches,
and manual builds), so **post-merge lint coverage is unchanged.**

The microcheck pipeline's hardcoded `RAYCI_SELECT=...,tag:lint` is not a
blocker: `stepFilter.accept` is `acceptSelectHit(step) &&
acceptTagHit(step)`, so selects and rule-emitted tags are ANDed.
`tag:lint` only makes these steps *eligible*; the rules still have to
emit `lint`. So the whole change lands in this repo, with no
pipeline-definition change.

**Make `banned_words` cover Markdown** (second commit)

While classifying which lint steps are prose-relevant, I found
`check-banned-words.sh` describes itself as checking "Python and doc
files" but only included `*.py` and `*.rst`. Since
`doc/test_no_new_rst.py` rejects newly added `.rst` files, the check was
blind to the format every new Ray doc page is written in.

- Add `*.md` and `*.ipynb` to the includes.
- Report every banned word before failing instead of exiting on the
first match — this step pays a full clone, so the old behavior cost a CI
round-trip per misspelling.
- Fix the one occurrence this surfaced: `Kuberay` → `KubeRay` in
`doc/source/cluster/kubernetes/user-guides/tpu.md`.

The banned list itself is unchanged (`RLLib`, `Rllib`, `Kuberay`). I
added a comment noting the case-sensitive match is deliberate, since it
reads like a bug otherwise.

One occurrence is deliberately left: `Kuberay` in a Buildkite step label
in `.buildkite/release-automation/pre_release.rayci.yml`. `.yml` stays
out of the check's includes because config files aren't doc files, and
fixing it would pull another CODEOWNERS group in for one word. Happy to
include it if reviewers would rather.

## A note on scope

The narrower-than-obvious path set is intentional. Executable assets
under `doc/` such as `.py` and `.ipynb` are **not** exempt, because
`pre_commit` is the only premerge step that runs black, ruff, and mypy
over `doc/source/*.py` at all — exempting all of `doc/` would let a
`conf.py` formatting violation reach master. This is also why the
exemption isn't wired to the `docs-go` scope definition: that label is
an author-asserted escape hatch with a fail-closed guard, whereas this
exemption is automatic, so it stays limited to file types that cannot
carry code.

Note this PR is itself a mixed diff and so runs the full lint matrix —
it can't demonstrate its own skip. A subsequent prose-only PR is the
live proof.

## Testing

**Rule evaluation** — verified against the `ray-project/rayci` Go
evaluator (the authority for tag computation), not the in-repo reference
parser:

```
cd rayci && go run . -buildkite-dir <ray>/.buildkite test-rules
```

130 cases pass. Added cases to `always.rules.test.txt` covering prose,
images, and `doc/.claude/` (expect `always`), plus the negative cases
`doc/source/conf.py`, `.ipynb`, `examples.yml`, `doc/BUILD.bazel`, and
prose outside `doc/` (expect `always lint`). Confirmed non-vacuous by
appending a deliberately wrong expectation, which failed as expected —
worth noting that the `RAYCI_TEST_RULE_FILES` env var mentioned in
`test-rules`' usage text is not actually implemented, so passing it
makes the run auto-discover nothing and exit 0.

**Step selection** — simulated `acceptTagHit` against the new
`lint.rayci.yml`:

- emitted tags `{always}` → the 5 prose steps run, the 10 code-oriented
steps are filtered
- emitted tags `{always, lint}` → all 15 run

**`pre_commit_docs`** — ran the three hooks locally: all pass, 39s
versus 443s for the full `pre_commit` step.

**`banned_words`** — `./ci/lint/check-banned-words.sh` passes on the
tree. Verified non-vacuous: a temporary `doc/canary_banned.md`
containing all three words is now caught, reports all three in one run,
and exits 1; the previous version of the script passed that same file
silently.

**Lint on the changed files** — `shellcheck` and `bash -n` on both shell
scripts; pre-commit whitespace hooks clean.

## Not a duplicate

Searched open PRs for `always.rules`, `lint.rayci`, and the lint
matrix/microcheck area — no open PR touches `always.rules.txt`, the lint
matrix split, or `check-banned-words.sh`.

## AI assistance

AI assistance (Claude Code) was used for this change. I reviewed every
changed line and ran the test commands above locally.

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

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[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.

2 participants