Repository navigation
[#2713] fix(wait-for-pr-review): reject --timeout-seconds above one day instead of panicking - #2802
Conversation
…ad of panicking (torrust#2713) The deadline is Instant + Duration, which panics for huge values (exit 101, plain-text stderr). Bound --timeout-seconds to 1..=86400 so the rejection is the existing usage_error (exit 2) on every platform. Adds regression tests, updates --help and the skill table, records the decision and evidence. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at ac6786be0f80c0cea31d948ac3501898e2680774. Recomputed from the bytes at this head, against the merge base 1df1ecdf0; git merge-tree against develop 1df1ecdf0 writes a clean tree identical to the head tree, with no conflicts.
Process: a bug fix, governed by the fix-bug skill and its issue-folder evidence, with commit-changes and open-pull-request for the commit and the description. The test-first order, the boundary tests the spec asked for and the V2 recheck are present; the evidence gaps are F2 and F3.
The change against its claim: the range 1..=86400 makes every oversized value the existing usage_error, exit 2, before any call, and with it every Instant + Duration in the tool (the deadline, and the sleep deadline, which takes min(poll_interval, remaining)) stays far inside range. The oversized and 86401 tests fail with the bound removed; the 86400 test guards the inclusive end and passes either way, which the evidence says but the description, "they failed on the unfixed code", does not. The 75-byte pr_merged output recomputes. But the new constant sits between the Cli doc comment and its derive, which drops the program description from --help (F1).
Consistency: no link or anchor changes, nothing moved or renamed, no dictionary words added; the EPIC row stays TODO until the archive step. The maximum is stated once in the skill table and once in --help.
Hygiene: one commit, ac6786be0, Conventional subject with scope, body matching the diff, author equal to committer, one attribution footer naming a model, which no rule in the tree forbids. git diff --check is clean, the skill's PR-branch commit-id check prints nothing, and the closing-keyword scan matches only Closes #2713 in the description, the issue this change closes.
Findings: F1 Major (blocks), F2 and F3 Minor, F4 to F6 Nit.
Checked, no finding: the error text quoted in V2 has the range parser's message form; main.rs:132:57 is the deadline expression at 1df1ecdf0; the bound is inclusive in code, help, skill and tests; the new lines fit the 130-column layout.
Checks
On the loop's compute node at this head, against the merge base 1df1ecdf0 (receipt server-gates-kranich-587): the repository's pre-commit gate exit 0 (62 s), clippy-allow-reasons against the base exit 0, and the tree left clean; linter markdown, linter cspell, linter lychee (offline links) exit 0; frontmatter-validator --all showed no new error against the base. Package tests: cargo test -p wait-for-pr-review exit 0 (89 passed, 5 s). F1 measured: cargo run -p wait-for-pr-review -- --help at 1df1ecdf0 opens with "Block until a watched reviewer reviews or comments, the head commit changes, or the pull request closes. ..."; at this head the help message starts at "Usage:", with no description. The forge reports this head as mergeable. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (wait-for-pr-review): completed/success; Generate Coverage Report: completed/success; Discover Package Coverage: completed/success; Build on macos-latest (stable): completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Test (Docker) (release): in_progress/pending; Docker E2E: completed/skipped; Unit (nightly): completed/success; Layer Boundary Bans: completed/success; Workspace Packaging: completed/success; Unit (stable): completed/success; Documented Clippy Allows: completed/success; Shipped Features: completed/success; Docs Lint: completed/success". At posting, develop is 1df1ecdf0.
…evidence Review round 1: move MAX_TIMEOUT_SECONDS above the Cli doc comment so the program description stays in --help, assert it in the help test, rename the pull_calls helper, rerun V2, record green output, and update the spec bookkeeping and the decision record. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
The comment claimsInstant + Duration\"cannot overflow\" on any platform, but Rust does not… · New The helper will panic ifpull-callsexists but is empty/whitespace or otherwise unparsable… · New This inline-code span contains a newline, which can render inconsistently in Markdown and makes the… · New
What changed in this PR
This PR prevents wait-for-pr-review from panicking when --timeout-seconds is too large by bounding the CLI flag to a safe, documented maximum (one day), preserving the exit-code + JSON-stderr contract.
Changes:
- Bound
--timeout-secondsto1..=86400via clap and documented the limit in--helpand the skill table. - Added integration tests covering oversized values (including ensuring no
ghcall), max+1 rejection, and max acceptance. - Recorded the maintainer’s decision and manual verification evidence in the issue docs.
| File | Description |
|---|---|
| docs/issues/open/2713-2003-wait-for-pr-review-timeout-overflow-panic/manual-verification-evidence.md | Records post-fix manual verification output and red/green test evidence. |
| docs/issues/open/2713-2003-wait-for-pr-review-timeout-overflow-panic/ISSUE.md | Captures maintainer decision, task/AC status updates, and implementation notes. |
| .github/skills/dev/pr-reviews/wait-for-pr-review/tool/tests/cli.rs | Adds integration tests and a helper to assert oversized timeout fails before any API call. |
| .github/skills/dev/pr-reviews/wait-for-pr-review/tool/src/main.rs | Introduces MAX_TIMEOUT_SECONDS and applies a bounded clap range + updated help text. |
| .github/skills/dev/pr-reviews/wait-for-pr-review/SKILL.md | Updates the option table to document the maximum timeout and the resulting usage error. |
Review effort: Lite
… bound Reword the MAX_TIMEOUT_SECONDS comment so it does not claim a guarantee Rust does not give, make the pull_calls parse failure explicit, and put the recorded stderr of V2 in a code block. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 223de5ae2f8b8b05aa38cfafa8d33614558d2aa4. Recomputed from the bytes at this head, against the previous round's head ac6786be0 and the merge base 1df1ecdf0; git merge-tree against develop af8d84d25 writes a clean tree with no conflicts, differing from develop only in this pull request's five files.
What moved: e378282a3 and 223de5ae2, a fast-forward of ac6786be0, 4 files, +61/-28; every other path is byte-identical to ac6786be0.
Previous findings:
- F1 fixed: the
Clidoc comment sits on the derive again (main.rs:27-29); the help test guards it. - F2 partly fixed: run time, red and green output recorded; the build is still a working tree.
- F3 partly fixed:
related-pr, stamp and boxes updated;status,branchand one unstamped entry remain. - F4 partly fixed: renamed; AC1's evidence still says "no
ghcall". - F5 partly fixed: the decision names its source; the description still overstates the spec.
- F6 fixed: the title starts with
[#2713].
The new commits: the reworded constant comment is accurate (the standard library documents no minimum Instant range, and one day is far inside it); the red-run filter timeout_is selects exactly the three new tests; 62 unit and 27 integration tests at this head match the green counts. No review audit record exists, though nine threads were answered and resolved (F7).
Hygiene: Conventional subjects, author equal to committer, an attribution footer naming a model on each, which no rule in the tree forbids; git diff --check is clean and the skill's PR-branch commit-id check prints nothing. Each commit bundles several fixes (F9).
Findings: F2, F3, F7, F8 Minor; F4, F5, F9 Nit. None blocks the code, which is right at this head; this round is a comment with no ACK until the review audit record (F7) lands, as on the other pull requests whose rounds were answered without one.
Checked, no finding: gh_calls survives only in the log entry recording the rename; the help assertions catch the F1 regression; 223de5ae2 changes only a doc comment in main.rs, so V2's binary behaves as this head's; no link, anchor or dictionary word changed.
Checks
On the loop's compute node at this head, against the merge base 1df1ecdf0 (receipt server-gates-kranich-591): the repository's pre-commit gate exit 0 (37 s), clippy-allow-reasons against the base exit 0, and the tree left clean; linter markdown, linter cspell, linter lychee (offline links) exit 0; frontmatter-validator --all showed no new error against the base. Package tests: cargo test -p wait-for-pr-review exit 0 (89 passed, 4 s). F1 measured fixed: cargo run -p wait-for-pr-review -- --help at this head opens with the program description again. No review audit record exists at this head (docs/pr-reviews/pr-2802-review/PR-REVIEW.md), so this round is a COMMENT with no ACK until it lands. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (wait-for-pr-review): completed/success; Test (Docker) (release): in_progress/pending; Generate Coverage Report: in_progress/pending; Discover Package Coverage: completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on windows-latest (stable): in_progress/pending; Build on windows-latest (nightly): in_progress/pending; Build on ubuntu-latest (stable): completed/success; Docs Lint: completed/success; Docker E2E: completed/skipped; Documented Clippy Allows: completed/success; Unit (nightly): in_progress/pending; Shipped Features: completed/success; Layer Boundary Bans: completed/success; Unit (stable): in_progress/pending; Workspace Packaging: completed/success". At posting, develop is af8d84d25.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…nts only that Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 8986a8ee8a31bc4d830428c9f15e12fe4a155c59. Recomputed from the bytes at this head, against the previous round's head 223de5ae2 and the merge base 1df1ecdf0; git merge-tree against develop af8d84d25 writes a clean tree with no conflicts, differing from develop only in this pull request's six files.
What moved: b3029cbd9, 0c4ca79c2, 3e4a998aa, c5392feec, 8986a8ee8, a fast-forward of 223de5ae2, 3 documentation files, +319/-13; every other path, code and tests included, is byte-identical to 223de5ae2.
Previous findings:
- F2 fixed: V2 names the commit holding the production change and why the later one needs no rerun.
- F3 fixed:
status,branchand the 12:59 stamp match the work. - F4 fixed: the evidence row and the description say "no pull-request call".
- F5 fixed: the description says "the maintainer's choice".
- F7 fixed: the audit record exists; the validator's logic, run offline on the capture, exits 0.
- F8 partly fixed: the spec's stamps match
git log; the evidence stamp lags its last edit again. - F9 partly fixed: single-purpose
docscommits, but0c4ca79c2carries two findings.
The new commits: all 16 rows match their source review, thread, reply and severity in the capture. The record cites a branch commit by id (F10); the audit thread's reply predates the commit it cites (F11); the F4 sweep also narrowed AC1 and the scope line (F12).
Hygiene: Conventional subjects, author equal to committer, no body beyond one attribution footer naming a model, which no rule in the tree forbids; git diff --check is clean.
Findings: F8, F10, F11 Minor; F9, F12 Nit. None blocks: each is a record or wording slip the author can repair, and the code is unchanged and right.
Checked, no finding: the round-3 entry and the spec's last-updated-utc match c5392feec (14:00:54); the copied template sections are verbatim; the later automated review of c5392feec reports no open issue.
Checks
On the loop's compute node at this head, against the merge base 1df1ecdf0 (receipt server-gates-kranich-596): the repository's pre-commit gate exit 0 (37 s), clippy-allow-reasons against the base exit 0, and the tree left clean; linter markdown, linter cspell, linter lychee (offline links) exit 0; frontmatter-validator --all showed no new error against the base; the repository's audit validator on pr-2802-review exit 0 (16 rows, 3 log entries, no failures). Package tests: cargo test -p wait-for-pr-review exit 0 (89 passed, 3 s). The forge reports this head as mergeable. GitHub checks at this head at posting time: "". At posting, develop is af8d84d25.
| doc-type: manual-verification-evidence | ||
| issue-spec: docs/issues/open/2713-2003-wait-for-pr-review-timeout-overflow-panic/ISSUE.md | ||
| last-updated-utc: "2026-11-04 13:07" | ||
| last-updated-utc: "2026-11-10 13:31" |
There was a problem hiding this comment.
[Minor][F8] Partly fixed: the spec's stamps now match git log, but this one lags its file's last edit again.
b3029cbd9 rewrote V2's Build lines (74-77) at 13:55:40 UTC, and 0c4ca79c2 then set this field to 13:31, the time of 223de5ae2. The spec reads last-updated-utc as the time of the last edit (its lines 176-177), which here is 13:55; the audit's verification line for this finding names 13:31:52 for this file as well.
| - Source review ID: 5842971275 | ||
| - Reviewer finding ID: F9 | ||
| - Source URL: https://github.com/torrust/torrust-tracker/pull/2802#discussion_r4525681722 | ||
| - Concern: `223de5ae2` mixes types and each new commit bundles independent fixes. |
There was a problem hiding this comment.
[Minor][F10] This line cites the pull-request branch commit 223de5ae2 by id.
The open-pull-request skill's commit-id check, run at this head, prints PR-branch commit id: 223de5ae2; the skill lets no durable reference, review audits included, cite a branch commit by id, because a rebase changes it. Cite its subject, as the Resolution references do. The validator does not scan prose, so it passes either way.
| - Current-tree verification: `validate-audit-record.py --pr-number 2802` exits 0. | ||
| - Resolution reference: docs(pr-reviews): add the review audit record for #2802 | ||
| - Follow-up PR URL: N/A | ||
| - Reply URL: https://github.com/torrust/torrust-tracker/pull/2802#discussion_r4525738322 |
There was a problem hiding this comment.
[Minor][F11] The reply this row cites was posted at 13:59:38 UTC, on a review of 3e4a998aa, and says the fix is in the commit "docs(pr-reviews): add the review audit record for #2802" and that validate-audit-record.py passes; that commit is dated 14:00:54 UTC.
process-pr-review asks to state only what ran and to record an event only after it happened, and the validator could not pass before this reply existed, since it requires this row's Reply URL to resolve. The record is right at this head; a correction like the one line 103 records for an earlier reply keeps the trail accurate.
| - Reviewer finding ID: F9 | ||
| - Source URL: https://github.com/torrust/torrust-tracker/pull/2802#discussion_r4525681722 | ||
| - Concern: `223de5ae2` mixes types and each new commit bundles independent fixes. | ||
| - Solution: Nothing to repair in the bytes; from this round on each fix is its own commit, with a matching type. |
There was a problem hiding this comment.
[Nit][F9] Partly fixed: the five new commits are single-purpose and typed docs, but 0c4ca79c2 carries two findings, so "each fix is its own commit" here and in the reply overstates it.
Two rows of this record (lines 222 and 235) cite the same subject, "docs(wait-for-pr-review): correct the spec status, branch and log stamps". Say so here, or split such fixes in later rounds; nothing in the code to repair.
| on stderr, and makes no API request. | ||
| - [ ] AC2: No value the CLI accepts can make `main()` panic; the accepted range and the rejection behavior are | ||
| - [x] AC1: `--timeout-seconds 18446744073709551615` exits `2` with empty stdout and one `usage_error` JSON record | ||
| on stderr, and makes no pull-request request. |
There was a problem hiding this comment.
[Nit][F12] The sweep for the F4 wording also narrowed this criterion and the scope line (line 70) from "no API request" to "no pull-request request", though the code and the test meet the original in full.
main() returns the usage_error at Cli::try_parse (main.rs:92-98), before wait_started and so before gh auth status, and the test's kinds == ["usage_error"] shows the run stopped there; the test's own message (cli.rs:306) and lines 126-127 still say the value is rejected before any call. Only the evidence row needed the narrower wording; "no API request" here and at line 70 keeps the requirement as strong as what was verified.
|
ACK 8986a8e — the review audit record's 16 rows match the captured threads and pass the validator's logic offline, and every code and test path is byte-identical to the previously reviewed head |
|
ACK 8986a8e |
…ssues/closed 25b8944 docs(pr-reviews): add the review audit record for #2806 (josecelano-bot) c3ed08a docs(issues): log the #2713 checkpoint and retrospective corrections (josecelano-bot) b64c627 docs(issues): narrow the model claim in the #2713 log to the 2026-11-10 entries (josecelano-bot) ca70393 docs(issues): add the #2713 DONE entry to the EPIC #2003 progress log (josecelano-bot) 135313c docs(issues): give the reason no retrospective is needed in the #2713 log (josecelano-bot) 49c3e3e docs(issues): keep the drafting checkpoint of #2713 accurate (josecelano-bot) 04f358d docs(issues): name the model in the #2713 progress-log entries (josecelano-bot) 95aa785 chore(issues): archive closed issue #2713 spec to docs/issues/closed (josecelano-bot) Pull request description: Archives the spec for issue #2713 (closed on GitHub by #2802) from `docs/issues/open/` to `docs/issues/closed/`. Related to #2713. Part of EPIC #2003. - Verified issue #2713 is `CLOSED` on GitHub - Updated frontmatter (`status: done`, `spec-path`, `last-updated-utc`) and the evidence file's links - Ticked the completion checkpoints, recorded the retrospective reason and the archival log entry - Set row 18 of the EPIC #2003 table to DONE, with its progress-log entry - Validation: `linter all`, `cargo machete`, `cargo deny check bans` and the doc tests passed in the pre-commit hook of every commit. No live reference to the old path remains outside the historical audit `docs/pr-reviews/pr-2716-review/PR-REVIEW.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) ACKs for top commit: da2ce7: ACK 25b8944 — the audit record's nine rows match their reviews, threads, replies and commits with the validator's logic exiting 0 offline, the narrowed 16:05 entry and the 16:40 stamp match the bytes, and the merge into develop c2b5d96 is conflict-free josecelano: ACK 25b8944 Tree-SHA512: b994c4651a34da6c0e5a06e840e32dd1323d016f1627eae84364c1e3d2324731d383bc96a581c849bad8bfa4a97d094f103f80d5359050ccf6539ec2f922fcd1
|
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: The requested review was given at the final head, an approval of commit 8986a8e, so the review request still shown is a stale re-request. |

Closes #2713. Part of EPIC #2003.
wait-for-pr-reviewpanicked (exit 101, plain-text stderr) when--timeout-secondswas too large forInstant + Duration, breaking the exit-code and JSON-stderr contract.--timeout-secondsis now bounded to1..=86400(one day, the maintainer's choice), so an oversized value is the existingusage_errorwith exit2on every platform, before any API request. The--helptext and the skill option table state the maximum.Tests: three new integration tests in
tests/cli.rs(oversized value with no pull-request call, 86401 rejected, 86400 accepted). They failed on the unfixed code (exit 101 and exit 0) and pass now.cargo test -p wait-for-pr-review, clippy andlinter allpass. The spec andmanual-verification-evidence.mdrecord the decision, the red run and the real-binary recheck (V2).🤖 Generated with Claude Code