Repository navigation
Description
Parent EPIC: #2278 - Strengthen PR Review Author Self-Audit and Evidence Generation
Subissue 3 of #2278. It replaces the four fetch-review-threads Bash and jq scripts with one Rust workspace tool that reproduces their data exactly, so that the follow-up subissue can change what the tool collects with fixture tests instead of editing untested jq filters.
Goal
Provide a tested Rust binary under contrib/dev-tools/ that fetches pull-request review threads through GitHub CLI GraphQL and reproduces the data of the current fetch-review-threads scripts, then remove those scripts and point the skills at the binary.
Background
The fetch-review-threads skill ships four Bash scripts (get-pr-review-threads.sh, list-unresolved-threads.sh, show-unresolved-thread-bodies.sh, and check-thread-reply-status.sh) written quickly to unblock the review workflow. They have no tests, their filtering logic lives in jq strings duplicated across files, and the next subissue (F17, F18, F32) must change that logic. Repository policy prefers Rust once developer tooling is non-trivial or worth testing independently, and every other Rust developer tool already lives as a non-published workspace crate under contrib/dev-tools/ invoked with cargo run --package.
This subissue is parity only. Its value is the test seam and the removal of untested shell logic; the behaviour changes belong to the next subissue so each pull request is reviewable on its own.
Scope
In scope:
- A non-published workspace crate under
contrib/dev-tools/github/with one binary offeringfetch, unresolvedlist, unresolvedshow, andreply-statussubcommands. - Exact reproduction of the GraphQL query fields and the JSON file shape written by
get-pr-review-threads.sh, whichresolve-all-unresolved-threads.shconsumes. - Field-level parity of each script's stdout, summary counts, and exit codes.
- Compliance with the global CLI output contract as a
stdout-result-databinary, including registration in the ADR table. - A narrow
ThreadSourcetrait so projections are unit-tested with checked-in GraphQL fixtures and no test invokesghor the network. - Deletion of the four Bash scripts and update of the
fetch-review-threadsandresolve-review-threadsskills. - A manual capture against a real pull request compared with the last shell output.
Out of scope:
- Returning resolved/outdated threads or adding
resolvedByandline(next subissue). - Porting the
resolve-review-threadsscripts, which mutate GitHub state. - Pagination beyond the current first 100 threads.
- Replacing
ghwith a direct HTTP client.
Specification
Full specification with implementation plan, commit points, acceptance criteria, and verification scenarios: docs/issues/open/2318-2278-port-review-thread-scripts-to-rust/ISSUE.md (added by the spec-only PR).
References
- Parent EPIC: Strengthen PR review author self-audit and evidence generation #2278; grandparent EPIC: Overhaul: Automation Tools and AI Agent Guardrails #2003.
- Placement precedent:
contrib/dev-tools/checks/clippy-allow-reasons,contrib/dev-tools/checks/frontmatter-validator(Implement the Rust Frontmatter Model and Initial Validator #2266). - Output contract:
docs/adrs/20260519000000_define_global_cli_output_contract.md.
Activity
docs(issues): add issue specification for torrust#2318
docs(issues): split EPIC torrust#2278 thread-helper work into Rust po…
Merge #2319: docs(issues): [#2318] add spec for porting review-thread…
Merge torrust#2322: feat(dev-tools): [torrust#2318] port review-threa…
chore(issues): archive closed issue torrust#2318 spec to docs/issues/…
chore(issues): archive closed issue torrust#2318 spec to docs/issues/…
Merge #2330: chore(issues): archive closed issue #2318 spec to docs/i…
Merge #2334: docs(issues): [#2333] add spec for fetching all review t…