hive-forge: paginate no-reviewer comment fetch (argus nit on #507)

This commit is contained in:
damocles 2026-05-27 10:29:42 +02:00 committed by Mara
commit 8f4cb3ed29

View file

@ -173,14 +173,16 @@ fn run_no_reviewer(client: &Client, args: NoReviewerArgs) -> Result<()> {
if body.contains(&needle) { if body.contains(&needle) {
continue; continue;
} }
let comments = // Paginate so PRs with >50 comments don't yield false positives
client.get_json(&format!("/repos/{repo}/issues/{number}/comments?limit=50"))?; // (argus nit on #507). Same 1000-comment ceiling as elsewhere.
let mentioned = comments.as_array().is_some_and(|a| { let comments = client.get_json_all(
a.iter().any(|c| { &format!("/repos/{repo}/issues/{number}/comments?limit={PAGE_LIMIT}"),
c.get("body") MAX_PAGES,
.and_then(Value::as_str) )?;
.is_some_and(|body| body.contains(&needle)) let mentioned = comments.iter().any(|c| {
}) c.get("body")
.and_then(Value::as_str)
.is_some_and(|body| body.contains(&needle))
}); });
if !mentioned { if !mentioned {
missing.push(trim_item(pr)); missing.push(trim_item(pr));