Skip to content

[doc] Fix no-new-rst lint check crashing on stacked PRs#64249

Open
elliot-barn wants to merge 1 commit into
masterfrom
elliot-barn-fix-no-new-rst-stacked-pr
Open

[doc] Fix no-new-rst lint check crashing on stacked PRs#64249
elliot-barn wants to merge 1 commit into
masterfrom
elliot-barn-fix-no-new-rst-stacked-pr

Conversation

@elliot-barn

Copy link
Copy Markdown
Collaborator

Why are these changes needed?

The doc_no_new_rst lint check (doc/test_no_new_rst.py) fetches the base branch with git fetch origin <base> and then diffs against origin/<base>:

subprocess.check_call(["git", "fetch", "-q", remote, base])
out = subprocess.check_output([
    "git", "diff", "--name-only", "--diff-filter=A",
    f"{remote}/{base}...{commit}", "--",
])

git fetch origin <base> populates FETCH_HEAD but does not create a remote-tracking ref refs/remotes/origin/<base>. So origin/<base> only resolves for branches already present in the clone (e.g. master). For PRs whose base is another feature branch (stacked PRs), origin/<base> is absent and the diff aborts with fatal: bad revision (git exit 128) — failing the check before it ever evaluates whether any .rst files were added.

This fix diffs against FETCH_HEAD — which the preceding git fetch always populates with the base tip — instead of origin/<base>. Behavior is unchanged for master-based PRs (the common case); the check is fixed for stacked PRs.

The change is pure git mechanics with no behavioral change to what the check enforces (still flags newly-added .rst files under doc/source/).

Related issue number

N/A

Checks

  • I've signed off every commit (by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

The doc_no_new_rst check (doc/test_no_new_rst.py) fetches the base branch
with `git fetch origin <base>` and then diffs against `origin/<base>`.
`git fetch` populates FETCH_HEAD but does not create a remote-tracking ref
for an arbitrary branch, so `origin/<base>` only resolves for branches
already present in the clone (e.g. master). For PRs whose base is another
feature branch (stacked PRs), `origin/<base>` is absent and the diff aborts
with `fatal: bad revision` (git exit 128), failing the check before it ever
evaluates whether any .rst files were added.

Diff against FETCH_HEAD -- which the preceding fetch always populates with
the base tip -- instead. Behavior is unchanged for master-based PRs and the
check is fixed for stacked PRs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
@elliot-barn elliot-barn requested a review from a team as a code owner June 22, 2026 03:22

@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 git diff command in doc/test_no_new_rst.py to compare against FETCH_HEAD instead of {remote}/{base}. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@ray-gardener ray-gardener Bot added docs An issue or change related to documentation core Issues that should be addressed in Ray Core devprod labels Jun 22, 2026
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Jun 22, 2026
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 docs An issue or change related to documentation go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants