Repository navigation
Description
Problem Description
devops review pr reads the files of a pull request from the pulls files endpoint, and it reads their base text at the merge base of the payload's base.sha and the head commit (_pr_base_revision in src/devops_cli/ai/review/runner.py). The command also gives pull.base.sha to the review worktrees as the base revision (src/devops_cli/commands/review.py). GitHub does not move base.sha when a merge commit moves the merge base of a pull request. Thus, after a person merges main into a pull request branch, the review reads a stale file list and a stale base, and it reviews the changes of main as changes of the pull request.
Issue #2530 fixes the same cause in devops pr check-readiness: readiness compares from the tip of the base branch (compare/<base-ref>...<head-sha>). The review runner and devops ai analyze pr still read the pulls files endpoint.
Reproduction Steps
uv run devops gh api repos/dan-petty/devops-cli/pulls/2509 --jq '{base_sha: .base.sha, head: .head.sha, changed_files}'gives base.sha 0137f23, head 344adba and 184 changed files.uv run devops gh api 'repos/dan-petty/devops-cli/compare/0137f231...344adba9?per_page=1' --jq '{mb: .merge_base_commit.sha, files: (.files|length)}'gives merge base 0137f23 and 184 files. This is the base that the review reads.uv run devops gh api 'repos/dan-petty/devops-cli/compare/main...344adba9?per_page=1' --jq '{mb: .merge_base_commit.sha, files: (.files|length)}'gives merge base 5c4d24e and 11 files, the files of the squash commit.
Expected vs Actual Behavior
Expected: a review of a pull request reads the files and the base text of the diff that the squash merge applies, which is the compare of the base branch and the head commit.
Actual: the review reads the 184 files of the pulls files endpoint and the base text at 0137f23.
Environment Diagnostics
origin/main on 2026-11-13. Found during the rework of #2530.
Logs, Traces, or Terminal Output
pulls/2509: base.sha 0137f231, head 344adba9, changed_files 184
compare/0137f231...344adba9: merge base 0137f231, 184 files
compare/main...344adba9: merge base 5c4d24ee, 11 files
Activity
dan-petty commentedon Nov 13, 2026
Both fix the same root cause (stale pull.base.sha from the pulls files endpoint) but in different commands: #2530 in check-readiness and monitor, this in the review runner and ai analyze pr.refactor(github): define get_compare_diff once (#5405)
chore(main): release 0.127.1 (#5403)
devops-cli-service commentedon Nov 13, 2026
Released in v0.127.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.127.1
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 12:38 UTC