Skip to content

docs(issues): count unresolved threads over the whole PR in the poller exit condition - #2596

Merged
josecelano merged 1 commit into
torrust:developfrom
josecelano:2581-fix-poller-exit-condition-spec
Oct 21, 2026
Merged

josecelano merged 1 commit into
torrust:developfrom
josecelano:2581-fix-poller-exit-condition-spec

Conversation

@josecelano

Copy link
Copy Markdown
Member

Summary

Fixes the exit condition in the #2581 poller spec, as approved in the audit-only follow-up for Copilot finding WAIT-001 (review-finding:pr-2584-wait-001) on merged PR #2584. The old condition checked unresolved threads only on the latest commit, so unresolved feedback from earlier commits could be overlooked.

Changes

  • Exit condition: Copilot's latest review is on the head commit, and no unresolved actionable thread exists anywhere in the PR, and the ACK is present or a waiver is recorded.
  • Note that review-body findings without a thread are handled through the audit workflow, not the thread check.
  • Align the end state (goal 4) and Decision 1 with the Merge Readiness section added to the merge-pull-request skill in docs(skills): record merge-gate waiver for PR 2584 and document merge readiness #2592 (ACK recommended and waivable).
  • Progress log entry and last-updated-utc updated.

Spec only: no code, script or skill changes. The implementation stays with #2581.

Validation

  • linter all and the pre-commit and pre-push hooks passed.

Related

Related to #2581, #2584, #2588 and #2592. After this merges, the #2584 audit row for WAIT-001 should move from FOLLOW_UP to FIXED with the merge reference (post-merge workflow step 6).

…PR in the poller exit condition

Copilot finding WAIT-001 on PR torrust#2584 noted that checking unresolved threads
only on the latest commit can overlook actionable feedback from earlier
commits. Count unresolved actionable threads over the whole PR, and align the
end state and ACK requirement with the Merge Readiness section of the
merge-pull-request skill (ACK recommended, waivable with a recorded decision).

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 07:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused specification changes address WAIT-001 consistently with the documented merge-readiness requirements, with no unresolved findings.

No open issues 🎉

What changed in this PR

Updates the #2581 poller specification to address WAIT-001. This PR changes documentation only; implementation remains separate.

Changes:

  • Check unresolved actionable threads across the entire PR.
  • Clarify audit handling for review-body findings.
  • Align the exit condition with head-commit review and ACK-or-waiver requirements.
File Description
docs/​issues/​open/​2581-2003-pr-review-wait-poller/​ISSUE.md Corrects review-loop completion criteria and records the amendment.

Review effort: Balanced

@josecelano
josecelano requested a review from da2ce7 October 21, 2026 08:09
@josecelano josecelano self-assigned this Oct 21, 2026
@josecelano

Copy link
Copy Markdown
Member Author

ACK f8f53e8

@josecelano
josecelano merged commit d21282a into torrust:develop Oct 21, 2026
1 check passed
josecelano added a commit that referenced this pull request Oct 21, 2026
PR #2596 merged the poller spec fix for Copilot finding WAIT-001. Change the
disposition from FOLLOW_UP to FIXED, cite the fix commit subject and the
follow-up PR, and log the closure.

Co-authored-by: Copilot <[email protected]>
josecelano added a commit that referenced this pull request Oct 21, 2026
ae26e2c docs(pr-reviews): record the review audit for PR 2599 (Jose Celano)
5781fb3 docs(pr-reviews): move the WAIT-001 closure entry into the Processing Log (Jose Celano)
46f2c63 docs(pr-reviews): mark WAIT-001 fixed in the PR 2584 audit (Jose Celano)

Pull request description:

  ## Summary

  Closes the loop on Copilot finding `WAIT-001` (`review-finding:pr-2584-wait-001`), step 6 of the post-merge workflow in the `process-pr-review` skill. PR #2596 merged the spec fix (merge commit `d21282aa4`, 2026-10-21 09:33:59 UTC).

  ## Changes

  - WAIT-001: disposition `FOLLOW_UP` -> `FIXED`; resolution reference is the fix commit subject; follow-up PR URL is #2596; current-tree verification re-derived on `develop` at `d21282aa4`.
  - Processing Log entry appended. Earlier entries are unchanged. Thread state stays `NON_RESOLVABLE` (review-body finding, no thread). No GitHub thread to resolve.

  ## Validation

  - `validate-audit-record.py --pr-number 2584 --base fcd7897^1`: ok, 0 failures. With the default `--base develop` the validator cannot see commit subjects of an already merged fix, so a wider base was used; F1 and F2 fail with the default for the same reason.
  - `linter all` and the pre-commit and pre-push hooks passed.

  ## Related

  Related to #2581, #2584 and #2596.

ACKs for top commit:
  josecelano:
    ACK ae26e2c

Tree-SHA512: 1ac6fac6510cd96d72ab79e97770a6cb59146e928a25238948ccb40f482604b9d72646efd8b5c365ec4f164209e912fdc19c09ca7568b53ae91a5a149b2850fa
josecelano added a commit that referenced this pull request Oct 21, 2026
…d-fix subject fix

dca0cd6 docs(pr-reviews): record the review audit for PR 2607 (Jose Celano)
7d1469f docs(issues): update local develop separately in the #2606 M2 scenario (Jose Celano)
6f55bb5 docs(issues): require test-design review gates in the #2606 plan (Jose Celano)
2dbe0d8 docs(issues): record the #2606 reproduction evidence before spec review (Jose Celano)
a18cd04 docs(issues): add issue specification for #2606 (Jose Celano)

Pull request description:

  ## Summary

  Spec-only PR for #2606. `validate-audit-record.py` requires each `FIXED` resolution reference to be a commit subject in `<base>..HEAD`. With an up-to-date base, a merged fix is outside that range, so valid audits fail. With the default local `develop`, they pass only when that branch is stale.

  ## Evidence

  Reproduced on 2026-10-21 at `torrust/develop` = `6da62f0ee`: `--base torrust/develop` fails 3 rows of the PR #2584 audit (F1, F2, WAIT-001) and 1 row of the PR #2599 audit (AUDIT-001). WAIT-001's fix merged in PR #2596, not #2584.

  ## Proposed fix

  Valid subjects come from `<base>..HEAD`, the audited PR's commits, and the commits of every PR in a `Follow-up PR URL` field (`gh api .../pulls/<n>/commits`). The script is 227 lines and the faulty check is one function, so the spec sizes this as a small fix and not a Rust migration.

  ## Correction

  The description of #2599 said the default `--base develop` fails on merged audits. That was wrong: I had tested `--base d21282a^1`. The spec records the accurate behaviour.

  ## Validation

  `linter all` and the pre-commit and pre-push hooks passed. Spec only: no script or skill changes.

  ## Related

  Related to #2606 (EPIC #2278), #2584, #2596 and #2599.

ACKs for top commit:
  josecelano:
    ACK dca0cd6

Tree-SHA512: 62daafe95dece3470e619ff64cb283e14fc4dc0e64be329d50e5b61b3755cc554e604801179cffbfb79f9999af5837629080695cbc10e072d26ebba4566949ac
josecelano added a commit that referenced this pull request Oct 25, 2026
…de the local commit range

453c6fa docs(issues): [#2606] cite the checked commit by subject in the evidence (Jose Celano)
1e249e2 docs(issues): [#2606] correct the completion review stamp (Jose Celano)
3e3df26 docs(issues): [#2606] mark the implementation tasks, checks, and criteria done (Jose Celano)
298370c docs(issues): [#2606] record the final recheck, V3, and the existing-audit rerun (Jose Celano)
c888ca0 docs(pr-reviews): [#2606] describe the three commit-subject sources of validate-audit-record (Jose Celano)
b6daa32 fix(pr-reviews): [#2606] exit 2 naming the endpoint when listing PR commits fails (Jose Celano)
ceebff0 test(pr-reviews): [#2606] reject unknown subjects and report gh failures as usage errors (Jose Celano)
097a86f fix(pr-reviews): [#2606] accept fix subjects from follow-up PRs named in the audit (Jose Celano)
bf9928b test(pr-reviews): [#2606] accept a fix subject found only in a follow-up PR's commits (Jose Celano)
1e28a2c fix(pr-reviews): [#2606] accept fix subjects from the audited PR's commits (Jose Celano)
f42bf3e test(pr-reviews): [#2606] accept a fix subject found only in the audited PR's commits (Jose Celano)
445fa35 docs(issues): [#2606] record maintainer decisions and follow-up URL parsing in the spec (Jose Celano)

Pull request description:

  ## Summary

  `validate-audit-record.py` required every `Resolution reference` commit 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/develop` failed 3 rows of the PR #2584 audit and 1 row of the PR #2599 audit). With the default base, a stale local `develop` made 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 URL` field (both fetched with `gh api repos/<owner>/<repo>/pulls/<n>/commits --paginate`, which works after merge), and `<base>..HEAD` for commits not pushed yet. A failed `gh` call 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_subjects` replaces `branch_subjects`, new `pulls_to_check`, usage-error exit, help text.
  - `.github/skills/dev/pr-reviews/process-pr-review/scripts/test_validate_audit_record.py`: new standard-library `unittest` module with `git` and `gh` faked 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 new `test-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 in `test-design-review.md`.
  - `linter all` exits 0, and the pre-push hook (nightly checks and the full stable test suite) passed.
  - M1: with `--base torrust/develop`, the PR #2584 and PR #2599 audits pass (4 failures before the fix).
  - M2: the result is identical with a stale and a current local `develop`, with `HEAD` unchanged.
  - M3: an audit copy with a subject that exists in no commit still fails with exit 1.
  - Rerun of the 157 audits that have a `FIXED` row: 146 pass; the other 11 also fail with the unmodified script (with more subject failures), for reasons in their own content, so nothing regresses.
  - A transient GitHub HTTP 502 during the rerun produced the designed exit 2 naming the endpoint.

  The commands, runtime versions, and output are in `manual-verification-evidence.md`. Two `pulls_to_check` tests 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 latest `torrust/develop`.

ACKs for top commit:
  da2ce7:
    ACK 453c6fa — the three-source subject check, its seven faked-process tests and the #2606 records were recomputed at this head.
  josecelano:
    ACK 453c6fa

Tree-SHA512: 7fb11856234bf229b672985f2558dc467c8dc9c71f3ef506bb4165b4d1fdf57cde3e4f9784de3a515e8e3b2980105a32fb06ee871a0792dc20c1b0e07c3eda0a
@da2ce7

da2ce7 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

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 changed one file, the #2581 issue specification, with no source, script or workflow change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants