Repository navigation
fix(github): Fix check-readiness base and monitor merged state - #4980
devops-cli-service[bot] wants to merge 8 commits into
Conversation
|
The stage_ready row leaves pull request #4980 a draft. It holds the label |
#5160) The step fix-plan compared the count of open findings of the last plan comment, which an earlier review wrote at an earlier commit, with the last review of the revision. Two reviews of one plan can find different counts: on #4980 the comment listed 1 open finding and a review of the same head plan found 2, so the attempt reported a revision with 2 open findings as worse. Now each attempt reviews the head plan with the verification pass at the latest default branch and compares the last review of the revision with that review. The planner gets the open findings of that review and of the comment. A head plan with no open finding in its review loses the label with no plan call. The result line and the report of the command also show the count of the comment. Closes #5150 Change: `openspec/changes/archive/2026-11-12-5150-fix-plan-compares-the-revision-with/`
89b5e65 to
3a2d186
Compare
ee1e1ea to
90db533
Compare
90db533 to
506c399
Compare
|
The steps of the job:
|
dan-petty
left a comment
There was a problem hiding this comment.
A vetting review (4 reviewers by lens, a skeptic for each finding) found that this pull request does not fix the main defect of #2530. Do not merge it.
Blocking
src/devops_cli/github/merge_readiness.py:353: Confirmed, blocking (C1 = S1 = F1). _base_sha returns the payload base.sha, and read_changed_files compares from it. GitHub does not move base.sha when a merge commit moves the merge base. For PR #2509, the read returns 184 files and the false archived folders from the issue (2026-10-28-1024-..., 1652-..., 2429-...) in place of 11 files. The docstring claim 'it follows the merge base when a merge commit moves it' is false. The issue asks for the compare from the tip of the base branch (main...344adba).- Fix: Compare from the base branch name: compare/{quote(base.ref)}...{head sha}. Remove _base_sha. Correct the read_changed_files docstring, the get_merge_base docstring (client.py:501), the spec delta and the living spec (openspec/specs/pr-merge-readiness/spec.md:146, change 'the base commit' to 'the tip of the base branch'). Add a test whose payload base.sha is different from the merge base. The test must route only compare/main... and assert that the stale sha is not requested. Record the live PR #2509 probe in the proposal Feasibility section.
src/devops_cli/roadmap/implement/implement_pull.py:276: Confirmed, blocking (same root cause as C1/S1/F1). read_draft calls get_compare_files(repo, pull.base_sha, pull.head_sha). This uses the same stale base.sha, so the draft readiness of an implement PR reads the stale file list too. The dry-run target compare/... (src/devops_cli/commands/pr_plans.py:368) has the same defect.- Fix: Use pull.base_ref in place of pull.base_sha, and remove PullStatus.base_sha if nothing else reads it. Change the dry-run target to compare/.... Change test_read_draft_reads_the_files_from_the_compare_of_the_base_and_head so that it asserts the base ref.
Minor (fix in the same rework where it is easy)
- C2 (confirmed, minor) src/devops_cli/roadmap/implement/implement_pull.py:331: _judge checks only status.merged. Thus a closed unmerged PR gives WatchKind.READY or stops with a check-failure reason, and the run does not stop with implement_stop_merged. Fix: use 'if status.terminal:' and add a watch test for a closed PR. This gap existed before the PR.
- C3 = S2 (confirmed or partly, minor) src/devops_cli/roadmap/implement/implement_pull.py:276: read_draft does not use the truncated flag of the compare answer. A list cut at 300 files can hide tasks.md, and the refusal then gives a wrong reason (draft_change_missing). The result fails closed. Fix: carry the flag into Draft and refuse with a text that names the 300-file limit.
- S3 (confirmed, minor) src/devops_cli/github/merge_readiness.py:366: for a fork head, the compare uses owner:branch, but the checks use head.sha. Thus the compare can read a later commit than the checks (time-of-check to time-of-use). A live probe on pallets/click shows that GitHub resolves a fork head sha in the base repository. Fix: always compare to the head sha, and remove the fork rule. Then read_draft and read_changed_files use one compare-head rule.
- S5 (confirmed, minor) src/devops_cli/roadmap/grounding.py:42: ChangedFilesRead.truncated has the default False, and this reads as clean. ARCHITECTURE.md 'No Clean Default on a Result' forbids that. Fix: make the field required. Because ChangedFilesRead is a NamedTuple, put the field before error. Then update tests/github/test_item_grounding.py:77 and :303.
- F2 (confirmed, minor) src/devops_cli/github/merge_readiness.py:527: the early return on a truncated list also skips the body-form blockers, the closing-issue read and the 6 grounding rules that do not read files. perimeter_advisory (line 625) still runs on the partial list. Fix: skip only the rules that read the file list, and do not run the perimeter advisory when the list is truncated.
- TQ1 (partly, minor) tests/commands/test_pr.py:746: the closed-monitor test runs with --settle-timeout 0, so its one-poll assertion cannot fail. A revert of the terminal stop at pr_monitor.py:666 passes all tests. Fix: run the test with --settle-timeout 300.
- TQ2 (confirmed, minor) tests/commands/test_pr.py:142: the pulls/335/files route in _GitHub.files is dead, and its comment is false. The route hides a revert of read_draft to the pulls files read. Fix: delete the route and the comment (F3 found the same thing and rated it a nit).
- TQ3 (confirmed, minor) tests/roadmap/test_roadmap_draft_readiness.py:299: the new test replaces GitHubClient with MagicMock, but GitHubClient is not an edge. The test also accepts get_compare_files(repo, '', 'sha123'). Fix: use a real GitHubClient over github_api with route_compare_files, and assert the requested paths.
- TQ5 (confirmed, minor) src/devops_cli/commands/pr.py:621 and :553: no test covers the 'closed' markdown state label or the print_error output of a closed result. A mutation of either line passes all tests. Fix: add a closed row to the merged markdown test that asserts 'State: closed' and exit 2.
An agent delivers the fix in a new pull request that starts from the commits of this one, and this one closes as replaced. #2530 is claimed for that work, so the implement job does not start again on it.
|
Replaced by #5349, which carries this code with the fixes of the vetting review. |
The issue #2530 reports two wrong states of the
devops prcommands.devops pr check-readinessjudged a stale file list from the pulls files endpoint, which keeps the base of the last push, so a merge commit that moved the merge base gave a false not-grounded blocker naming archived changes of other issues.devops pr monitorreadmergedbut printedChecks: 0/0 passedand the ready line on every exit 0, so a pull request merged while it waited was reported 100% ready, and a closed unmerged pull request had no terminal result at all.Closes #2530
Change:
openspec/changes/archive/2026-11-13-2530-fix-check-readiness-base-and-monitor/