Repository navigation
[ci] Count the Vale configuration and the API-consistency checker as documentation content in the docs-go scope guard - #65342
Merged
dstrodtman merged 2 commits intoAug 14, 2026
Conversation
…s-go scope guard `ci/lint/validate_docs_go_scope.sh` fails any PR carrying the `docs-go` label if a changed file lives outside `doc/`. Ray's Vale configuration lives at the repository root, so a PR that adds or edits a prose-lint rule can never carry the label, even though it is documentation content by any reasonable reading. Widen the in-scope set to `.vale.ini` and `.vale/` alongside `doc/`, keeping the `BUILD`-file exclusion and both fail-closed paths unchanged. The Vale configuration defines no bazel target, so nothing the label skips can be affected by it, and it holds no executable Ray code, so no doctest or example changes behavior because of it. The check that consumes it, `lint: documentation_style`, carries the `always` tag, so it runs on every pull request whether or not the label is present: this does not let a Vale edit through unlinted. `test.rules.txt` already routes these paths to `doc` alone, which reaches only the post-merge doc build, so no premerge step is traded away. The list is deliberately narrow: it covers the prose rules, not the CI wiring that runs them. `ci/lint/check-documentation-style.sh` and the Vale hook in `.pre-commit-config.yaml` stay out of scope, because a change to either alters what actually runs. Also update the two places that state the predicate in prose, so they don't drift from the script. Signed-off-by: Douglas Strodtman <[email protected]>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the 'validate_docs_go_scope.sh' script to include the Vale prose-lint configuration files ('.vale.ini' and '.vale/') within the scope of documentation content. This allows PRs that modify these configuration files to still use the 'docs-go' label without failing the scope validation check. Additionally, the corresponding documentation in 'CLAUDE.md' and 'ci.md' has been updated to reflect this change. There are no review comments, so I have no feedback to provide.
Second path into the docs-go scope guard, on a different safety argument than the Vale configuration. `ci/ray_ci/doc/` holds the API-consistency checker itself. It is executable CI code, so the "defines no bazel target, holds no executable code" reasoning that admits `.vale.ini` and `.vale/` does not apply to it. What makes it safe is tag routing: * `test.rules.txt` routes `ci/ray_ci/doc/` to `doc_api tools` and nothing else, ahead of the broad `ci/ray_ci/` rule (first match wins). * Every step the label skips carries a library tag instead -- `core_python`, `data`, `llm`, `train`, `tune`, `rllib_directly`, `serve`, and the `*_doc` tags. A change confined to this directory never selects one of them, and the label can only subtract from an already-emitted set, so nothing is traded away. * The two things that do cover the directory are ungated: the `doc_api` API checks, and the `tools` job that runs the six `ci_unit` py_test targets declared here. Editing the checker still runs the checker and its own unit tests, with or without the label. `BUILD` files stay excluded, so a change that alters this directory's test targets still fails the guard even though the directory is now in scope. Also corrects two things on the same surface: * The script's header claimed the label skips the API consistency checks. It does not -- `doc.rayci.yml` leaves them deliberately ungated, and a build carrying the label runs both of them. `ci.md` already said this correctly. * The failure message told the reader to remove the label, which on its own cannot produce a corrected build. A Buildkite rebuild replays the label set from the build it was rebuilt from, and the pipeline has `skip_pull_request_builds_for_existing_commits`, so a label-change event on an already-built commit produces no build. Only a new commit yields a build that reads current labels. The message and both prose surfaces now say so. Signed-off-by: Douglas Strodtman <[email protected]>
ronny-anyscale
self-requested a review
August 11, 2026 14:46
ronny-anyscale
approved these changes
Aug 11, 2026
This was referenced Aug 11, 2026
elliot-barn
approved these changes
Aug 14, 2026
dstrodtman
added a commit
that referenced
this pull request
Aug 14, 2026
…65391) ## Why this change `ci/ray_ci/doc/` holds the documentation site build and the API-reference guards, but there's no orientation for anyone opening it. Nine modules, three of which are entry points, and the wiring that decides which is which lives in three other files (`.buildkite/doc.rayci.yml`, `.buildkite/lint.rayci.yml`, `ci/lint/lint.sh`). Reading the directory alone gives you the wrong model of it. The same is true one level up: `doc.rayci.yml` opens straight at `group: doc` with no statement of what the pipeline does, and the two rules files that decide what CI runs for *every* PR in the repo don't say anywhere that that's what they do. This PR is descriptive only. No step, rule, tag, or target changes behavior. ## What's here **New `ci/ray_ci/doc/README.md`.** What each entry point does and where it's invoked from, what the shared libraries contribute, and two things the layout actively misleads on: - `cmd_check_api_discrepancy` and `cmd_check_api_param_coverage` have `py_binary` targets but don't run through Bazel in CI. `lint.sh` invokes them with the docbuild image's interpreter, because the Bazel targets resolve `@py_deps_py310` wheels that can't import under the py3.11 docbuild image. There's already a `TODO(elliot-barn)` on #64070 to undo this once hermetic py3.11 lands. - The `doc: check API annotations` step isn't this package at all — it runs `ci/lint/check_api_annotations.py`. Easy to assume otherwise, since it sits next to `doc: check API doc consistency`, which *is* this package. **Header comment on `.buildkite/doc.rayci.yml`** listing the steps in order and what each is for, and noting that tag rules, not this file, decide what runs on a given PR. **Scope notes on `.buildkite/test.rules.txt` and `always.rules.txt`.** Both decide what CI runs for every pull request in the repository, so an edit is a repo-wide change rather than a local one. The note also records that rules are first-match-wins in file order, which makes rule *position* as load-bearing as rule content, and points at the in-repo check to run. **Two removals.** - `ci/ray_ci/doc/test_update_cache_env.py` imports `ci.ray_ci.doc.cmd_update_cache_env`, which was deleted in #47233 (Aug 2024). The test was added later, in #64277, so it has never been able to import since the day it landed. It also has no `py_test` target, which is why nothing ran it and nothing reported it was broken. - A stale cross-repo pointer in the `api_param_coverage` module docstring, referencing a path outside this repository that readers here can't follow. The paragraphs above it already describe the check's scope, so nothing is lost. ## Not a duplicate Checked open PRs for the touched areas per `AGENTS.md`: ``` gh pr list --repo ray-project/ray --state open --search "ray_ci/doc README" gh pr list --repo ray-project/ray --state open --search "test_update_cache_env" gh pr list --repo ray-project/ray --state open --search "test.rules.txt header comment" ``` No open PR adds a README here, touches the dead test, or comments these files. Two PRs matched the third search on body text only (#65342, #64977); I confirmed against their file lists that neither touches `doc.rayci.yml`, `test.rules.txt`, or `always.rules.txt`. #65211 touches `ci/ray_ci/doc/api.py`, a different file in the same directory, and doesn't conflict. ## Testing ``` bazel test //ci/pipeline:test_doc_api_rules_sync //ci/ray_ci/doc/... ``` 7/7 pass (`test_doc_api_rules_sync`, `test_api`, `test_api_param_coverage`, `test_autodoc`, `test_build_cache`, `test_cmd_check_api_discrepancy`, `test_module`). Because the comments land on rule files, I also confirmed the rules still parse and emit identical tags, loading both files through `ci/pipeline/determine_tests_to_run.py` and comparing `match_tags` output before and after. Comments are ignored by the parser and nothing moved. `pre-commit run` passes on every changed file. ## AI assistance This change was written with AI assistance. I reviewed every line, ran the tests above myself, and can defend the change end-to-end. Every technical claim in the added comments was verified against the source rather than inferred: the invocation paths from `lint.sh` and the pipeline YAML, the first-match-wins ordering from `TagRuleSet.match_tags`, and the dead import from `git log` on the deleted module plus a direct import attempt. --------- Signed-off-by: Douglas Strodtman <[email protected]>
dstrodtman
added a commit
that referenced
this pull request
Aug 14, 2026
…65375) ## Description Two related fixes to the Vale setup. ### 1. The `vale` pre-commit hook has never run The top-level `exclude` in `.pre-commit-config.yaml` lists `doc/source/`, and pre-commit ANDs that global `exclude` with each hook's own `files` pattern. The Vale hook's pattern, `^doc/source/data/.*\.(md|rst)$`, lives entirely inside `doc/source/`, so the two can never both be satisfied and the hook matches zero files: ``` $ pre-commit run vale --all-files vale.................................................(no files to check)Skipped ``` Committing a change under `doc/source/data` skips it silently too. Vale still ran in CI through `ci/lint/check-documentation-style.sh`, so the gate existed, but contributors got no local signal, and a green pre-commit run said nothing at all about Vale. This narrows the `doc/source/` entry to `doc/source/(?!data/.*[.](md|rst)$)`, so it keeps excluding the tree except the prose the hook targets. Narrowing it also exposes those 48 files to hooks that had never seen them. Three needed exemptions, all recorded in the config with comments: * `trailing-whitespace` and `end-of-file-fixer` would rewrite 17 unrelated files. I've exempted those two hooks from `doc/source/data` so that enabling Vale stays a config-only change. **The whitespace cleanup is worth doing, and I'm happy to send it as its own PR** rather than bury it here, partly because three of those 17 files are also touched by the open #65372. * `semgrep` would fail. Caught by Cursor Bugbot, and it was right. `semgrep.yml`'s `code-block-python` rule lists `doc/source/data/**/*.rst` in its `paths.include` at `severity: ERROR`, there are 8 pre-existing violations across 5 files, and `ci/lint/lint.sh` runs `pre-commit run semgrep --all-files` as the `semgrep_lint` step. Converting those code blocks to `testcode` is real work that belongs in its own PR, not in a Vale change. The two rST hooks that also become eligible pass as-is. If you'd rather just take the whitespace churn here, say so and I'll fold it in. **A bigger finding, which I'm raising rather than fixing here.** That `semgrep` exemption is a second instance of the same bug, not a new one. Because the top-level `exclude` has covered `doc/source/`, the `code-block-python` rule has never run on **any** of the five doc paths it targets: 31 occurrences across 16 files in `doc/source/data`, `ray-core`, `ray-observability`, and `train`. Every one is an untested documentation snippet the rule was written to catch. Happy to take that on as a follow-up, but converting snippets means they start executing in CI, so it wants a maintainer opinion on scope and on whether the rule is still wanted for docs at all. ### 2. Vale was pinned to 3.4.1, from June 2024 This upgrades both the hook `rev` and the CI script to 3.17.1. The bump isn't inert, so three supporting changes come with it. `Vale.Spelling` produces **no alerts at all** under 3.4.1, but 11 error-severity alerts under 3.17.1, because the newer engine word-boundary-anchors vocabulary patterns. Existing entries such as `[Bb]ackpressure`, `dtype`, and `namespace` therefore stopped covering `backpressured`, `dtypes`, and `namespaces`. This widens those three and adds terms that were never listed at all: `Databricks`, `Datasink`, `Multimodality`, `preprocess`, `resample`, `vCPU`, `Vectorizer`. Two Google rules also became error-severity on content where they're wrong, so they're set to `warning` rather than editing correct prose: * `Google.HeadingPunctuation` reads the period in a numbered heading such as `### 1. Label your worker nodes` as a heading-ending period. The match it reports is literally `1.`. * `Google.OxfordComma` fires on "X, A and B" where A and B modify X rather than continuing a list, as in "resources used by all operators, active and requested". Both follow the existing precedent of tuning Google rules in `.vale.ini` alongside `Google.Colons` and `Google.Headings`, and both preserve 3.4.1's effective behavior, where neither rule blocked. ## Related issues None. Cross-referencing two of my own open PRs that touch adjacent surfaces, neither of which shares a file with this one: * #65368 removes the banned-words lint in favor of Vale. That increases how much Ray leans on Vale, which makes a dead local hook and a two-year-old pin more worth fixing. Touches `ci/lint/check-banned-words.sh`, `ci/lint/lint.sh`, and `.buildkite/lint.rayci.yml`. * #65342 makes the docs-go scope guard count Vale configuration as documentation content. Worth noting that after it merges, a Vale-config-only PR like this one would classify as documentation. Touches `ci/lint/validate_docs_go_scope.sh`. ## Additional information **AI assistance was used.** I used Claude Code to investigate and draft this. I reviewed every changed line, ran the measurements below myself, and can defend the change end to end. **Not a duplicate.** `gh pr list --repo ray-project/ray --state open --search "vale in:title"` and the same for `pre-commit` return only #65368 and #65342 above, which change different files and have different goals. **Measurements**, on the exact set `ci/lint/check-documentation-style.sh` lints (`doc/source/data` and `doc/source/ray-overview/examples`): | Vale | Total alerts | Error-severity | Exit code | Lint step | |---|---|---|---|---| | 3.4.1 (current pin) | 162 | 0 | 0 | green | | 3.17.1, bump alone | 208 | 14 | 1 | **red** | | 3.17.1, with this PR | 196 | 0 | 0 | green | That middle row is the reason the vocabulary and `.vale.ini` changes are in the same PR as the version bump: without them the bump turns `lint: documentation_style` red. **Checks run locally:** ``` # the CI script's exact target set, both versions vale doc/source/data doc/source/ray-overview/examples # 3.4.1 -> exit 0; 3.17.1 pre-fix -> exit 1; post-fix -> exit 0 # the hook now actually matches files and passes pre-commit run vale --files doc/source/data/data-internals.rst # vale.....................................................................Passed # and genuinely fails, rather than passing vacuously: appended a line # containing "This sentance has a deliberate spelling mistake." pre-commit run vale --files doc/source/data/data-internals.rst # 349:6 error Did you really mean 'sentance'? Vale.Spelling # 1 error, 0 warnings and 17 suggestions in 1 file. # the two hooks I exempted stay exempt, so no file churn pre-commit run trailing-whitespace --files $(git ls-files 'doc/source/data' | grep -E '\.(md|rst)$') pre-commit run end-of-file-fixer --files $(git ls-files 'doc/source/data' | grep -E '\.(md|rst)$') # both: (no files to check)Skipped # the two rST hooks that newly become eligible pre-commit run rst-directive-colons --files ... # Passed pre-commit run rst-inline-touching-normal --files ... # Passed ``` I also confirmed the 3.17.1 release publishes the two asset filenames the CI script downloads, `vale_3.17.1_Linux_64-bit.tar.gz` and `vale_3.17.1_macOS_arm64.tar.gz`. **Net effect:** contributors get Vale locally, CI runs a Vale two years newer, and `Vale.Spelling` becomes an enforced check instead of a silent one. --------- Signed-off-by: Douglas Strodtman <[email protected]>
400Ping
pushed a commit
to 400Ping/ray
that referenced
this pull request
Aug 18, 2026
…documentation content in the docs-go scope guard (ray-project#65342) ## Why this change is needed `ci/lint/validate_docs_go_scope.sh` fails any pull request carrying the `docs-go` label if a changed file lives outside `doc/`. Two kinds of documentation work live outside `doc/` and are therefore locked out of the label today: - **Ray's Vale configuration** (`.vale.ini`, `.vale/`) sits at the repository root, so a PR that adds or edits a prose-lint rule can never carry the label even though it is documentation content by any reasonable reading. Concretely: ray-project#65239 adds KubeRay style rules and edits `doc/source/ray-contribute/writing-style.md`. Its [premerge build](https://buildkite.com/ray-project/premerge/builds/71732) has exactly one failing job, `lint: validate docs-go scope`. Every other check passes. - **The API-consistency checker's own source** (`ci/ray_ci/doc/`) is the tooling behind the `doc: check API doc consistency` step. Same shape: ray-project#65340 changes only that directory, and the label's guard is the sole red job on its [premerge build](https://buildkite.com/ray-project/premerge/builds/71727). In both cases the author's options today are to drop the label and wait on per-library example suites the PR cannot possibly affect, or to split a coherent change across two PRs. ## What changed Widen the guard's in-scope set from "under `doc/`" to "under `doc/`, the Vale prose-lint configuration (`.vale.ini`, `.vale/`), or the API-consistency checker (`ci/ray_ci/doc/`)". Both fail-closed paths (no merge-base, empty diff) are unchanged, and the `BUILD`-file exclusion now applies uniformly across the whole in-scope set rather than just `doc/`. Also updates the two places that state the predicate in prose, so they don't drift from the script: the `docs-go` section of `doc/source/ray-contribute/ci.md`, and `doc/.claude/CLAUDE.md`. ## Why this is safe The guard exists so `docs-go` can skip the 12 per-library docs example and llm test steps only on a PR that could not break them. The two additions clear that bar on different grounds, which is worth stating separately rather than blurring into one rule. **The Vale configuration** clears it on content: - **It defines no bazel target.** The separate `BUILD`-file exclusion is the mechanism that protects test targets, and it stays intact. - **It holds no executable Ray code**, so no doctest or example can change behavior because of it. - **The check that consumes it already runs unconditionally.** `lint: documentation_style` sits in the `lint-small-prose` matrix in `.buildkite/lint.rayci.yml` carrying `always`, which `always.rules.txt` emits for every changed file. Vale therefore runs on every pull request whether or not the label is present. - **No premerge step is traded away.** `test.rules.txt` already routes `.vale.ini` and `.vale/` to `doc` alone, in the rendering-and-validation-only block. That tag reaches `doc: build`, which carries `skip-on-premerge`. **The checker source** is executable CI code, so the reasoning above does not apply to it. It clears the bar on tag routing: - **`test.rules.txt` routes `ci/ray_ci/doc/` to `doc_api tools` and nothing else**, ahead of the broad `ci/ray_ci/` rule, and first match wins. - **Every step the label skips carries a library tag instead** — `core_python`, `data`, `llm`, `train`, `tune`, `rllib_directly`, `serve`, and the `*_doc` tags. A change confined to this directory never emits a tag that selects one of them. Since the label's `if:` can only suppress an already-emitted step, there is nothing for it to take away. - **Measured on the same commit, with and without the label.** ray-project#65340 was built twice: [71727](https://buildkite.com/ray-project/premerge/builds/71727) carried `["go", "docs-go"]` and [71736](https://buildkite.com/ray-project/premerge/builds/71736) carried `["go"]`. Both emitted the same 33 jobs, and diffing the two job-name sets yields no difference in either direction. The label's only effect on such a PR is whether this guard itself is emitted: it ran and failed in the first build, and was `broken` (never emitted) in the second. That is the claim above, observed rather than derived. - **The checks that do cover the directory are ungated.** The `doc_api` API checks and the `tools` job running this directory's six `ci_unit` py_test targets both run with the label present. Build 71727 is the direct evidence: it carried `docs-go` and ran `doc: check API annotations`, `doc: check API doc consistency`, and all six `//ci/ray_ci/doc:*` targets, all green. - **`BUILD` files stay excluded**, so a change to this directory's test targets still fails the guard. ray-project#65340 is exactly that case: it adds a `py_test` src, so it would still not qualify for the label after this change. That is the intended outcome. Each list is deliberately narrow. For Vale it covers the prose rules, not the CI wiring that runs them: `ci/lint/check-documentation-style.sh` and the Vale hook in `.pre-commit-config.yaml` stay out of scope, because a change to either one alters what actually runs. For the checker it covers `ci/ray_ci/doc/` only, not the shared `ci/ray_ci/` tooling that every bazel test step runs through. ## Two corrections on the same surface - **The script's header comment claimed the label skips the API consistency checks.** It doesn't. `doc.rayci.yml` leaves them deliberately ungated, precisely because an API reference page edit is the content-only change they must cover, and build 71727 confirms both ran under the label. `ci.md` already described this correctly, so only the script was wrong. - **The failure message advised an action that cannot work.** It said "Remove the 'docs-go' label so the appropriate tests run," but removing the label cannot produce a corrected build on the same commit. A Buildkite rebuild replays the label set from the build it was rebuilt from, and the pipeline sets `skip_pull_request_builds_for_existing_commits`, so the `unlabeled` event on an already-built commit produces no build at all. Verified on ray-project#65340: `docs-go` was removed at 19:59:30Z, build 71727 was created at 20:00:03Z as a UI rebuild, and its payload still carried `["go", "docs-go"]`. The message and both prose surfaces now say to remove the label *and push a new commit*. ## Checks - [x] I've signed off every commit (`git commit --signoff`). - [x] I've made sure the tests are passing. - Testing Strategy - [x] Manual tests `shellcheck` is clean. The guard was exercised end to end against a controlled base in a scratch repository, 15 cases — the 7 from the Vale-only version, unchanged, plus 8 for the new path: | Changed files | Expected | Result | | --- | --- | --- | | `.vale.ini` + `.vale/styles/**` + a `doc/` page (the ray-project#65239 shape) | pass | pass | | `.vale/styles/**` alone | pass | pass | | a `doc/` page alone (behavior before this change) | pass | pass | | `.vale/styles/**` + a file under `python/ray/` | fail | fail, names the Python file | | `.vale/BUILD.bazel` | fail | fail, names it as a `BUILD` file | | `ci/lint/check-documentation-style.sh` | fail | fail | | `.pre-commit-config.yaml` | fail | fail | | `ci/ray_ci/doc/api.py` alone | pass | pass | | `ci/ray_ci/doc/api.py` + a `doc/` page | pass | pass | | `ci/ray_ci/doc/mock/_internal/__init__.py` | pass | pass | | `ci/ray_ci/doc/BUILD.bazel` (the ray-project#65340 shape) | fail | fail, names it as a `BUILD` file | | `ci/ray_ci/doc/api.py` + a file under `python/ray/` | fail | fail, names the Python file | | `ci/ray_ci/tester.py` (shared tooling, not the checker) | fail | fail | | `ci/ray_ci/docker/**` (sibling path) | fail | fail | | `doc/BUILD.bazel` | fail | fail, unchanged behavior | Note that this PR itself edits `ci/lint/`, so it deliberately does not carry the `docs-go` label. The label's effect on ray-project#65239 is the real confirmation, and I'll rebase that PR onto this once it lands. ## Related ray-project#64775 reserved the `doc` tag for documentation validation. The `docs-go` label and this guard arrived with the content-only escape hatch that followed. ray-project#65340 is the checker-source change that motivated the second path. --------- 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#65391) ## Why this change `ci/ray_ci/doc/` holds the documentation site build and the API-reference guards, but there's no orientation for anyone opening it. Nine modules, three of which are entry points, and the wiring that decides which is which lives in three other files (`.buildkite/doc.rayci.yml`, `.buildkite/lint.rayci.yml`, `ci/lint/lint.sh`). Reading the directory alone gives you the wrong model of it. The same is true one level up: `doc.rayci.yml` opens straight at `group: doc` with no statement of what the pipeline does, and the two rules files that decide what CI runs for *every* PR in the repo don't say anywhere that that's what they do. This PR is descriptive only. No step, rule, tag, or target changes behavior. ## What's here **New `ci/ray_ci/doc/README.md`.** What each entry point does and where it's invoked from, what the shared libraries contribute, and two things the layout actively misleads on: - `cmd_check_api_discrepancy` and `cmd_check_api_param_coverage` have `py_binary` targets but don't run through Bazel in CI. `lint.sh` invokes them with the docbuild image's interpreter, because the Bazel targets resolve `@py_deps_py310` wheels that can't import under the py3.11 docbuild image. There's already a `TODO(elliot-barn)` on ray-project#64070 to undo this once hermetic py3.11 lands. - The `doc: check API annotations` step isn't this package at all — it runs `ci/lint/check_api_annotations.py`. Easy to assume otherwise, since it sits next to `doc: check API doc consistency`, which *is* this package. **Header comment on `.buildkite/doc.rayci.yml`** listing the steps in order and what each is for, and noting that tag rules, not this file, decide what runs on a given PR. **Scope notes on `.buildkite/test.rules.txt` and `always.rules.txt`.** Both decide what CI runs for every pull request in the repository, so an edit is a repo-wide change rather than a local one. The note also records that rules are first-match-wins in file order, which makes rule *position* as load-bearing as rule content, and points at the in-repo check to run. **Two removals.** - `ci/ray_ci/doc/test_update_cache_env.py` imports `ci.ray_ci.doc.cmd_update_cache_env`, which was deleted in ray-project#47233 (Aug 2024). The test was added later, in ray-project#64277, so it has never been able to import since the day it landed. It also has no `py_test` target, which is why nothing ran it and nothing reported it was broken. - A stale cross-repo pointer in the `api_param_coverage` module docstring, referencing a path outside this repository that readers here can't follow. The paragraphs above it already describe the check's scope, so nothing is lost. ## Not a duplicate Checked open PRs for the touched areas per `AGENTS.md`: ``` gh pr list --repo ray-project/ray --state open --search "ray_ci/doc README" gh pr list --repo ray-project/ray --state open --search "test_update_cache_env" gh pr list --repo ray-project/ray --state open --search "test.rules.txt header comment" ``` No open PR adds a README here, touches the dead test, or comments these files. Two PRs matched the third search on body text only (ray-project#65342, ray-project#64977); I confirmed against their file lists that neither touches `doc.rayci.yml`, `test.rules.txt`, or `always.rules.txt`. ray-project#65211 touches `ci/ray_ci/doc/api.py`, a different file in the same directory, and doesn't conflict. ## Testing ``` bazel test //ci/pipeline:test_doc_api_rules_sync //ci/ray_ci/doc/... ``` 7/7 pass (`test_doc_api_rules_sync`, `test_api`, `test_api_param_coverage`, `test_autodoc`, `test_build_cache`, `test_cmd_check_api_discrepancy`, `test_module`). Because the comments land on rule files, I also confirmed the rules still parse and emit identical tags, loading both files through `ci/pipeline/determine_tests_to_run.py` and comparing `match_tags` output before and after. Comments are ignored by the parser and nothing moved. `pre-commit run` passes on every changed file. ## AI assistance This change was written with AI assistance. I reviewed every line, ran the tests above myself, and can defend the change end-to-end. Every technical claim in the added comments was verified against the source rather than inferred: the invocation paths from `lint.sh` and the pipeline YAML, the first-match-wins ordering from `TagRuleSet.match_tags`, and the dead import from `git log` on the deleted module plus a direct import attempt. --------- 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#65375) ## Description Two related fixes to the Vale setup. ### 1. The `vale` pre-commit hook has never run The top-level `exclude` in `.pre-commit-config.yaml` lists `doc/source/`, and pre-commit ANDs that global `exclude` with each hook's own `files` pattern. The Vale hook's pattern, `^doc/source/data/.*\.(md|rst)$`, lives entirely inside `doc/source/`, so the two can never both be satisfied and the hook matches zero files: ``` $ pre-commit run vale --all-files vale.................................................(no files to check)Skipped ``` Committing a change under `doc/source/data` skips it silently too. Vale still ran in CI through `ci/lint/check-documentation-style.sh`, so the gate existed, but contributors got no local signal, and a green pre-commit run said nothing at all about Vale. This narrows the `doc/source/` entry to `doc/source/(?!data/.*[.](md|rst)$)`, so it keeps excluding the tree except the prose the hook targets. Narrowing it also exposes those 48 files to hooks that had never seen them. Three needed exemptions, all recorded in the config with comments: * `trailing-whitespace` and `end-of-file-fixer` would rewrite 17 unrelated files. I've exempted those two hooks from `doc/source/data` so that enabling Vale stays a config-only change. **The whitespace cleanup is worth doing, and I'm happy to send it as its own PR** rather than bury it here, partly because three of those 17 files are also touched by the open ray-project#65372. * `semgrep` would fail. Caught by Cursor Bugbot, and it was right. `semgrep.yml`'s `code-block-python` rule lists `doc/source/data/**/*.rst` in its `paths.include` at `severity: ERROR`, there are 8 pre-existing violations across 5 files, and `ci/lint/lint.sh` runs `pre-commit run semgrep --all-files` as the `semgrep_lint` step. Converting those code blocks to `testcode` is real work that belongs in its own PR, not in a Vale change. The two rST hooks that also become eligible pass as-is. If you'd rather just take the whitespace churn here, say so and I'll fold it in. **A bigger finding, which I'm raising rather than fixing here.** That `semgrep` exemption is a second instance of the same bug, not a new one. Because the top-level `exclude` has covered `doc/source/`, the `code-block-python` rule has never run on **any** of the five doc paths it targets: 31 occurrences across 16 files in `doc/source/data`, `ray-core`, `ray-observability`, and `train`. Every one is an untested documentation snippet the rule was written to catch. Happy to take that on as a follow-up, but converting snippets means they start executing in CI, so it wants a maintainer opinion on scope and on whether the rule is still wanted for docs at all. ### 2. Vale was pinned to 3.4.1, from June 2024 This upgrades both the hook `rev` and the CI script to 3.17.1. The bump isn't inert, so three supporting changes come with it. `Vale.Spelling` produces **no alerts at all** under 3.4.1, but 11 error-severity alerts under 3.17.1, because the newer engine word-boundary-anchors vocabulary patterns. Existing entries such as `[Bb]ackpressure`, `dtype`, and `namespace` therefore stopped covering `backpressured`, `dtypes`, and `namespaces`. This widens those three and adds terms that were never listed at all: `Databricks`, `Datasink`, `Multimodality`, `preprocess`, `resample`, `vCPU`, `Vectorizer`. Two Google rules also became error-severity on content where they're wrong, so they're set to `warning` rather than editing correct prose: * `Google.HeadingPunctuation` reads the period in a numbered heading such as `### 1. Label your worker nodes` as a heading-ending period. The match it reports is literally `1.`. * `Google.OxfordComma` fires on "X, A and B" where A and B modify X rather than continuing a list, as in "resources used by all operators, active and requested". Both follow the existing precedent of tuning Google rules in `.vale.ini` alongside `Google.Colons` and `Google.Headings`, and both preserve 3.4.1's effective behavior, where neither rule blocked. ## Related issues None. Cross-referencing two of my own open PRs that touch adjacent surfaces, neither of which shares a file with this one: * ray-project#65368 removes the banned-words lint in favor of Vale. That increases how much Ray leans on Vale, which makes a dead local hook and a two-year-old pin more worth fixing. Touches `ci/lint/check-banned-words.sh`, `ci/lint/lint.sh`, and `.buildkite/lint.rayci.yml`. * ray-project#65342 makes the docs-go scope guard count Vale configuration as documentation content. Worth noting that after it merges, a Vale-config-only PR like this one would classify as documentation. Touches `ci/lint/validate_docs_go_scope.sh`. ## Additional information **AI assistance was used.** I used Claude Code to investigate and draft this. I reviewed every changed line, ran the measurements below myself, and can defend the change end to end. **Not a duplicate.** `gh pr list --repo ray-project/ray --state open --search "vale in:title"` and the same for `pre-commit` return only ray-project#65368 and ray-project#65342 above, which change different files and have different goals. **Measurements**, on the exact set `ci/lint/check-documentation-style.sh` lints (`doc/source/data` and `doc/source/ray-overview/examples`): | Vale | Total alerts | Error-severity | Exit code | Lint step | |---|---|---|---|---| | 3.4.1 (current pin) | 162 | 0 | 0 | green | | 3.17.1, bump alone | 208 | 14 | 1 | **red** | | 3.17.1, with this PR | 196 | 0 | 0 | green | That middle row is the reason the vocabulary and `.vale.ini` changes are in the same PR as the version bump: without them the bump turns `lint: documentation_style` red. **Checks run locally:** ``` # the CI script's exact target set, both versions vale doc/source/data doc/source/ray-overview/examples # 3.4.1 -> exit 0; 3.17.1 pre-fix -> exit 1; post-fix -> exit 0 # the hook now actually matches files and passes pre-commit run vale --files doc/source/data/data-internals.rst # vale.....................................................................Passed # and genuinely fails, rather than passing vacuously: appended a line # containing "This sentance has a deliberate spelling mistake." pre-commit run vale --files doc/source/data/data-internals.rst # 349:6 error Did you really mean 'sentance'? Vale.Spelling # 1 error, 0 warnings and 17 suggestions in 1 file. # the two hooks I exempted stay exempt, so no file churn pre-commit run trailing-whitespace --files $(git ls-files 'doc/source/data' | grep -E '\.(md|rst)$') pre-commit run end-of-file-fixer --files $(git ls-files 'doc/source/data' | grep -E '\.(md|rst)$') # both: (no files to check)Skipped # the two rST hooks that newly become eligible pre-commit run rst-directive-colons --files ... # Passed pre-commit run rst-inline-touching-normal --files ... # Passed ``` I also confirmed the 3.17.1 release publishes the two asset filenames the CI script downloads, `vale_3.17.1_Linux_64-bit.tar.gz` and `vale_3.17.1_macOS_arm64.tar.gz`. **Net effect:** contributors get Vale locally, CI runs a Vale two years newer, and `Vale.Spelling` becomes an enforced check instead of a silent one. --------- Signed-off-by: Douglas Strodtman <[email protected]> Signed-off-by: 400Ping <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…documentation content in the docs-go scope guard (ray-project#65342) ## Why this change is needed `ci/lint/validate_docs_go_scope.sh` fails any pull request carrying the `docs-go` label if a changed file lives outside `doc/`. Two kinds of documentation work live outside `doc/` and are therefore locked out of the label today: - **Ray's Vale configuration** (`.vale.ini`, `.vale/`) sits at the repository root, so a PR that adds or edits a prose-lint rule can never carry the label even though it is documentation content by any reasonable reading. Concretely: ray-project#65239 adds KubeRay style rules and edits `doc/source/ray-contribute/writing-style.md`. Its [premerge build](https://buildkite.com/ray-project/premerge/builds/71732) has exactly one failing job, `lint: validate docs-go scope`. Every other check passes. - **The API-consistency checker's own source** (`ci/ray_ci/doc/`) is the tooling behind the `doc: check API doc consistency` step. Same shape: ray-project#65340 changes only that directory, and the label's guard is the sole red job on its [premerge build](https://buildkite.com/ray-project/premerge/builds/71727). In both cases the author's options today are to drop the label and wait on per-library example suites the PR cannot possibly affect, or to split a coherent change across two PRs. ## What changed Widen the guard's in-scope set from "under `doc/`" to "under `doc/`, the Vale prose-lint configuration (`.vale.ini`, `.vale/`), or the API-consistency checker (`ci/ray_ci/doc/`)". Both fail-closed paths (no merge-base, empty diff) are unchanged, and the `BUILD`-file exclusion now applies uniformly across the whole in-scope set rather than just `doc/`. Also updates the two places that state the predicate in prose, so they don't drift from the script: the `docs-go` section of `doc/source/ray-contribute/ci.md`, and `doc/.claude/CLAUDE.md`. ## Why this is safe The guard exists so `docs-go` can skip the 12 per-library docs example and llm test steps only on a PR that could not break them. The two additions clear that bar on different grounds, which is worth stating separately rather than blurring into one rule. **The Vale configuration** clears it on content: - **It defines no bazel target.** The separate `BUILD`-file exclusion is the mechanism that protects test targets, and it stays intact. - **It holds no executable Ray code**, so no doctest or example can change behavior because of it. - **The check that consumes it already runs unconditionally.** `lint: documentation_style` sits in the `lint-small-prose` matrix in `.buildkite/lint.rayci.yml` carrying `always`, which `always.rules.txt` emits for every changed file. Vale therefore runs on every pull request whether or not the label is present. - **No premerge step is traded away.** `test.rules.txt` already routes `.vale.ini` and `.vale/` to `doc` alone, in the rendering-and-validation-only block. That tag reaches `doc: build`, which carries `skip-on-premerge`. **The checker source** is executable CI code, so the reasoning above does not apply to it. It clears the bar on tag routing: - **`test.rules.txt` routes `ci/ray_ci/doc/` to `doc_api tools` and nothing else**, ahead of the broad `ci/ray_ci/` rule, and first match wins. - **Every step the label skips carries a library tag instead** — `core_python`, `data`, `llm`, `train`, `tune`, `rllib_directly`, `serve`, and the `*_doc` tags. A change confined to this directory never emits a tag that selects one of them. Since the label's `if:` can only suppress an already-emitted step, there is nothing for it to take away. - **Measured on the same commit, with and without the label.** ray-project#65340 was built twice: [71727](https://buildkite.com/ray-project/premerge/builds/71727) carried `["go", "docs-go"]` and [71736](https://buildkite.com/ray-project/premerge/builds/71736) carried `["go"]`. Both emitted the same 33 jobs, and diffing the two job-name sets yields no difference in either direction. The label's only effect on such a PR is whether this guard itself is emitted: it ran and failed in the first build, and was `broken` (never emitted) in the second. That is the claim above, observed rather than derived. - **The checks that do cover the directory are ungated.** The `doc_api` API checks and the `tools` job running this directory's six `ci_unit` py_test targets both run with the label present. Build 71727 is the direct evidence: it carried `docs-go` and ran `doc: check API annotations`, `doc: check API doc consistency`, and all six `//ci/ray_ci/doc:*` targets, all green. - **`BUILD` files stay excluded**, so a change to this directory's test targets still fails the guard. ray-project#65340 is exactly that case: it adds a `py_test` src, so it would still not qualify for the label after this change. That is the intended outcome. Each list is deliberately narrow. For Vale it covers the prose rules, not the CI wiring that runs them: `ci/lint/check-documentation-style.sh` and the Vale hook in `.pre-commit-config.yaml` stay out of scope, because a change to either one alters what actually runs. For the checker it covers `ci/ray_ci/doc/` only, not the shared `ci/ray_ci/` tooling that every bazel test step runs through. ## Two corrections on the same surface - **The script's header comment claimed the label skips the API consistency checks.** It doesn't. `doc.rayci.yml` leaves them deliberately ungated, precisely because an API reference page edit is the content-only change they must cover, and build 71727 confirms both ran under the label. `ci.md` already described this correctly, so only the script was wrong. - **The failure message advised an action that cannot work.** It said "Remove the 'docs-go' label so the appropriate tests run," but removing the label cannot produce a corrected build on the same commit. A Buildkite rebuild replays the label set from the build it was rebuilt from, and the pipeline sets `skip_pull_request_builds_for_existing_commits`, so the `unlabeled` event on an already-built commit produces no build at all. Verified on ray-project#65340: `docs-go` was removed at 19:59:30Z, build 71727 was created at 20:00:03Z as a UI rebuild, and its payload still carried `["go", "docs-go"]`. The message and both prose surfaces now say to remove the label *and push a new commit*. ## Checks - [x] I've signed off every commit (`git commit --signoff`). - [x] I've made sure the tests are passing. - Testing Strategy - [x] Manual tests `shellcheck` is clean. The guard was exercised end to end against a controlled base in a scratch repository, 15 cases — the 7 from the Vale-only version, unchanged, plus 8 for the new path: | Changed files | Expected | Result | | --- | --- | --- | | `.vale.ini` + `.vale/styles/**` + a `doc/` page (the ray-project#65239 shape) | pass | pass | | `.vale/styles/**` alone | pass | pass | | a `doc/` page alone (behavior before this change) | pass | pass | | `.vale/styles/**` + a file under `python/ray/` | fail | fail, names the Python file | | `.vale/BUILD.bazel` | fail | fail, names it as a `BUILD` file | | `ci/lint/check-documentation-style.sh` | fail | fail | | `.pre-commit-config.yaml` | fail | fail | | `ci/ray_ci/doc/api.py` alone | pass | pass | | `ci/ray_ci/doc/api.py` + a `doc/` page | pass | pass | | `ci/ray_ci/doc/mock/_internal/__init__.py` | pass | pass | | `ci/ray_ci/doc/BUILD.bazel` (the ray-project#65340 shape) | fail | fail, names it as a `BUILD` file | | `ci/ray_ci/doc/api.py` + a file under `python/ray/` | fail | fail, names the Python file | | `ci/ray_ci/tester.py` (shared tooling, not the checker) | fail | fail | | `ci/ray_ci/docker/**` (sibling path) | fail | fail | | `doc/BUILD.bazel` | fail | fail, unchanged behavior | Note that this PR itself edits `ci/lint/`, so it deliberately does not carry the `docs-go` label. The label's effect on ray-project#65239 is the real confirmation, and I'll rebase that PR onto this once it lands. ## Related ray-project#64775 reserved the `doc` tag for documentation validation. The `docs-go` label and this guard arrived with the content-only escape hatch that followed. ray-project#65340 is the checker-source change that motivated the second path. --------- Signed-off-by: Douglas Strodtman <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…ay-project#65391) ## Why this change `ci/ray_ci/doc/` holds the documentation site build and the API-reference guards, but there's no orientation for anyone opening it. Nine modules, three of which are entry points, and the wiring that decides which is which lives in three other files (`.buildkite/doc.rayci.yml`, `.buildkite/lint.rayci.yml`, `ci/lint/lint.sh`). Reading the directory alone gives you the wrong model of it. The same is true one level up: `doc.rayci.yml` opens straight at `group: doc` with no statement of what the pipeline does, and the two rules files that decide what CI runs for *every* PR in the repo don't say anywhere that that's what they do. This PR is descriptive only. No step, rule, tag, or target changes behavior. ## What's here **New `ci/ray_ci/doc/README.md`.** What each entry point does and where it's invoked from, what the shared libraries contribute, and two things the layout actively misleads on: - `cmd_check_api_discrepancy` and `cmd_check_api_param_coverage` have `py_binary` targets but don't run through Bazel in CI. `lint.sh` invokes them with the docbuild image's interpreter, because the Bazel targets resolve `@py_deps_py310` wheels that can't import under the py3.11 docbuild image. There's already a `TODO(elliot-barn)` on ray-project#64070 to undo this once hermetic py3.11 lands. - The `doc: check API annotations` step isn't this package at all — it runs `ci/lint/check_api_annotations.py`. Easy to assume otherwise, since it sits next to `doc: check API doc consistency`, which *is* this package. **Header comment on `.buildkite/doc.rayci.yml`** listing the steps in order and what each is for, and noting that tag rules, not this file, decide what runs on a given PR. **Scope notes on `.buildkite/test.rules.txt` and `always.rules.txt`.** Both decide what CI runs for every pull request in the repository, so an edit is a repo-wide change rather than a local one. The note also records that rules are first-match-wins in file order, which makes rule *position* as load-bearing as rule content, and points at the in-repo check to run. **Two removals.** - `ci/ray_ci/doc/test_update_cache_env.py` imports `ci.ray_ci.doc.cmd_update_cache_env`, which was deleted in ray-project#47233 (Aug 2024). The test was added later, in ray-project#64277, so it has never been able to import since the day it landed. It also has no `py_test` target, which is why nothing ran it and nothing reported it was broken. - A stale cross-repo pointer in the `api_param_coverage` module docstring, referencing a path outside this repository that readers here can't follow. The paragraphs above it already describe the check's scope, so nothing is lost. ## Not a duplicate Checked open PRs for the touched areas per `AGENTS.md`: ``` gh pr list --repo ray-project/ray --state open --search "ray_ci/doc README" gh pr list --repo ray-project/ray --state open --search "test_update_cache_env" gh pr list --repo ray-project/ray --state open --search "test.rules.txt header comment" ``` No open PR adds a README here, touches the dead test, or comments these files. Two PRs matched the third search on body text only (ray-project#65342, ray-project#64977); I confirmed against their file lists that neither touches `doc.rayci.yml`, `test.rules.txt`, or `always.rules.txt`. ray-project#65211 touches `ci/ray_ci/doc/api.py`, a different file in the same directory, and doesn't conflict. ## Testing ``` bazel test //ci/pipeline:test_doc_api_rules_sync //ci/ray_ci/doc/... ``` 7/7 pass (`test_doc_api_rules_sync`, `test_api`, `test_api_param_coverage`, `test_autodoc`, `test_build_cache`, `test_cmd_check_api_discrepancy`, `test_module`). Because the comments land on rule files, I also confirmed the rules still parse and emit identical tags, loading both files through `ci/pipeline/determine_tests_to_run.py` and comparing `match_tags` output before and after. Comments are ignored by the parser and nothing moved. `pre-commit run` passes on every changed file. ## AI assistance This change was written with AI assistance. I reviewed every line, ran the tests above myself, and can defend the change end-to-end. Every technical claim in the added comments was verified against the source rather than inferred: the invocation paths from `lint.sh` and the pipeline YAML, the first-match-wins ordering from `TagRuleSet.match_tags`, and the dead import from `git log` on the deleted module plus a direct import attempt. --------- Signed-off-by: Douglas Strodtman <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…ay-project#65375) ## Description Two related fixes to the Vale setup. ### 1. The `vale` pre-commit hook has never run The top-level `exclude` in `.pre-commit-config.yaml` lists `doc/source/`, and pre-commit ANDs that global `exclude` with each hook's own `files` pattern. The Vale hook's pattern, `^doc/source/data/.*\.(md|rst)$`, lives entirely inside `doc/source/`, so the two can never both be satisfied and the hook matches zero files: ``` $ pre-commit run vale --all-files vale.................................................(no files to check)Skipped ``` Committing a change under `doc/source/data` skips it silently too. Vale still ran in CI through `ci/lint/check-documentation-style.sh`, so the gate existed, but contributors got no local signal, and a green pre-commit run said nothing at all about Vale. This narrows the `doc/source/` entry to `doc/source/(?!data/.*[.](md|rst)$)`, so it keeps excluding the tree except the prose the hook targets. Narrowing it also exposes those 48 files to hooks that had never seen them. Three needed exemptions, all recorded in the config with comments: * `trailing-whitespace` and `end-of-file-fixer` would rewrite 17 unrelated files. I've exempted those two hooks from `doc/source/data` so that enabling Vale stays a config-only change. **The whitespace cleanup is worth doing, and I'm happy to send it as its own PR** rather than bury it here, partly because three of those 17 files are also touched by the open ray-project#65372. * `semgrep` would fail. Caught by Cursor Bugbot, and it was right. `semgrep.yml`'s `code-block-python` rule lists `doc/source/data/**/*.rst` in its `paths.include` at `severity: ERROR`, there are 8 pre-existing violations across 5 files, and `ci/lint/lint.sh` runs `pre-commit run semgrep --all-files` as the `semgrep_lint` step. Converting those code blocks to `testcode` is real work that belongs in its own PR, not in a Vale change. The two rST hooks that also become eligible pass as-is. If you'd rather just take the whitespace churn here, say so and I'll fold it in. **A bigger finding, which I'm raising rather than fixing here.** That `semgrep` exemption is a second instance of the same bug, not a new one. Because the top-level `exclude` has covered `doc/source/`, the `code-block-python` rule has never run on **any** of the five doc paths it targets: 31 occurrences across 16 files in `doc/source/data`, `ray-core`, `ray-observability`, and `train`. Every one is an untested documentation snippet the rule was written to catch. Happy to take that on as a follow-up, but converting snippets means they start executing in CI, so it wants a maintainer opinion on scope and on whether the rule is still wanted for docs at all. ### 2. Vale was pinned to 3.4.1, from June 2024 This upgrades both the hook `rev` and the CI script to 3.17.1. The bump isn't inert, so three supporting changes come with it. `Vale.Spelling` produces **no alerts at all** under 3.4.1, but 11 error-severity alerts under 3.17.1, because the newer engine word-boundary-anchors vocabulary patterns. Existing entries such as `[Bb]ackpressure`, `dtype`, and `namespace` therefore stopped covering `backpressured`, `dtypes`, and `namespaces`. This widens those three and adds terms that were never listed at all: `Databricks`, `Datasink`, `Multimodality`, `preprocess`, `resample`, `vCPU`, `Vectorizer`. Two Google rules also became error-severity on content where they're wrong, so they're set to `warning` rather than editing correct prose: * `Google.HeadingPunctuation` reads the period in a numbered heading such as `### 1. Label your worker nodes` as a heading-ending period. The match it reports is literally `1.`. * `Google.OxfordComma` fires on "X, A and B" where A and B modify X rather than continuing a list, as in "resources used by all operators, active and requested". Both follow the existing precedent of tuning Google rules in `.vale.ini` alongside `Google.Colons` and `Google.Headings`, and both preserve 3.4.1's effective behavior, where neither rule blocked. ## Related issues None. Cross-referencing two of my own open PRs that touch adjacent surfaces, neither of which shares a file with this one: * ray-project#65368 removes the banned-words lint in favor of Vale. That increases how much Ray leans on Vale, which makes a dead local hook and a two-year-old pin more worth fixing. Touches `ci/lint/check-banned-words.sh`, `ci/lint/lint.sh`, and `.buildkite/lint.rayci.yml`. * ray-project#65342 makes the docs-go scope guard count Vale configuration as documentation content. Worth noting that after it merges, a Vale-config-only PR like this one would classify as documentation. Touches `ci/lint/validate_docs_go_scope.sh`. ## Additional information **AI assistance was used.** I used Claude Code to investigate and draft this. I reviewed every changed line, ran the measurements below myself, and can defend the change end to end. **Not a duplicate.** `gh pr list --repo ray-project/ray --state open --search "vale in:title"` and the same for `pre-commit` return only ray-project#65368 and ray-project#65342 above, which change different files and have different goals. **Measurements**, on the exact set `ci/lint/check-documentation-style.sh` lints (`doc/source/data` and `doc/source/ray-overview/examples`): | Vale | Total alerts | Error-severity | Exit code | Lint step | |---|---|---|---|---| | 3.4.1 (current pin) | 162 | 0 | 0 | green | | 3.17.1, bump alone | 208 | 14 | 1 | **red** | | 3.17.1, with this PR | 196 | 0 | 0 | green | That middle row is the reason the vocabulary and `.vale.ini` changes are in the same PR as the version bump: without them the bump turns `lint: documentation_style` red. **Checks run locally:** ``` # the CI script's exact target set, both versions vale doc/source/data doc/source/ray-overview/examples # 3.4.1 -> exit 0; 3.17.1 pre-fix -> exit 1; post-fix -> exit 0 # the hook now actually matches files and passes pre-commit run vale --files doc/source/data/data-internals.rst # vale.....................................................................Passed # and genuinely fails, rather than passing vacuously: appended a line # containing "This sentance has a deliberate spelling mistake." pre-commit run vale --files doc/source/data/data-internals.rst # 349:6 error Did you really mean 'sentance'? Vale.Spelling # 1 error, 0 warnings and 17 suggestions in 1 file. # the two hooks I exempted stay exempt, so no file churn pre-commit run trailing-whitespace --files $(git ls-files 'doc/source/data' | grep -E '\.(md|rst)$') pre-commit run end-of-file-fixer --files $(git ls-files 'doc/source/data' | grep -E '\.(md|rst)$') # both: (no files to check)Skipped # the two rST hooks that newly become eligible pre-commit run rst-directive-colons --files ... # Passed pre-commit run rst-inline-touching-normal --files ... # Passed ``` I also confirmed the 3.17.1 release publishes the two asset filenames the CI script downloads, `vale_3.17.1_Linux_64-bit.tar.gz` and `vale_3.17.1_macOS_arm64.tar.gz`. **Net effect:** contributors get Vale locally, CI runs a Vale two years newer, and `Vale.Spelling` becomes an enforced check instead of a silent one. --------- Signed-off-by: Douglas Strodtman <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why this change is needed
ci/lint/validate_docs_go_scope.shfails any pull request carrying thedocs-golabel if a changed file lives outsidedoc/. Two kinds of documentation work live outsidedoc/and are therefore locked out of the label today:.vale.ini,.vale/) sits at the repository root, so a PR that adds or edits a prose-lint rule can never carry the label even though it is documentation content by any reasonable reading. Concretely: [docs] Add Kubernetes and KubeRay conventions to the style guide #65239 adds KubeRay style rules and editsdoc/source/ray-contribute/writing-style.md. Its premerge build has exactly one failing job,lint: validate docs-go scope. Every other check passes.ci/ray_ci/doc/) is the tooling behind thedoc: check API doc consistencystep. Same shape: [ci/doc] Treat __all__ membership as public in the API-doc resolve check #65340 changes only that directory, and the label's guard is the sole red job on its premerge build.In both cases the author's options today are to drop the label and wait on per-library example suites the PR cannot possibly affect, or to split a coherent change across two PRs.
What changed
Widen the guard's in-scope set from "under
doc/" to "underdoc/, the Vale prose-lint configuration (.vale.ini,.vale/), or the API-consistency checker (ci/ray_ci/doc/)". Both fail-closed paths (no merge-base, empty diff) are unchanged, and theBUILD-file exclusion now applies uniformly across the whole in-scope set rather than justdoc/.Also updates the two places that state the predicate in prose, so they don't drift from the script: the
docs-gosection ofdoc/source/ray-contribute/ci.md, anddoc/.claude/CLAUDE.md.Why this is safe
The guard exists so
docs-gocan skip the 12 per-library docs example and llm test steps only on a PR that could not break them. The two additions clear that bar on different grounds, which is worth stating separately rather than blurring into one rule.The Vale configuration clears it on content:
BUILD-file exclusion is the mechanism that protects test targets, and it stays intact.lint: documentation_stylesits in thelint-small-prosematrix in.buildkite/lint.rayci.ymlcarryingalways, whichalways.rules.txtemits for every changed file. Vale therefore runs on every pull request whether or not the label is present.test.rules.txtalready routes.vale.iniand.vale/todocalone, in the rendering-and-validation-only block. That tag reachesdoc: build, which carriesskip-on-premerge.The checker source is executable CI code, so the reasoning above does not apply to it. It clears the bar on tag routing:
test.rules.txtroutesci/ray_ci/doc/todoc_api toolsand nothing else, ahead of the broadci/ray_ci/rule, and first match wins.core_python,data,llm,train,tune,rllib_directly,serve, and the*_doctags. A change confined to this directory never emits a tag that selects one of them. Since the label'sif:can only suppress an already-emitted step, there is nothing for it to take away.["go", "docs-go"]and 71736 carried["go"]. Both emitted the same 33 jobs, and diffing the two job-name sets yields no difference in either direction. The label's only effect on such a PR is whether this guard itself is emitted: it ran and failed in the first build, and wasbroken(never emitted) in the second. That is the claim above, observed rather than derived.doc_apiAPI checks and thetoolsjob running this directory's sixci_unitpy_test targets both run with the label present. Build 71727 is the direct evidence: it carrieddocs-goand randoc: check API annotations,doc: check API doc consistency, and all six//ci/ray_ci/doc:*targets, all green.BUILDfiles stay excluded, so a change to this directory's test targets still fails the guard. [ci/doc] Treat __all__ membership as public in the API-doc resolve check #65340 is exactly that case: it adds apy_testsrc, so it would still not qualify for the label after this change. That is the intended outcome.Each list is deliberately narrow. For Vale it covers the prose rules, not the CI wiring that runs them:
ci/lint/check-documentation-style.shand the Vale hook in.pre-commit-config.yamlstay out of scope, because a change to either one alters what actually runs. For the checker it coversci/ray_ci/doc/only, not the sharedci/ray_ci/tooling that every bazel test step runs through.Two corrections on the same surface
doc.rayci.ymlleaves them deliberately ungated, precisely because an API reference page edit is the content-only change they must cover, and build 71727 confirms both ran under the label.ci.mdalready described this correctly, so only the script was wrong.skip_pull_request_builds_for_existing_commits, so theunlabeledevent on an already-built commit produces no build at all. Verified on [ci/doc] Treat __all__ membership as public in the API-doc resolve check #65340:docs-gowas removed at 19:59:30Z, build 71727 was created at 20:00:03Z as a UI rebuild, and its payload still carried["go", "docs-go"]. The message and both prose surfaces now say to remove the label and push a new commit.Checks
git commit --signoff).shellcheckis clean. The guard was exercised end to end against a controlled base in a scratch repository, 15 cases — the 7 from the Vale-only version, unchanged, plus 8 for the new path:.vale.ini+.vale/styles/**+ adoc/page (the #65239 shape).vale/styles/**alonedoc/page alone (behavior before this change).vale/styles/**+ a file underpython/ray/.vale/BUILD.bazelBUILDfileci/lint/check-documentation-style.sh.pre-commit-config.yamlci/ray_ci/doc/api.pyaloneci/ray_ci/doc/api.py+ adoc/pageci/ray_ci/doc/mock/_internal/__init__.pyci/ray_ci/doc/BUILD.bazel(the #65340 shape)BUILDfileci/ray_ci/doc/api.py+ a file underpython/ray/ci/ray_ci/tester.py(shared tooling, not the checker)ci/ray_ci/docker/**(sibling path)doc/BUILD.bazelNote that this PR itself edits
ci/lint/, so it deliberately does not carry thedocs-golabel. The label's effect on #65239 is the real confirmation, and I'll rebase that PR onto this once it lands.Related
#64775 reserved the
doctag for documentation validation. Thedocs-golabel and this guard arrived with the content-only escape hatch that followed. #65340 is the checker-source change that motivated the second path.