Repository navigation
fix(review): review a pull request at the merge base of its base branch - #5387
Merged
Merged
Conversation
devops review pr read the files of a pull request from the pulls files endpoint, its diff from the pulls endpoint, and its base text at the merge base of the payload's base.sha. GitHub does not move base.sha when a merge commit moves the merge base, so after a merge of main into a pull request branch the review read the changes of main as changes of the pull request. devops ai analyze pr read the same stale file list. Both commands now read the compare of the tip of the base branch and the head commit, which is the diff that the squash merge applies. The review reads the diff, the base text, the conventions and the base worktree at the merge base of that compare. A compare at the 300-file limit ends the review with a message that names devops review branch, and gives the analysis a warning. GitHubClient.get_compare_files returns the merge base, GitHubClient.get_compare_diff reads the compare diff, and the change deletes get_pull_files and get_merge_base, which have no caller. Refs #5346
BaseRevision.revision now holds the merge base of a pull request, so its docstring tells that. The diff media type is also the media type of a comparison diff. The test of the posted comment shows that the command reads the file list of the compare one time only.
Move the change of #5346 to the archive and add the living capability pr-squash-diff.
Owner
Author
Test and check resultsBuilder (commit
Review (commit
Render diffThe branch changes no path under |
Owner
Author
Check resultsHead commit:
Fail-to-pass run: https://github.com/dan-petty/devops-cli/actions/runs/43391201661/job/131771254031 Skipped check: Plan Check |
dan-petty
marked this pull request as ready for review
November 13, 2026 08:17
This was referenced Nov 13, 2026
dan-petty
added a commit
that referenced
this pull request
Nov 13, 2026
…base (#5401) The Jev completeness check of the row `stage_ready` read the diff of the pulls endpoint, and the pick of the scheduled release merge read the pulls files list. GitHub can keep a stale `base.sha` after a merge commit moves the merge base of a pull request. Then these reads hold files of other changes: Jev judges a plan with files that the plan does not change, and the release guard refuses a release pull request for a file of `main`. Both readers now read the compare of the base branch and the head commit, which is the diff that the squash merge applies. The new `GitHubClient.get_compare_diff` reads that diff and shares one diff read with `get_pr_diff`. The pick reads the files with `get_compare_files`. Item 2 of the issue, the review of a pull request that a merge commit merged, moves to #5397: the compare read of `devops review pr` is only in the open pull request #5387. Closes #5388 Change: `openspec/changes/archive/2026-11-13-5388-pr-change-reads-merge-base/`
This was referenced Nov 13, 2026
dan-petty
added a commit
that referenced
this pull request
Nov 13, 2026
PR #5387 and PR #5401 merged two minutes apart, and each added `GitHubClient.get_compare_diff` to `src/devops_cli/github/client.py` with the same body. Git merged both with no conflict, so `main` defines the method twice: ruff F811 and mypy `no-redef` fail, the Static Analysis check of `main` fails, and the pre-push hook refuses every branch that holds this `main` (#5389 and #5400 wait for this fix). This change keeps one method and names both callers (#5346, #5388) in its docstring. The body does not change, so no behavior changes. Closes #5404 Change: `openspec/changes/archive/2026-11-13-5404-main-defines-get-compare-diff-twice/`
dan-petty
pushed a commit
that referenced
this pull request
Nov 13, 2026
🤖 I have created a release *beep* *boop* --- ## [0.127.1](v0.127.0...v0.127.1) (2026-11-13) ### Bug Fixes * **ci:** alarm at 360 s, one P0 issue, shards by recorded time ([#5377](#5377)) ([2abd6ff](2abd6ff)) * **github:** read the plan diff and the release files from the merge base ([#5401](#5401)) ([c54e14c](c54e14c)) * **infra:** turn off the Ansible color of every playbook run ([#5381](#5381)) ([5bafb1a](5bafb1a)), closes [#5352](#5352) * install-tools --check passes an older openspec binary ([#5355](#5355)) ([625c89d](625c89d)) * **k8s:** allow only the Ingress origins in Open WebUI ([#5357](#5357)) ([fdab229](fdab229)) * **pr:** count only the latest run of each check ([#5393](#5393)) ([634dc91](634dc91)) * **review:** drop the fixed gateway URL of the review dry run ([#5399](#5399)) ([0666d3d](0666d3d)) * **review:** review a pull request at the merge base of its base branch ([#5387](#5387)) ([351ba2a](351ba2a)), closes [#5346](#5346) * **roadmap:** end fix-plan at a time budget with a result line ([#5380](#5380)) ([20468f4](20468f4)), closes [#5363](#5363) * **roadmap:** refine skips an item that changed during the write ([#5392](#5392)) ([a863dda](a863dda)) * **roadmap:** stage writes RENAMED and REMOVED spec deltas ([#5367](#5367)) ([4abbbd2](4abbbd2)) * **roadmap:** title the delivery by the summary of its plan ([#5376](#5376)) ([10e1069](10e1069)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
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.
devops review pranddevops ai analyze prread the files of a pull request from the compare of the tip of its base branch and its head commit. This is the diff that a squash merge applies. The review reads the diff from the merge base of that compare. It reads the base text and the base conventions at that merge base, and makes the base worktree there.Before, both commands read the pulls files endpoint, and the review read the pulls diff and the payload's
base.sha. GitHub does not move these when a merge of the base branch into the pull request moves its merge base. Thus the review read the changes ofmainas changes of the pull request.GitHub lists at most 300 files of one compare. At that limit,
devops review prstops and namesdevops review branch, anddevops ai analyze prwarns.Closes #5346
Change:
openspec/changes/archive/2026-11-13-5346-review-pr-merge-base/