Repository navigation
fix(pr-reviews): [#2606] accept audit fixes merged outside the local commit range - #2641
Conversation
…p URL parsing in the spec Co-authored-by: Copilot <[email protected]>
…he audited PR's commits Red: valid_subjects does not exist yet. The design review is recorded in the issue-local test-design-review.md. Co-authored-by: Copilot <[email protected]>
…PR's commits Co-authored-by: Copilot <[email protected]>
… follow-up PR's commits Red: pulls_to_check does not exist yet. Co-authored-by: Copilot <[email protected]>
…s named in the audit Co-authored-by: Copilot <[email protected]>
…h failures as usage errors Red: a gh failure while listing commits raises CalledProcessError instead of exiting 2. Co-authored-by: Copilot <[email protected]>
…ng PR commits fails Co-authored-by: Copilot <[email protected]>
…urces of validate-audit-record Co-authored-by: Copilot <[email protected]>
…isting-audit rerun Co-authored-by: Copilot <[email protected]>
…nd criteria done Co-authored-by: Copilot <[email protected]>
The 20:30 stamp was written before that time had passed. Co-authored-by: Copilot <[email protected]>
…e evidence Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The focused implementation matches the specified behavior, with deterministic tests and recorded real-audit verification supporting approval.
No open issues 🎉
What changed in this PR
Fixes #2606 by allowing the PR-review audit validator to recognize fix commits from audited and follow-up pull requests, even after those fixes have merged outside the local commit range.
Changes:
- Combines commit subjects from the audited PR, recorded follow-up PRs, and
<base>..HEAD. - Reports failed commit-list requests with exit code 2 and the failing endpoint.
- Adds seven deterministic tests and documents the behavior, test design, and real-audit verification.
| File | Description |
|---|---|
docs/issues/open/2606-2278-validate-audit-record-merged-fix-subjects/test-design-review.md |
Records test rationale and red/green development evidence. |
docs/issues/open/2606-2278-validate-audit-record-merged-fix-subjects/manual-verification-evidence.md |
Records merged-audit checks and regression comparisons. |
docs/issues/open/2606-2278-validate-audit-record-merged-fix-subjects/ISSUE.md |
Updates implementation progress and acceptance evidence. |
.github/skills/dev/pr-reviews/process-pr-review/SKILL.md |
Documents the three subject sources and failure behavior. |
.github/skills/dev/pr-reviews/process-pr-review/scripts/validate-audit-record.py |
Fetches PR commit subjects and deduplicates follow-up references. |
.github/skills/dev/pr-reviews/process-pr-review/scripts/test_validate_audit_record.py |
Tests subject acceptance, rejection, URL parsing, and request failures. |
Review effort: Balanced
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 453c6fa9a5b1070da8556a5558741273a250c2e3. Recomputed from the bytes at this head, against the merge base abce11ec8; git merge-tree against develop d09a45f0a writes a clean tree (bf6ee1ca4).
Verdict: approve. The fix does what the issue asks, but the committed bytecode (F2) should leave the branch before merge. Six findings are inline. None changes the merged tree in a way a later commit cannot repair, and none misreports what the code does.
The change of behaviour.
valid_subjectsunions<base>..HEADwith the first message line of each listed pull request's commits.pulls_to_checktakes everygithub.com/<owner>/<repo>/pull/<n>in aFollow-up PR URLline, from the repository in the URL (the spec's recorded rule). It skipsN/AandNA, and fetches each pull request once, the audited one included.- Matching stays exact (
ref not in subjects): no prefix or case folding. - A
CalledProcessErrorexits 2 naming the endpoint, with no fallback. - Every run now needs
gh, even with--comments-file, and an absentghexits 1 (F1).
The tests.
- Seven tests patch
subprocess.run, so no process or network is reached. An unknown endpoint raisesKeyError. - I ran them with bytecode writes off: seven pass, and the tree stays clean.
- The two increment tests fail at their own commits on the missing function, and the exit-2 test fails on
CalledProcessError. Each followingfixcommit turns its test green. - The rejection test cannot fail (F3).
test-design-review.mdmatches the tests.
The committed bytecode. Both .pyc files are tracked, stale and unignored (F2).
The spec and records.
- On
develop, the #2584 audit has the three FIXED subject rows (WAIT-001 via #2596), and #2599 has one, as counted. - The 11 named audits exist. 148 audit records have a
FIXEDrow, against the spec's 157 (F6). - The 502 message matches the code's format.
- Some completion text is stale (F5), and F4 covers the failure message.
- Links resolve.
Hygiene.
- Twelve Conventional subjects with
issues,pr-reviewsand[#2606], and all twelve commits are signed. - The bodies match their diffs, and author equals committer.
- Each commit ends in an attribution footer naming the review bot's account, which no rule in the tree governs.
git diff --checkis clean, and the commit-id check prints nothing.- The description closes #2606 only.
The bot. It started at 20:39:55Z, and the capture holds no review from it.
Findings: F1 (Minor), F2 (Major), F3 (Minor), F4 to F6 (Nit), inline.
Checked, no finding:
- the help and the skill text against the code, apart from F1;
- the replacement-PR flow (its fixes land on the replacement pull request);
- the
.gitignorerules; - the five sibling
test-design-review.mdfiles, which also carry no frontmatter; - the stamps against their commits, including the
1e249e2e7correction.
Checks
On the loop's compute hub at this head, against the merge base abce11ec8, the #2630 merge (receipt server-gates-sojka-452; git merge-tree against develop at 1d14569cd, the #2638 merge, is clean): pre-commit profile gate exit 0 (86 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 16 errors / 4 warnings at this head and 16 / 4 at the base re-measured, the same 20 diagnostics by path and category, none in the files this PR touches. python3 -m unittest discover -s .github/skills/dev/pr-reviews/process-pr-review/scripts -v on Python 3.12.3: 7 tests, all ok; validate-audit-record.py --help exits 0. git ls-files lists two tracked bytecode files, both added by this PR under scripts/__pycache__/, and no .gitignore rule covers .pyc or __pycache__. The hub has no gh, so the rerun over the existing audits was not repeated. GitHub checks at this head at posting time: "Package Coverage (${{ matrix.package }}): completed/skipped; Package Coverage Regression: completed/success; Docker E2E: completed/skipped; Workspace Packaging: completed/success; Unit (stable): completed/success; Documented Clippy Allows: completed/success; Unit (nightly): completed/success; Generate Coverage Report: completed/success; Layer Boundary Bans: completed/success; Discover Package Coverage: completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Test (Docker) (release): queued/pending; Docs Lint: completed/success; Build on macos-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on windows-latest (stable): completed/success; Build on ubuntu-latest (nightly): completed/success". At posting, develop is 722f2b5b2.
|
ACK 453c6fa |
…ssues/closed 4b79b09 chore(issues): archive closed issue #2606 spec to docs/issues/closed (Jose Celano) Pull request description: Archives the spec for issue #2606 (closed on GitHub by the merge of PR #2641) from `docs/issues/open/` to `docs/issues/closed/`. - Verified issue #2606 is `CLOSED` on GitHub - Updated frontmatter (`status: done`, `spec-path`, `related-pr: 2641`, `last-updated-utc`) and the evidence file's `issue-spec` path - Ticked the closure checkpoint and added a progress-log entry - No other live reference to the old path exists; the two mentions in the PR #2607 and PR #2613 review audits are historical records and are left as written - `linter all` and the pre-commit hook passed This change moves the spec only. The review findings F1 to F6 submitted on PR #2641 are not addressed here. ACKs for top commit: josecelano: ACK 4b79b09 Tree-SHA512: d041c6f7c9d062631c0048b1088096c2315f231723c6980d0a3983c84468296612530cdb3c41f8c2781deec93c4a8e5b561708e3b9e72dff56f4defb42bd1cef
|
Maintainer approval for the post-merge follow-up of the review submitted on this pull request (review 5640012066, submitted 2026-10-24 21:01 UTC, before the merge at 2026-10-25 06:25 UTC and left unprocessed when it merged). The maintainer approved this follow-up in chat on 2026-10-26 15:43 UTC, and this comment records that approval on that day: fix findings F1 to F6 in one small pull request with no new issue or specification, and record them in |
… of the validate-audit-record change 5de6253 docs(pr-reviews): record the review audit for PR 2657 (Jose Celano) 585237d docs(issues): [#2606] count the red regression cases as two in the closed spec (Jose Celano) 0c8c40e docs(pr-reviews): record the post-merge review audit for PR 2641 (Jose Celano) 24e5195 docs(issues): [#2606] correct stale records and the audit count in the closed spec (Jose Celano) 0d26ebb fix(pr-reviews): exit 2 when gh is missing and name the three sources in the failure text (Jose Celano) b7c6df2 test(pr-reviews): pin near-miss rejection in check_row and a missing gh as a usage error (Jose Celano) 2097df5 chore(pr-reviews): untrack Python bytecode and ignore __pycache__ (Jose Celano) Pull request description: ## Summary Follow-up for the review of #2641 (review 5640012066, submitted 2026-10-24 21:01 UTC, before that pull request merged at 2026-10-25 06:25 UTC, and unprocessed when it merged). The maintainer approved the follow-up: #2641 (comment). No new issue or specification; the work relates to #2606, which #2641 closed. | Finding | Change | | ------- | ------ | | F1 (Minor) | A missing `gh` now exits 2 and names the commits endpoint, like a failed call; the help text and the skill say `gh` is needed even with `--comments-file`; the spec's Risks line is corrected. | | F2 (Major) | The two tracked `__pycache__/*.pyc` files are removed and `__pycache__/` is git-ignored. The blobs stay in the history of `develop`. | | F3 (Minor) | The test that could not fail is replaced by `CheckRowTest`, which calls `check_row` with an exact match and with near-miss subjects (other case, prefix, suffix). | | F4 (Nit) | The failure text names the three sources and keeps "not a commit subject". | | F5 (Nit) | Stale statements in the archived #2606 spec and evidence file are corrected (completion review, recheck status, "fails on the current code"). `related-pr` and `last-updated-utc` were already fixed by the archive. | | F6 (Nit) | The "11 of 157" wording now says what was counted (the 157 `PR-REVIEW.md` files that contain the word `FIXED`) and cites the reviewer's 148 files with a `FIXED` row. I did not recount it. | The audit record `docs/pr-reviews/pr-2641-review/PR-REVIEW.md` is added in the last commit. ## Validation - `python3 -m unittest discover -s .github/skills/dev/pr-reviews/process-pr-review/scripts`: 9 tests pass. The missing-`gh` test was red before the fix (`FileNotFoundError`); the `check_row` tests guard existing behavior. - `linter all` and the pre-commit hook pass for each commit. ACKs for top commit: josecelano: ACK 5de6253 Tree-SHA512: 29f30f086b31128ee9b7a591667e51a444f8f5c547de24ad172e1fb0d372aa72309836796a6d9aba7439d27d42635c2f4187840db9babc3997e68749600719db
|
Follow-up complete: PR #2657 merged on 2026-10-26 17:59 UTC as merge commit
The six threads are resolved and the audit moves to |
…ter its follow-up merged 6295926 docs(pr-reviews): close the loop on the PR 2641 audit after its follow-up merged (Jose Celano) Pull request description: Closes the review loop for #2641 after its follow-up #2657 merged (merge commit `54eabcbf4`), as the process-pr-review skill requires for post-merge feedback. - Moves the six rows of `docs/pr-reviews/pr-2641-review/PR-REVIEW.md` from `FOLLOW_UP`/`OPEN` to `FIXED`/`RESOLVED`, with the fixing commit subjects as resolution references and the merge recorded in the Processing Log. - The consolidated response is #2641 (comment), and the six threads on #2641 are resolved (a GraphQL fetch shows all six `isResolved: true`). Validation: `validate-audit-record.py --pr-number 2641 --base torrust/develop` reports 6 rows, 4 log entries, 0 failures; the pre-commit hook passed. ACKs for top commit: josecelano: ACK 6295926 Tree-SHA512: 1c4caa4ad27060531672ba59d2dff9b9a9437e466af5dc391b0dec9c31827643a9ec103b36ea74b3c13ab4a6209e3de16c4bd9e043f05948fd4564ac3bc9adca
|
Post-merge note: this pull request requested a review from this account and was closed without one at its final head. A post-merge review will not be done: It was approved at its final head commit 453c6fa before it merged, so the requested review exists. |
Summary
validate-audit-record.pyrequired everyResolution referencecommit subject to exist in<base>..HEAD. With an up-to-date base, a merged fix is no longer in that range, so valid audits failed (--base torrust/developfailed 3 rows of the PR #2584 audit and 1 row of the PR #2599 audit). With the default base, a stale localdevelopmade the same audits pass by accident. A fix can also merge in another pull request, as the WAIT-001 fix of the PR #2584 audit did in PR #2596.The valid subjects now come from three sources: the commits of the audited pull request, the commits of every pull request named in a
Follow-up PR URLfield (both fetched withgh api repos/<owner>/<repo>/pulls/<n>/commits --paginate, which works after merge), and<base>..HEADfor commits not pushed yet. A failedghcall while listing commits exits 2 and names the endpoint; it never falls back to<base>..HEAD. The script stays a Python prototype.Closes #2606
Files touched
.github/skills/dev/pr-reviews/process-pr-review/scripts/validate-audit-record.py:valid_subjectsreplacesbranch_subjects, newpulls_to_check, usage-error exit, help text..github/skills/dev/pr-reviews/process-pr-review/scripts/test_validate_audit_record.py: new standard-libraryunittestmodule withgitandghfaked at the process boundary (7 tests)..github/skills/dev/pr-reviews/process-pr-review/SKILL.md: the "Validation Script" section describes the three sources.docs/issues/open/2606-2278-validate-audit-record-merged-fix-subjects/: spec progress,manual-verification-evidence.md, and the newtest-design-review.md.Validation
python3 -m unittest discover -s .github/skills/dev/pr-reviews/process-pr-review/scripts: 7 tests pass. Each test increment has its red run and prose-first design review intest-design-review.md.linter allexits 0, and the pre-push hook (nightly checks and the full stable test suite) passed.--base torrust/develop, the PR docs(issues): add specification for PR review wait poller #2584 and PR docs(pr-reviews): mark WAIT-001 fixed in the PR 2584 audit #2599 audits pass (4 failures before the fix).develop, withHEADunchanged.FIXEDrow: 146 pass; the other 11 also fail with the unmodified script (with more subject failures), for reasons in their own content, so nothing regresses.The commands, runtime versions, and output are in
manual-verification-evidence.md. Twopulls_to_checktests go beyond the spec's case list; they pin the follow-up URL parsing rule recorded in the spec. The branch was not rebased onto the latesttorrust/develop.