Skip to content

[ci] Scope the doc_readme lint check to the files it actually checks - #65431

Merged
dstrodtman merged 1 commit into
ray-project:masterfrom
dstrodtman:doc-1484-scope-doc-readme-lint
Aug 14, 2026
Merged

dstrodtman merged 1 commit into
ray-project:masterfrom
dstrodtman:doc-1484-scope-doc-readme-lint

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why this change is needed

lint: doc_readme carries the always tag, so it runs on every pull request, including documentation-prose-only ones. Its inputs are the repo-root README.rst and python/setup.py. Nothing under doc/ feeds it, so a prose change cannot change its result.

What it actually checks, from ci/lint/lint.sh:

doc_readme() {
  /usr/bin/python -m pip install -c python/requirements_compiled.txt docutils
  cd python && /usr/bin/python setup.py check --restructuredtext --strict --metadata
}

--restructuredtext validates long_description, which python/setup.py reads from the repo-root README.rst. --metadata validates setup.py's own metadata fields. So the check guards how Ray's PyPI long description renders. It's a useful gate and this PR doesn't touch what it does; it's pointed at the wrong trigger.

It ended up in the lint-small-prose matrix, which exists for the opposite reason: that matrix holds the checks a Markdown or reStructuredText change can fail, so they survive the prose filter that strips the code-oriented lint-small matrix. The name doc_readme reads like documentation. The other three steps in that matrix belong there; this one is packaging.

What this PR does

  1. Moves doc_readme into its own step tagged pypi_readme alone, with no lint and no always.
  2. Adds a rule in .buildkite/always.rules.txt emitting pypi_readme for README.rst and python/setup.py. Both files keep always lint, which the catch-all would otherwise have given them, so no other step's trigger narrows.
  3. Adds test cases to .buildkite/always.rules.test.txt for both inputs and for neighbors that must not emit the tag.
  4. Rewrites the matrix comment to state the rule rather than imply it: adding a step to the prose matrix asserts a prose-only diff can fail it.

Prose pull requests and code pull requests that leave both files alone both stop selecting the step. The second half of that is broader than strictly necessary to fix the prose case, and it's the point: a check that cannot fail from your change shouldn't be in your PR's status list.

Two consequences worth flagging

Microcheck eligibility. Dropping lint from the step means the microcheck pipeline's hardcoded tag:lint selector no longer makes it eligible there, so it runs on premerge only. Selects and rule-emitted tags are ANDed in rayci's step filter, so this is the expected outcome rather than a surprise. Microcheck is non-blocking; premerge is the gate this check has to hold. Noted in the step comment.

Step IDs shift within the lint group. Step IDs are positional (fmt.Sprintf("g%d_s%d", i, j)), so inserting a step moves api-param-coverage from g11_s3 to g11_s4 and docs-go-scope from g11_s4 to g11_s5. Test.gen_microcheck_step_ids derives step IDs from recent Bazel test results, and group g11 contains no Bazel test steps, so nothing keyed on step ID is affected.

Not a duplicate

No open PR touches doc_readme (gh pr list --repo ray-project/ray --state open --search doc_readme returns nothing).

#65368 edits the same matrix to remove banned_words, so these two will conflict textually. They're independent changes and either merge order works; whichever lands second needs a trivial rebase.

Testing

Rules layer, from the branch:

$ rayci test-rules
$ echo $?
0

125 cases pass. Negative control: reverting the README.rst expectation to always lint fails with +pypi_readme (unexpected), confirming the test is reading the new rule rather than passing vacuously.

Step selection, generating the pipeline that the pinned rayci binary (v0.46.0, from .rayciversion) actually emits for a probe diff, rather than reasoning about tags:

Probe diff Selected tags lint: doc_readme
doc/source/index.rst, at master always runs, inside the g11_s0 matrix
doc/source/index.rst, on this branch always not emitted
python/ray/actor.py, on this branch always lint … not emitted
README.rst, on this branch always lint pypi_readme emitted, g11_s1
python/setup.py, on this branch … pypi_readme … emitted, g11_s1

The master row is the before state: on a prose-only diff the emitted prose matrix contains banned_words, doc_readme, documentation_style, doc_no_new_rst. On this branch that matrix has three entries and no separate doc_readme step appears.

Not verifiable outside Buildkite: if: expression evaluation, which this PR doesn't touch.

AI assistance

AI assistance was used for this change. Every changed line was reviewed by a human before this PR was opened, and the commands above were run locally.

@dstrodtman
dstrodtman requested a review from a team as a code owner August 12, 2026 15:44

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes the Buildkite linting pipeline by separating the doc_readme check from the general lint matrix. It introduces a new pypi_readme tag and configures it to trigger only when README.rst or python/setup.py are modified, preventing unnecessary runs on unrelated prose or code changes. As there are no review comments, I have no feedback to provide.

@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Aug 12, 2026
@ray-gardener ray-gardener Bot added core Issues that should be addressed in Ray Core devprod labels Aug 12, 2026
`lint: doc_readme` runs `setup.py check --restructuredtext --strict
--metadata`, which validates how Ray's PyPI long description renders. Its
inputs are the repo-root README.rst, which python/setup.py reads into
`long_description`, and setup.py's own metadata fields. Nothing under doc/
feeds it.

The step carried `always`, so it ran on every pull request, including
documentation-prose-only ones that cannot change its result. It sits in the
`lint-small-prose` matrix, which exists to hold the checks a Markdown or rST
change *can* fail so they survive the prose filter. The name reads like
documentation, which is how it landed there; the other three steps in that
matrix belong.

Move it to its own step tagged `pypi_readme`, and add a rule emitting that tag
for README.rst and python/setup.py alone. Prose pull requests and code pull
requests that touch neither file both stop selecting it. Keeping the check
itself unchanged: it's a useful gate, just pointed at the wrong trigger.

One consequence of dropping `lint` from the step: the microcheck pipeline's
hardcoded `tag:lint` selector no longer makes it eligible there, so it runs on
premerge only. Microcheck is non-blocking; premerge is the gate this check has
to hold.

Verified with `rayci test-rules` (125 cases) and by generating the emitted
premerge pipeline for prose-only, code-only, and README.rst diffs.

AI assistance was used for this change.

Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman force-pushed the doc-1484-scope-doc-readme-lint branch from 22f7f96 to c55eb67 Compare August 14, 2026 18:17
@dstrodtman
dstrodtman merged commit 5ab7dd9 into ray-project:master Aug 14, 2026
6 checks passed
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
…ay-project#65431)

## Why this change is needed

`lint: doc_readme` carries the `always` tag, so it runs on every pull
request, including documentation-prose-only ones. Its inputs are the
repo-root `README.rst` and `python/setup.py`. Nothing under `doc/` feeds
it, so a prose change cannot change its result.

What it actually checks, from `ci/lint/lint.sh`:

```bash
doc_readme() {
  /usr/bin/python -m pip install -c python/requirements_compiled.txt docutils
  cd python && /usr/bin/python setup.py check --restructuredtext --strict --metadata
}
```

`--restructuredtext` validates `long_description`, which
`python/setup.py` reads from the repo-root `README.rst`. `--metadata`
validates `setup.py`'s own metadata fields. So the check guards how
Ray's PyPI long description renders. It's a useful gate and this PR
doesn't touch what it does; it's pointed at the wrong trigger.

It ended up in the `lint-small-prose` matrix, which exists for the
opposite reason: that matrix holds the checks a Markdown or
reStructuredText change *can* fail, so they survive the prose filter
that strips the code-oriented `lint-small` matrix. The name `doc_readme`
reads like documentation. The other three steps in that matrix belong
there; this one is packaging.

## What this PR does

1. Moves `doc_readme` into its own step tagged `pypi_readme` alone, with
no `lint` and no `always`.
2. Adds a rule in `.buildkite/always.rules.txt` emitting `pypi_readme`
for `README.rst` and `python/setup.py`. Both files keep `always lint`,
which the catch-all would otherwise have given them, so no other step's
trigger narrows.
3. Adds test cases to `.buildkite/always.rules.test.txt` for both inputs
and for neighbors that must not emit the tag.
4. Rewrites the matrix comment to state the rule rather than imply it:
adding a step to the prose matrix asserts a prose-only diff can fail it.

Prose pull requests and code pull requests that leave both files alone
both stop selecting the step. The second half of that is broader than
strictly necessary to fix the prose case, and it's the point: a check
that cannot fail from your change shouldn't be in your PR's status list.

## Two consequences worth flagging

**Microcheck eligibility.** Dropping `lint` from the step means the
microcheck pipeline's hardcoded `tag:lint` selector no longer makes it
eligible there, so it runs on premerge only. Selects and rule-emitted
tags are ANDed in rayci's step filter, so this is the expected outcome
rather than a surprise. Microcheck is non-blocking; premerge is the gate
this check has to hold. Noted in the step comment.

**Step IDs shift within the lint group.** Step IDs are positional
(`fmt.Sprintf("g%d_s%d", i, j)`), so inserting a step moves
`api-param-coverage` from `g11_s3` to `g11_s4` and `docs-go-scope` from
`g11_s4` to `g11_s5`. `Test.gen_microcheck_step_ids` derives step IDs
from recent Bazel test results, and group `g11` contains no Bazel test
steps, so nothing keyed on step ID is affected.

## Not a duplicate

No open PR touches `doc_readme` (`gh pr list --repo ray-project/ray
--state open --search doc_readme` returns nothing).

ray-project#65368 edits the same matrix to remove `banned_words`, so these two will
conflict textually. They're independent changes and either merge order
works; whichever lands second needs a trivial rebase.

## Testing

Rules layer, from the branch:

```
$ rayci test-rules
$ echo $?
0
```

125 cases pass. Negative control: reverting the `README.rst` expectation
to `always lint` fails with `+pypi_readme (unexpected)`, confirming the
test is reading the new rule rather than passing vacuously.

Step selection, generating the pipeline that the pinned rayci binary
(v0.46.0, from `.rayciversion`) actually emits for a probe diff, rather
than reasoning about tags:

| Probe diff | Selected tags | `lint: doc_readme` |
| --- | --- | --- |
| `doc/source/index.rst`, at `master` | `always` | runs, inside the
`g11_s0` matrix |
| `doc/source/index.rst`, on this branch | `always` | not emitted |
| `python/ray/actor.py`, on this branch | `always lint …` | not emitted
|
| `README.rst`, on this branch | `always lint pypi_readme` | emitted,
`g11_s1` |
| `python/setup.py`, on this branch | `… pypi_readme …` | emitted,
`g11_s1` |

The `master` row is the before state: on a prose-only diff the emitted
prose matrix contains `banned_words`, `doc_readme`,
`documentation_style`, `doc_no_new_rst`. On this branch that matrix has
three entries and no separate `doc_readme` step appears.

Not verifiable outside Buildkite: `if:` expression evaluation, which
this PR doesn't touch.

## AI assistance

AI assistance was used for this change. Every changed line was reviewed
by a human before this PR was opened, and the commands above were run
locally.

Signed-off-by: Douglas Strodtman <[email protected]>
Signed-off-by: 400Ping <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 5, 2026
…mmit (#66740)

## Description

Narrows which pull requests run the code-oriented lint matrix in
`.buildkite/lint.rayci.yml`. It doesn't change anything that runs on
master or release branches, which bypass rule evaluation.

**`doc/source/*.py`, `*.yaml`, and `*.yml` no longer emit `lint`.**
`.pre-commit-config.yaml` excludes `doc/source/` globally, apart from
data prose and BUILD files, so `pre_commit` and `pre-commit pydoclint`
never see these files, even with `--all-files`. None of the other checks
read them either:

- `clang_format` and `copyright_format` read only C++.
- `dashboard_format` reads only the dashboard client.
- `bazel_buildifier` reads only BUILD and `.bzl` files.
- `bazel_team`, `pytest_format`, and `test_coverage` query test targets
under `python/`.

Before this change, editing `doc/source/conf.py` ran all nine code
checks, roughly 6 to 8 minutes of runner time each, and none of them
could fail on it. `test.rules.txt` is unchanged, so these paths still
emit `doc` and the library doc tags, and doctests and the doc build
still run.

**`pre_commit` now has its own step.** It moves out of the `lint-small`
matrix into a `lint-pre-commit` step tagged `lint` and `pre_commit`. Its
trailing-whitespace and end-of-file hooks do read `.vale.ini`, `.vale/`,
and `doc/redirects/*.yaml`. Those paths now emit `always pre_commit`, so
they run `pre_commit` without the other seven checks. Anything that
emits `lint` still selects the step, so code PRs are unaffected.

This also corrects the comment in `always.rules.txt` and the expectation
in `always.rules.test.txt` that both said `pre_commit` lints
`doc/source/*.py`.

## Related issues

None. I searched open PRs that touch `always.rules.txt` or the lint tags
and found nothing in flight. The most recent related change is #65431,
which scoped `doc_readme` the same way.

## Additional information

**Verification**

- `rayci test-rules` at the pinned `.rayciversion` (0.48.0): all
expectations pass. As a negative control, I reverted one new expectation
and confirmed it fails.
- I ran `pre-commit run trailing-whitespace --files …` on each path to
confirm pre-commit's file scope. `doc/source/conf.py`,
`doc/source/cluster/kubernetes/configs/loki.log.yaml`, and
`doc/source/data/examples.yml` report "Skipped". `.vale.ini`,
`.vale/styles/Google/AMPM.yml`, and `doc/redirects/current.yaml` are
checked.
- I ran a tag dry-run on single-file diffs. The lint steps each one
selects:

| Changed file | Emitted tags | Lint steps selected |
|---|---|---|
| `doc/source/conf.py` | `always doc doc_api` | `always`-tagged steps
only |
| `.vale.ini` | `always doc pre_commit` | `always` steps + `lint:
pre_commit` |
| `doc/redirects/current.yaml` | `always doc_redirects pre_commit` |
`always` steps + `lint: pre_commit` |
| `python/ray/actor.py` | `always lint …` | Full matrix, unchanged |
| `doc/source/index.md` | `always` | `always` steps only, unchanged |

This draft PR is the confirming check that the emitted pipeline matches
the table.

**Out of scope:** notebooks under `doc/source/` are hidden by the same
pre-commit exclude, but they stay on the catch-all for now. If that
exclude ever narrows to cover `doc/source/*.py`, the new rule should be
removed. The comment in `always.rules.txt` says so.

AI assistance (Claude Code) was used to investigate and draft this
change. I reviewed every changed line.

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

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

## Why this change is needed

`lint: doc_readme` carries the `always` tag, so it runs on every pull
request, including documentation-prose-only ones. Its inputs are the
repo-root `README.rst` and `python/setup.py`. Nothing under `doc/` feeds
it, so a prose change cannot change its result.

What it actually checks, from `ci/lint/lint.sh`:

```bash
doc_readme() {
  /usr/bin/python -m pip install -c python/requirements_compiled.txt docutils
  cd python && /usr/bin/python setup.py check --restructuredtext --strict --metadata
}
```

`--restructuredtext` validates `long_description`, which
`python/setup.py` reads from the repo-root `README.rst`. `--metadata`
validates `setup.py`'s own metadata fields. So the check guards how
Ray's PyPI long description renders. It's a useful gate and this PR
doesn't touch what it does; it's pointed at the wrong trigger.

It ended up in the `lint-small-prose` matrix, which exists for the
opposite reason: that matrix holds the checks a Markdown or
reStructuredText change *can* fail, so they survive the prose filter
that strips the code-oriented `lint-small` matrix. The name `doc_readme`
reads like documentation. The other three steps in that matrix belong
there; this one is packaging.

## What this PR does

1. Moves `doc_readme` into its own step tagged `pypi_readme` alone, with
no `lint` and no `always`.
2. Adds a rule in `.buildkite/always.rules.txt` emitting `pypi_readme`
for `README.rst` and `python/setup.py`. Both files keep `always lint`,
which the catch-all would otherwise have given them, so no other step's
trigger narrows.
3. Adds test cases to `.buildkite/always.rules.test.txt` for both inputs
and for neighbors that must not emit the tag.
4. Rewrites the matrix comment to state the rule rather than imply it:
adding a step to the prose matrix asserts a prose-only diff can fail it.

Prose pull requests and code pull requests that leave both files alone
both stop selecting the step. The second half of that is broader than
strictly necessary to fix the prose case, and it's the point: a check
that cannot fail from your change shouldn't be in your PR's status list.

## Two consequences worth flagging

**Microcheck eligibility.** Dropping `lint` from the step means the
microcheck pipeline's hardcoded `tag:lint` selector no longer makes it
eligible there, so it runs on premerge only. Selects and rule-emitted
tags are ANDed in rayci's step filter, so this is the expected outcome
rather than a surprise. Microcheck is non-blocking; premerge is the gate
this check has to hold. Noted in the step comment.

**Step IDs shift within the lint group.** Step IDs are positional
(`fmt.Sprintf("g%d_s%d", i, j)`), so inserting a step moves
`api-param-coverage` from `g11_s3` to `g11_s4` and `docs-go-scope` from
`g11_s4` to `g11_s5`. `Test.gen_microcheck_step_ids` derives step IDs
from recent Bazel test results, and group `g11` contains no Bazel test
steps, so nothing keyed on step ID is affected.

## Not a duplicate

No open PR touches `doc_readme` (`gh pr list --repo ray-project/ray
--state open --search doc_readme` returns nothing).

ray-project#65368 edits the same matrix to remove `banned_words`, so these two will
conflict textually. They're independent changes and either merge order
works; whichever lands second needs a trivial rebase.

## Testing

Rules layer, from the branch:

```
$ rayci test-rules
$ echo $?
0
```

125 cases pass. Negative control: reverting the `README.rst` expectation
to `always lint` fails with `+pypi_readme (unexpected)`, confirming the
test is reading the new rule rather than passing vacuously.

Step selection, generating the pipeline that the pinned rayci binary
(v0.46.0, from `.rayciversion`) actually emits for a probe diff, rather
than reasoning about tags:

| Probe diff | Selected tags | `lint: doc_readme` |
| --- | --- | --- |
| `doc/source/index.rst`, at `master` | `always` | runs, inside the
`g11_s0` matrix |
| `doc/source/index.rst`, on this branch | `always` | not emitted |
| `python/ray/actor.py`, on this branch | `always lint …` | not emitted
|
| `README.rst`, on this branch | `always lint pypi_readme` | emitted,
`g11_s1` |
| `python/setup.py`, on this branch | `… pypi_readme …` | emitted,
`g11_s1` |

The `master` row is the before state: on a prose-only diff the emitted
prose matrix contains `banned_words`, `doc_readme`,
`documentation_style`, `doc_no_new_rst`. On this branch that matrix has
three entries and no separate `doc_readme` step appears.

Not verifiable outside Buildkite: `if:` expression evaluation, which
this PR doesn't touch.

## AI assistance

AI assistance was used for this change. Every changed line was reviewed
by a human before this PR was opened, and the commands above were run
locally.

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

## Description

Narrows which pull requests run the code-oriented lint matrix in
`.buildkite/lint.rayci.yml`. It doesn't change anything that runs on
master or release branches, which bypass rule evaluation.

**`doc/source/*.py`, `*.yaml`, and `*.yml` no longer emit `lint`.**
`.pre-commit-config.yaml` excludes `doc/source/` globally, apart from
data prose and BUILD files, so `pre_commit` and `pre-commit pydoclint`
never see these files, even with `--all-files`. None of the other checks
read them either:

- `clang_format` and `copyright_format` read only C++.
- `dashboard_format` reads only the dashboard client.
- `bazel_buildifier` reads only BUILD and `.bzl` files.
- `bazel_team`, `pytest_format`, and `test_coverage` query test targets
under `python/`.

Before this change, editing `doc/source/conf.py` ran all nine code
checks, roughly 6 to 8 minutes of runner time each, and none of them
could fail on it. `test.rules.txt` is unchanged, so these paths still
emit `doc` and the library doc tags, and doctests and the doc build
still run.

**`pre_commit` now has its own step.** It moves out of the `lint-small`
matrix into a `lint-pre-commit` step tagged `lint` and `pre_commit`. Its
trailing-whitespace and end-of-file hooks do read `.vale.ini`, `.vale/`,
and `doc/redirects/*.yaml`. Those paths now emit `always pre_commit`, so
they run `pre_commit` without the other seven checks. Anything that
emits `lint` still selects the step, so code PRs are unaffected.

This also corrects the comment in `always.rules.txt` and the expectation
in `always.rules.test.txt` that both said `pre_commit` lints
`doc/source/*.py`.

## Related issues

None. I searched open PRs that touch `always.rules.txt` or the lint tags
and found nothing in flight. The most recent related change is ray-project#65431,
which scoped `doc_readme` the same way.

## Additional information

**Verification**

- `rayci test-rules` at the pinned `.rayciversion` (0.48.0): all
expectations pass. As a negative control, I reverted one new expectation
and confirmed it fails.
- I ran `pre-commit run trailing-whitespace --files …` on each path to
confirm pre-commit's file scope. `doc/source/conf.py`,
`doc/source/cluster/kubernetes/configs/loki.log.yaml`, and
`doc/source/data/examples.yml` report "Skipped". `.vale.ini`,
`.vale/styles/Google/AMPM.yml`, and `doc/redirects/current.yaml` are
checked.
- I ran a tag dry-run on single-file diffs. The lint steps each one
selects:

| Changed file | Emitted tags | Lint steps selected |
|---|---|---|
| `doc/source/conf.py` | `always doc doc_api` | `always`-tagged steps
only |
| `.vale.ini` | `always doc pre_commit` | `always` steps + `lint:
pre_commit` |
| `doc/redirects/current.yaml` | `always doc_redirects pre_commit` |
`always` steps + `lint: pre_commit` |
| `python/ray/actor.py` | `always lint …` | Full matrix, unchanged |
| `doc/source/index.md` | `always` | `always` steps only, unchanged |

This draft PR is the confirming check that the emitted pipeline matches
the table.

**Out of scope:** notebooks under `doc/source/` are hidden by the same
pre-commit exclude, but they stay on the catch-all for now. If that
exclude ever narrows to cover `doc/source/*.py`, the new rule should be
removed. The comment in `always.rules.txt` says so.

AI assistance (Claude Code) was used to investigate and draft this
change. I reviewed every changed line.

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

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core devprod go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants