Repository navigation
docs-review: simplify changed-file discovery with gh pr diff - #154
Merged
Merged
Conversation
Replace the 29-line GraphQL cursor-pagination loop from #153 with a three-line `gh pr diff <N> --name-only` call. gh handles pagination internally, so the manual NEXT_CURSOR bookkeeping and duplicate query strings are no longer needed. Deleted files are no longer filtered at discovery time, but the existing `[ -f "$f" ] || continue` guard in the copy loop (which runs after git checkout to the PR head) excludes them naturally. The only behavioral difference is that a PR touching only deleted markdown files will do one extra git fetch before nooping via the ELIGIBLE_COUNT=0 guard. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Mpdreamz
approved these changes
May 14, 2026
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.
What
Replace the 29-line GraphQL cursor-pagination loop (added in #153) with three lines using
gh pr diff <N> --name-only.Why
The GraphQL loop was overengineered for the problem it solved. The actual root-cause fix in #153 was
set -euo pipefailcatching previously-silent pipeline failures. The manual cursor bookkeeping, duplicate query strings, and threejqpasses per page are unnecessary —ghhandles pagination internally.How
gh pr diff "$PR_NUMBER" --name-onlyprints one path per line for all changed files, thenawk '/\.md$/'filters to markdown. Deleted files are no longer explicitly excluded at discovery time, but the existing[ -f "$f" ] || continueguard in the copy loop (which runs aftergit checkout --detachto the PR head) excludes them naturally since deleted files don't exist on the PR head. The only behavioral difference is that a PR touching only deleted markdown files will do one extragit fetchbefore theELIGIBLE_COUNT=0guard noops it — accepted.All other changes from #153 (
set -euo pipefail, review-scope prompt echo, Vale/style-guide wording) are kept as-is.Test plan
gh aw compile— passes (run locally, lock file committed)gh aw validate— passes/docs-reviewon a test PR with: added.mdfiles, modified.mdfiles, a deleted.mdfile, a renamed.mdfile — confirmeligible-files.txtmatches expected scope under bothdocs-subtreeandrepo-wide-markdownNotes
Net: −52 lines in the lock file, −26 lines in the source
.md.