hive-forge: paginate no-reviewer comment fetch (argus nit on #507)
This commit is contained in:
parent
703018106a
commit
8f4cb3ed29
1 changed files with 10 additions and 8 deletions
|
|
@ -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));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue