Skip to content

land: pr-diff-read - #535

Merged
ualtinok merged 5 commits into
mainfrom
land/pr-diff-read
Oct 18, 2026
Merged

ualtinok merged 5 commits into
mainfrom
land/pr-diff-read

Conversation

@aft-alfonso

@aft-alfonso aft-alfonso Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Accepted agent delivery; branch-keyed search descriptor included.


Summary by cubic

Fixes reading pull request diffs so pr://N/diff and pr://N/diff/<path> work again; they previously failed with a gh flag error, and a PR whose changes were all reverted now returns an empty diff instead of failing.

  • gh rejects combining --slurp with --jq, so the changed-path listing now parses newline-delimited JSON objects instead of a slurped array.
  • An empty file list is handled as a valid empty diff.
  • Parsing each page's lines independently keeps renamed paths intact across paginated file lists.
  • Adds tests for multi-page file lists, empty PR diffs, and empty or invalid response lines, and updates the recorded gh double to answer per-page jq output like the real CLI.

Written for commit 1b04c58. Summary will update on new commits.

View guided diff Turn on auto-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no blocking issue remains.

Summary

Fixes pull request diff reads by removing incompatible gh flags and reading changed paths as newline-separated JSON.

  • Pull request diff reads fetch paginated changed paths successfully.

Reviews (3) · Last reviewed commit: "Make the recorded gh double answer per-p..." · Reviewed by Greptile

ualtinok and others added 3 commits October 18, 2026 13:57
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Comment thread crates/aft/src/github_read/diff.rs Outdated
A PR whose changes were all reverted makes the paginated jq projection print
nothing. That is an empty file list, not an invalid line.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 18, 2026
The routing test fed the files listing as one JSON array, the shape of the
old slurped request. Real gh applies the jq filter to each page and prints one
value per line, and refuses --slurp together with --jq.

Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
@ualtinok
ualtinok added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 15df0d1 Oct 18, 2026
47 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant