Repository navigation
[ci] Skip the code-oriented lint matrix on documentation-prose PRs - #65292
Conversation
## Why
A Markdown-only PR (one file under `doc/`) ran all 15 lint steps and took
27+ minutes on microcheck. `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 which can
fail on Markdown.
Two things made every step run. `always.rules.txt` was a bare `*` catch-all
emitting `always lint` for every file, so nothing was ever scoped by file
shape; and the lint steps carried `always` on top of `lint`, so scoping
`lint` alone would have changed nothing.
The aggregate cost was ~2,730s of checkout against ~1,275s of actual linting.
`dashboard_format` spent 858s cloning to do 143s of work. This change doesn't
address the per-job clone cost, but it removes 10 of 15 jobs that pay it,
which is where the pathological tail came from.
## What
- `always.rules.txt`: add a prose 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. The steps a prose
change can fail keep `always`; the code-oriented steps carry `lint` alone
and so 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 diff-independent; 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, so post-merge
lint coverage is unchanged.
The fix is entirely in this repo. The microcheck pipeline's hardcoded
`tag:lint` selector is not a blocker: rayci ANDs selects with rule-emitted
tags, so `tag:lint` only makes these steps eligible and the rules still have
to emit `lint`.
## Testing
- `rayci test-rules` against the modified `.buildkite` dir: 130 cases pass.
Added cases covering prose, images, `doc/.claude/`, and the negative cases
(`doc/source/conf.py`, `.ipynb`, `examples.yml`, `doc/BUILD.bazel`, and
prose outside `doc/`) all still emit `lint`. Verified non-vacuous with a
deliberately wrong expectation, which failed as expected.
- Verified the split against the rayci step filter semantics: on emitted tags
`{always}` the 5 prose steps run and the 10 code-oriented steps are
filtered; on `{always, lint}` all 15 run.
- Ran the three `pre_commit_docs` hooks locally: all pass, 39s versus 443s
for the full step.
- `shellcheck` and `bash -n` on `lint.sh`; pre-commit whitespace hooks on all
changed files.
AI assistance (Claude Code) was used for this change.
Not a duplicate: no open PR touches `always.rules.txt` or the lint matrix
split.
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
## Why `check-banned-words.sh` describes itself as checking "Python and doc files", but its grep only included `*.py` and `*.rst`. New pages under `doc/source/` must be MyST Markdown -- `doc/test_no_new_rst.py` rejects newly added `.rst` files -- so the check was blind to the format most Ray prose is now written in. It had been silently passing over `.md` entirely. One occurrence had already landed: `Kuberay` in `doc/source/cluster/kubernetes/user-guides/tpu.md`. Fixed here, since adding `*.md` to the check surfaces it. ## What - Add `*.md` and `*.ipynb` to the include list. Notebooks are the other documentation format, and neither had any coverage. - Report every banned word before failing, instead of exiting on the first match. This step pays a full repository clone, so discovering one misspelling per CI round-trip was needlessly slow. - Add `set -uo pipefail` and a note that the case-sensitive match is deliberate: the correct spellings are `RLlib` and `KubeRay`, and the point is to catch the wrong capitalizations. The banned list itself is unchanged: `RLLib`, `Rllib`, `Kuberay`. ## Testing - `./ci/lint/check-banned-words.sh` passes on the tree (exit 0). - 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. On the previous version of the script the same file passed silently. - `bash -n` and `shellcheck` clean. AI assistance (Claude Code) was used for this change. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request optimizes the CI pipeline by splitting the lint matrix so that documentation-prose-only pull requests skip expensive code-oriented lint checks while still running prose-relevant checks. It also updates the banned words check to include .md and .ipynb files and report all violations before exiting. The reviewer suggested replacing grep -R with git grep in the banned words check to avoid traversing symlinks and scanning untracked files, which improves performance and prevents false positives.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
Reviewed by Cursor Bugbot for commit f5d508c. Configure here.
## Drop `pre_commit_docs` (Bugbot)
Bugbot correctly caught that this step was theater. `.pre-commit-config.yaml`
excludes `doc/source/` in its top-level `exclude:` block, so
`trailing-whitespace`, `end-of-file-fixer`, and `check-added-large-files`
cannot see the prose a documentation change actually touches. My earlier
reasoning only checked the per-hook `files`/`types` filters and missed the
global exclude.
Measured: 588 of the 596 `.md`/`.rst` files under `doc/` are excluded. The 8
that aren't are `doc/README.md`, `doc/redirects/README.md`, and the
`doc/.claude/` agent files. Verified directly by adding trailing whitespace to
both `doc/source/index.rst` and `doc/README.md` and running the hook: it fixed
`doc/README.md` and left `doc/source/index.rst` untouched.
So the step would have cost 39s to cover almost nothing. Removed, and the
claim it supported is removed from `ci.md` as well. A prose-only PR now runs
four lint steps rather than five.
The real problem is that `doc/source/` is in that global exclude at all, which
means whitespace and end-of-file hygiene is unchecked for every Ray doc page
on every PR, and was before this PR too. Fixing it means removing the exclude
and absorbing a large mechanical diff, so it belongs in its own change.
`ci.md` and `lint.rayci.yml` now say so explicitly rather than implying prose
gets coverage it doesn't.
## Use `git grep` in the banned-words check (Gemini)
Good suggestion, taken. `grep -R` follows symlinks, unlike `-r`, so it would
traverse `bazel-out`/`bazel-bin` on a local run, and it scans untracked files,
so an untracked virtualenv containing an installed Ray could produce false
positives. `git grep` searches tracked files only, which avoids both and adds
line numbers to the output.
## Testing
- `./ci/lint/check-banned-words.sh` passes on the tree (exit 0). Re-verified
non-vacuous with the `git grep` implementation: a staged `doc/canary.md`
containing all three words is caught, reports all three with line numbers,
and exits 1; removing it returns exit 0.
- `rayci test-rules` still passes (130 cases).
- Step-selection simulation after removing the step: prose-only emits
`{always}` and runs 4 lint steps plus the label-gated docs-go guard, with 10
code-oriented steps filtered; `{always, lint}` runs all 15.
- `bash -n` and `shellcheck` clean on both shell scripts.
- Confirmed no dangling `pre_commit_docs` references remain in `ci/`,
`.buildkite/`, or `doc/`.
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
|
Both bot findings were correct and are addressed in 8928685. Bugbot:
|
…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]>
…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]>
…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]>

Why
A Markdown-only PR (#65285, one file under
doc/) ran all 15 lint steps and took 27+ minutes onmicrocheck(build 51723).clang_format,bazel_buildifier,bazel_team,copyright_format,dashboard_format,pytest_format,semgrep_lint, andtest_coverageall 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_formatspent 858s cloning to do 143s of work.Two things made every step run:
always.rules.txthad no file-shape scoping at all — a bare*catch-all emittingalways lintfor every changed file.alwaysin addition tolint, so scoping thelinttag 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 emitsalwayswithoutlintfor.md,.rst, image assets, anddoc/.claude/. The path set matches the existing prose skip rule intest.rules.txtso the two files agree on what prose is.lint.rayci.yml: split thelint-smallmatrix in two. Steps a prose change can actually fail keepalways; the code-oriented steps carrylintalone and are filtered out on a prose-only diff. Same for pydoclint.lint.sh: addpre_commit_docs, running the three hooks that actually reach prose (trailing-whitespace,end-of-file-fixer,check-added-large-files). The other 20 hooks inpre_commitare scoped to Python, C++, BUILD, TS/TSX, or shell.pre_commitruns 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.
alwaysis emitted for every file by the catch-all, solintalone 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
lintand the full matrix runs — mixed PRs lose no coverage. Non-PR builds bypass rule evaluation entirely (needRunAllTagsreturns["*"]for master, release branches, and manual builds), so post-merge lint coverage is unchanged.The microcheck pipeline's hardcoded
RAYCI_SELECT=...,tag:lintis not a blocker:stepFilter.acceptisacceptSelectHit(step) && acceptTagHit(step), so selects and rule-emitted tags are ANDed.tag:lintonly makes these steps eligible; the rules still have to emitlint. So the whole change lands in this repo, with no pipeline-definition change.Make
banned_wordscover Markdown (second commit)While classifying which lint steps are prose-relevant, I found
check-banned-words.shdescribes itself as checking "Python and doc files" but only included*.pyand*.rst. Sincedoc/test_no_new_rst.pyrejects newly added.rstfiles, the check was blind to the format every new Ray doc page is written in.*.mdand*.ipynbto the includes.Kuberay→KubeRayindoc/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:
Kuberayin a Buildkite step label in.buildkite/release-automation/pre_release.rayci.yml..ymlstays 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.pyand.ipynbare not exempt, becausepre_commitis the only premerge step that runs black, ruff, and mypy overdoc/source/*.pyat all — exempting all ofdoc/would let aconf.pyformatting violation reach master. This is also why the exemption isn't wired to thedocs-goscope 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/rayciGo evaluator (the authority for tag computation), not the in-repo reference parser:130 cases pass. Added cases to
always.rules.test.txtcovering prose, images, anddoc/.claude/(expectalways), plus the negative casesdoc/source/conf.py,.ipynb,examples.yml,doc/BUILD.bazel, and prose outsidedoc/(expectalways lint). Confirmed non-vacuous by appending a deliberately wrong expectation, which failed as expected — worth noting that theRAYCI_TEST_RULE_FILESenv var mentioned intest-rules' usage text is not actually implemented, so passing it makes the run auto-discover nothing and exit 0.Step selection — simulated
acceptTagHitagainst the newlint.rayci.yml:{always}→ the 5 prose steps run, the 10 code-oriented steps are filtered{always, lint}→ all 15 runpre_commit_docs— ran the three hooks locally: all pass, 39s versus 443s for the fullpre_commitstep.banned_words—./ci/lint/check-banned-words.shpasses on the tree. Verified non-vacuous: a temporarydoc/canary_banned.mdcontaining 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 —
shellcheckandbash -non 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 touchesalways.rules.txt, the lint matrix split, orcheck-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