Repository navigation
[ci][doc] Let a PR opt into the Read the Docs preview with an @rtd-build commit line - #66805
Conversation
…ild commit line @rtd-build Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces an opt-in mechanism using the @rtd-build keyword in commit messages to trigger Read the Docs preview builds, which is especially useful when changes only affect docstrings. It also documents this feature in the CI contribution guide. The feedback suggests improving the robustness of the commit message check by allowing optional leading whitespace before the keyword.
| echo "Could not determine merge-base with origin/master; building docs to be safe." | ||
| exit 0 | ||
| fi | ||
| if git log --format=%B origin/master..HEAD | grep -q '^@rtd-build'; then |
There was a problem hiding this comment.
To make the opt-in trigger more robust, consider allowing optional leading whitespace before @rtd-build. Commit messages are sometimes formatted with indentation or bullet points (e.g., when copying from PR descriptions), which would prevent the current strict ^@rtd-build pattern from matching.
if git log --format=%B origin/master..HEAD | grep -q '^[[:space:]]*@rtd-build'; thenThere was a problem hiding this comment.
Fixed in bed1f0c: the check now matches ^[[:space:]]*@rtd-build, so an indented line opts in too. Text that only mentions @rtd-build mid-line still does not.
A commit body pasted from an indented PR description still opts in. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Description
The Read the Docs PR preview skips any PR that changes nothing under
doc/or.readthedocs.yaml. #64547 deliberately leftpython/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, thepost_checkoutguard builds the docs. It follows the existing@microcheckcommit-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 reachesmaster.doc/source/ray-contribute/ci.mddocuments 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, andRTD preview python/ray, and found no overlapping work.Additional information
Testing. I extracted the
post_checkoutscript from the YAML withyaml.safe_load, exactly as RtD reads it, and ran it underdash, the/bin/shon RtD's builders. The test repo was a shallow clone withorigin/masterpinned to the PR's base:python/ray/only, no linepython/ray/only,@rtd-buildline@rtd-buildmentioned mid-sentence onlydoc/RtD's runner strips surrounding single quotes from arguments, so I also ran the two
@rtd-buildcases 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