Skip to content

[docs] Skip the RtD PR build for code-only PRs - #64547

Merged
elliot-barn merged 1 commit into
ray-project:masterfrom
dstrodtman:djs-260706-rtd-skip-code-only-prs
Jul 6, 2026
Merged

elliot-barn merged 1 commit into
ray-project:masterfrom
dstrodtman:djs-260706-rtd-skip-code-only-prs

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Why are these changes needed?

The post_checkout skip-guard in .readthedocs.yaml currently triggers a full RtD Sphinx build on any PR that changes doc/, python/ray/, or rllib/. Because python/ray/ and rllib/ are in that pathspec (autodoc renders their docstrings into the API reference), a code-only PR that touches no doc source still runs a full RtD build.

That preview is low value:

  • The docs/readthedocs.com:anyscale-ray PR check is not a required merge gate (PRs merge with it pending/red), so a failing build on a code PR is noise and queue pressure on the shared RtD slots, not a blocker.
  • The large majority of PR-triggered RtD builds are for PRs that touch no doc source at all, so their authors never open the preview link.

This PR narrows the guard to doc-source paths (doc/ minus doc/.claude/, plus .readthedocs.yaml), so code-only PRs skip the preview. Docstring-driven API-reference changes are still rendered post-merge: RtD builds /en/master/ on every master push and Buildkite runs doc_build. Mixed PRs that touch both doc/ and code still build, since the guard still matches doc/.

Follow-up to #64480 (the doc/.claude/ exclusion), same guard, same RtD-preprocessor constraints (single-line expression, :! exclude shorthand, no shell comments in the block).

Draft: holding until post-merge doc-build monitoring is in place, so a docstring change that breaks the API reference on master is caught promptly once code PRs stop rendering it premerge.

Related issue number

N/A

Checks

  • I've signed off every commit (git commit -s).
  • I've made sure the tests are passing. (Config-only change; no test surface.)

Narrow the post_checkout skip-guard so a code-only PR (one that touches
python/ray/ or rllib/ but no doc/ sources) skips the Read the Docs PR
preview instead of running a full Sphinx build. The guard now keys only
on doc/ (excluding doc/.claude/) and .readthedocs.yaml.

Rationale:

- The RtD PR check is not a required merge gate, so a red or timed-out
  RtD build on a code PR is noise and queue pressure on the shared RtD
  slots, not a blocker.
- The large majority of PR-triggered RtD builds are for PRs that touch
  no doc source, so their authors never use the preview.
- Docstring-driven API-reference changes are still rendered post-merge:
  RtD builds /en/master/ on every master push and Buildkite runs
  doc_build. This moves that residual coverage from a non-gating
  premerge preview to the post-merge build.

Mixed PRs that touch both doc/ and code still build, since the guard
still matches doc/. Follow-up to ray-project#64480 (the doc/.claude/ exclusion).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the .readthedocs.yaml configuration to exclude Python code directories (python/ray/ and rllib/) from triggering Read the Docs (RTD) PR preview builds. This change ensures that code-only pull requests skip the RTD build, reducing pressure on shared RTD slots while still relying on post-merge master builds and Buildkite doc builds to render API-reference changes. There are no review comments, so I have no feedback to provide.

@dstrodtman
dstrodtman marked this pull request as ready for review July 6, 2026 17:40
@dstrodtman
dstrodtman requested review from a team as code owners July 6, 2026 17:40
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Jul 6, 2026
@elliot-barn
elliot-barn enabled auto-merge (squash) July 6, 2026 17:53
@elliot-barn
elliot-barn merged commit e35fdb3 into ray-project:master Jul 6, 2026
4 checks passed
elliot-barn pushed a commit that referenced this pull request Jul 9, 2026
## Why are these changes needed?

The `post_checkout` skip-guard in `.readthedocs.yaml` currently triggers
a full RtD Sphinx build on any PR that changes `doc/`, `python/ray/`, or
`rllib/`. Because `python/ray/` and `rllib/` are in that pathspec
(autodoc renders their docstrings into the API reference), a **code-only
PR that touches no doc source still runs a full RtD build**.

That preview is low value:

- The `docs/readthedocs.com:anyscale-ray` PR check is **not a required
merge gate** (PRs merge with it pending/red), so a failing build on a
code PR is noise and queue pressure on the shared RtD slots, not a
blocker.
- The large majority of PR-triggered RtD builds are for PRs that touch
no doc source at all, so their authors never open the preview link.

This PR narrows the guard to doc-source paths (`doc/` minus
`doc/.claude/`, plus `.readthedocs.yaml`), so code-only PRs skip the
preview. Docstring-driven API-reference changes are still rendered
post-merge: RtD builds `/en/master/` on every master push and Buildkite
runs `doc_build`. Mixed PRs that touch both `doc/` and code still build,
since the guard still matches `doc/`.

Follow-up to #64480 (the `doc/.claude/` exclusion), same guard, same
RtD-preprocessor constraints (single-line expression, `:!` exclude
shorthand, no shell comments in the block).

> **Draft:** holding until post-merge doc-build monitoring is in place,
so a docstring change that breaks the API reference on master is caught
promptly once code PRs stop rendering it premerge.

## Related issue number

N/A

## Checks

- [ ] I've signed off every commit (`git commit -s`).
- [x] I've made sure the tests are passing. (Config-only change; no test
surface.)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: elliot-barn <[email protected]>
400Ping pushed a commit to 400Ping/ray that referenced this pull request Aug 18, 2026
## Why are these changes needed?

The `post_checkout` skip-guard in `.readthedocs.yaml` currently triggers
a full RtD Sphinx build on any PR that changes `doc/`, `python/ray/`, or
`rllib/`. Because `python/ray/` and `rllib/` are in that pathspec
(autodoc renders their docstrings into the API reference), a **code-only
PR that touches no doc source still runs a full RtD build**.

That preview is low value:

- The `docs/readthedocs.com:anyscale-ray` PR check is **not a required
merge gate** (PRs merge with it pending/red), so a failing build on a
code PR is noise and queue pressure on the shared RtD slots, not a
blocker.
- The large majority of PR-triggered RtD builds are for PRs that touch
no doc source at all, so their authors never open the preview link.

This PR narrows the guard to doc-source paths (`doc/` minus
`doc/.claude/`, plus `.readthedocs.yaml`), so code-only PRs skip the
preview. Docstring-driven API-reference changes are still rendered
post-merge: RtD builds `/en/master/` on every master push and Buildkite
runs `doc_build`. Mixed PRs that touch both `doc/` and code still build,
since the guard still matches `doc/`.

Follow-up to ray-project#64480 (the `doc/.claude/` exclusion), same guard, same
RtD-preprocessor constraints (single-line expression, `:!` exclude
shorthand, no shell comments in the block).

> **Draft:** holding until post-merge doc-build monitoring is in place,
so a docstring change that breaks the API reference on master is caught
promptly once code PRs stop rendering it premerge.

## Related issue number

N/A

## Checks

- [ ] I've signed off every commit (`git commit -s`).
- [x] I've made sure the tests are passing. (Config-only change; no test
surface.)

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: 400Ping <[email protected]>
dstrodtman added a commit that referenced this pull request Oct 14, 2026
…ild commit line (#66805)

## Description

The Read the Docs PR preview skips any PR that changes nothing under
`doc/` or `.readthedocs.yaml`. #64547 deliberately left `python/ray/`
out of that check, to keep code-only PRs off the shared build slots. The
trade-off is that a PR that edits only docstrings changes the rendered
API reference, yet gets no preview and no render check before merge.

This PR adds an opt-in. If any commit message on the PR has a line that
starts with `@rtd-build`, the `post_checkout` guard builds the docs. It
follows the existing `@microcheck` commit-line convention. PRs without
the line behave exactly as they do today, and the change can only add
builds, never skip one that would have run. Ray squash-merges with the
PR title and body, so the line never reaches `master`.

`doc/source/ray-contribute/ci.md` documents the opt-in next to the
existing explanation of when the preview skips.

This PR's own commit carries `@rtd-build`, so its RtD build log should
open with "A commit message in this PR requests a build with
@rtd-build". That confirms the new path on the real RtD runner.

## Related issues

None. I searched open PRs for `readthedocs skip`, `rtd build`,
`readthedocs.yaml post_checkout`, and `RTD preview python/ray`, and
found no overlapping work.

## Additional information

**Testing.** I extracted the `post_checkout` script from the YAML with
`yaml.safe_load`, exactly as RtD reads it, and ran it under `dash`, the
`/bin/sh` on RtD's builders. The test repo was a shallow clone with
`origin/master` pinned to the PR's base:

| Case | Expected | Result |
|---|---|---|
| Change under `python/ray/` only, no line | skip (183) | 183 |
| Change under `python/ray/` only, `@rtd-build` line | build (0) | 0 |
| `@rtd-build` mentioned mid-sentence only | skip (183) | 183 |
| Line in an earlier commit, later commit without it | build (0) | 0 |
| Change under `doc/` | build (0) | 0 |
| Branch (non-PR) build | build (0) | 0 |

RtD's runner strips surrounding single quotes from arguments, so I also
ran the two `@rtd-build` cases with the quotes removed. Both gave the
same result.

The new lines avoid the constructs the existing comment warns the runner
drops: no backslash escapes, no `printf`, and no shell comments inside
the block. Pre-commit passed on both files.

**AI assistance.** This change was drafted with Claude Code. I reviewed
every line and ran the tests above.

🤖 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

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