Repository navigation
poll: Route operator requests on others' pull requests through a tracking issue - #107
Conversation
…king issue On a pull request the bot did not open, the poll now gives the operator's request a tracking issue in the dispatch repository, because the dispatch workflow refuses triage and research runs whose item is a pull request (bootc-dev/bootc#2571 hit this). The run takes that issue as its item and answers there; the claim on the pull request records it once the run is dispatched, so later comments are quoted on the same issue. A `/bot` or `@BOT` line asking for research or an investigation gets a `research` run in place of `triage`. Only a public repository's comments are copied to the tracker, so a private source is never published by it. Upstream admins can edit the bot's claims, so a mapped issue is reused only when it is open, in the tracker, opened by the bot and titled for this pull request; one that is gone is replaced. Verified with the CI fmt, clippy, test and CLI commands; nothing was run against live GitHub. Generated-by: AI
There was a problem hiding this comment.
VERDICT: CHANGES — tracking can disclose private pull-request comments.
Reviewed admitted head: e4df253d017aca49aa4901a5fbc42a75075da53b (against merge base 60cfeeecc828c65d7153646e4ffd1a714cf9d2b4).
-
blocker —
crates/board-forge/src/poll/comments.rs:779–820: Creating or updating a tracking issue copies the operator's comments and the source PR URL intodispatch_repowithout checking either repository's visibility.operatorCommentsaccepts repository and organization scopes, including private repositories accessible to the polling token; an organization wildcard can also acquire private repositories later. With a public dispatch repository, an ordinary operator comment on somebody else's private PR now publishes its contents publicly, even without an explicit bot request. This is the worst new outcome of this change, and neither scope validation nor the mapping's author/title checks prevent it. Fail closed before quoting private/internal source material into a less restricted repository (or explicitly restrict this feature to verified public sources), including the reuse path; add negative coverage for private source/public tracker. -
important —
crates/board-forge/src/poll/comments.rs:791–792: A missing mapped issue propagates the GET error instead of treating the mapping as unusable. Deleting the tracking issue, or an upstream administrator editing the bot's claim to name a nonexistent issue, makes every subsequent request reuse that broken mapping. Each request is retried three times and then marked handled without ever dispatching. Treat a definitive 404 as an invalid mapping and create a replacement, while keeping authentication and transient failures distinguishable. Cover a deleted mapping and subsequent comments. -
important —
crates/board-forge/src/poll/comments.rs:717–721: The new pre-dispatch claim rewrite can permanently consume a request without starting its run. If issue creation succeeds but this PATCH fails (for example a transient API error), the original winning claim still listscommentswithoutrefused;handled()consequently treats them as completed on the next pass, although dispatch was never reached. Persist a recoverable pre-dispatch state or otherwise make this failure retryable, and cover failure of this PATCH specifically.
Review was static; no existing test suites, formatters, linters, or CI results were run or consulted.
|
Fix round 1 of 2 for Generated-by: https://github.com/cgwalters/#llms |
|
Fix round 1 of 2 for Generated-by: https://github.com/cgwalters/#llms |
e4df253 to
eedfbdf
Compare
There was a problem hiding this comment.
VERDICT: APPROVE
Reviewed admitted head eedfbdfd1880344a0e389b6f98d8d0a836729961 against merge base 60cfeeecc828c65d7153646e4ffd1a714cf9d2b4 of origin/main. No blocker found.
Follow-ups
- [important]
crates/board-forge/src/poll/comments.rs:724–731, 848–860: an ambiguous failure of the issue-creation POST is treated as a refused attempt, even when GitHub may already have created the issue. Because its number was never recorded, the next attempt opens another issue; repeated lost responses can leave three tracking issues for one request and exhaust retries without dispatching it. Consider recovering an existing matching issue before retrying creation, and cover a server-side creation followed by a lost/error response.
The routing change can publish operator comments and start a run against a tracker issue. The new public-repository check blocks copying private/internal PR comments through this path; reuse requires an open, bot-authored issue in the configured tracker with the source-specific title, rather than trusting an upstream-editable claim alone. Dispatch and request budgets remain in place, and the change does not authorize executing the upstream PR's code.
Read-only source/diff review only; no test suites, formatters, linters, or CI-result lookups were run.
On a pull request the bot did not open, the poll now gives the operator's request a tracking issue in the dispatch repository, because the dispatch workflow refuses triage and research runs whose item is a pull request (bootc-dev/bootc#2571 hit this). The run takes that issue as its item and answers there. The claim on the pull request records the issue and links to it, so later comments are quoted on the same issue. The bot's own pull requests still get fix rounds, and a
/botor@BOTline asking for research or an investigation gets aresearchrun in place oftriage.Reuse trusts no claim on its face. Upstream admins can edit the bot's comments, so a mapped issue is reused only when it is open, is in the tracker, was opened by the bot and has this pull request's title. Otherwise a new issue is opened. This stops a forged claim from pointing a run at some other tracker issue.
Verified:
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked, the three CIcargo runcommands andagentic-job handback scanall exited 0. Nothing was run against live GitHub.Left unverified: whether the bot's token can open issues in the tracker, and whether a run on the tracker issue can read the upstream pull request.
Self-review: 1 pass, no blocker. Afterwards I added the check that a reused issue is still in the tracker, which catches a transferred issue. Open follow-ups:
operatorCommentspaired with a public tracker would publish them.researchis picked by keyword. "no research needed" on a line addressed to the bot still counts.Closes #106