Skip to content

fix(github): read the plan diff and the release files from the merge base - #5401

Merged
dan-petty merged 2 commits into
mainfrom
fix/5388-pr-change-reads-merge-base
Nov 13, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/5388-pr-change-reads-merge-base

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

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/

…base

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 moved
the merge base. Then both reads hold files of other changes.

Both readers now read the compare of the base branch and the head
commit. GitHubClient.get_compare_diff reads the compare in the diff
media type, and it and get_pr_diff share one private read of a diff.
The pick reads the files with get_compare_files. RELEASE_CYCLE.md says
where the file guard reads the files.

The review of a pull request that a merge commit merged moves to #5397.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/github GitHub Projects v2, Views, Milestones, Labels, and PR automation labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Checks on head 3baabd6b3, rebased on origin/main before the push:

  • uv run devops ci fail-to-pass --base origin/main: 12 tests fail on base and pass on head (12 failed and 63 passed on base in the 3 changed test files). The new tests:
    • tests/github/test_github_client.py::test_get_compare_diff_reads_the_three_dot_compare_of_the_base_branch_in_the_diff_media_type (base: AttributeError: 'GitHubClient' object has no attribute 'get_compare_diff')
    • tests/release/test_release_merge_pick.py::test_the_pick_reads_the_files_of_the_release_since_the_merge_base_with_main (base: the pulls files list holds a file of main, so the guard refuses and the pick gives None)
    • tests/roadmap/stage/test_roadmap_stage_ready_jev.py::test_jev_reads_the_diff_of_the_draft_since_the_merge_base_with_its_base_branch (base: the round reads the pulls diff. The fake answers by URL only, so on base that read gets the JSON payload and raises GitHubUnreadError; the test also asserts that no pulls diff request is sent.)
  • uv run devops ci test tests/github/test_github_client.py tests/release/ tests/roadmap/stage/: 2680 passed, 1 skipped.
  • uv run mypy --python-version 3.14 --strict src: no issues in 841 source files.
  • uv run ruff check and uv run ruff format --check on the 6 changed Python files: pass.
  • uv run devops ci --check --only lint,format,domain: pass. uv run devops ci docs: up to date. uv run devops openspec check: pass.

Live check on 2026-11-13: compare/main...<head of #5387> in the diff media type gives 27 diff --git lines, the same count as the files of the JSON compare. So the compare endpoint serves the diff that get_pr_diff reads.

Render diff: no k8s/ path changes, so there is no render diff.

Known conflict: open PR #5387 adds the same _read_diff and also a get_compare_diff in src/devops_cli/github/client.py. The pull request that merges second keeps one copy of each method.

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 11:06
@dan-petty
dan-petty merged commit c54e14c into main Nov 13, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/5388-pr-change-reads-merge-base branch November 13, 2026 11:37
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/github GitHub Projects v2, Views, Milestones, Labels, and PR automation type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(github): the other pull request change readers still use a stale base

1 participant