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) {
|
||||
continue;
|
||||
}
|
||||
let comments =
|
||||
client.get_json(&format!("/repos/{repo}/issues/{number}/comments?limit=50"))?;
|
||||
let mentioned = comments.as_array().is_some_and(|a| {
|
||||
a.iter().any(|c| {
|
||||
c.get("body")
|
||||
.and_then(Value::as_str)
|
||||
.is_some_and(|body| body.contains(&needle))
|
||||
})
|
||||
// Paginate so PRs with >50 comments don't yield false positives
|
||||
// (argus nit on #507). Same 1000-comment ceiling as elsewhere.
|
||||
let comments = client.get_json_all(
|
||||
&format!("/repos/{repo}/issues/{number}/comments?limit={PAGE_LIMIT}"),
|
||||
MAX_PAGES,
|
||||
)?;
|
||||
let mentioned = comments.iter().any(|c| {
|
||||
c.get("body")
|
||||
.and_then(Value::as_str)
|
||||
.is_some_and(|body| body.contains(&needle))
|
||||
});
|
||||
if !mentioned {
|
||||
missing.push(trim_item(pr));
|
||||
|
|
|
|||
Loading…
Reference in a new issue