Watch
0
0
Fork
You've already forked hyperhive
0

hive-forge: pr assign-reviewer --remove fails when the reviewer is still listed afterwards

This commit is contained in:
damocles 2026-10-26 17:03:59 +01:00 • committed by mara
commit ff4fd93f81

View file

@ -46,6 +46,27 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
.api()
.repo_delete_pull_review_requests(owner, name, idx, body)
.send()?;
// The forge answers success even when there was no pending request
// to remove (the reviewer already submitted a review), so read the
// list back instead of claiming a withdrawal that did not happen.
let pull = client
.api()
.repo_get_pull_request(owner, name, idx)
.send()?;
let still_listed = pull
.requested_reviewers
.as_deref()
.unwrap_or_default()
.iter()
.any(|u| u.login.as_deref() == Some(args.user.as_str()));
if still_listed {
anyhow::bail!(
"{} is still listed as a requested reviewer on #{} after the withdraw call \
(the forge keeps a reviewer who already reviewed in that list)",
args.user,
args.number
);
}
println!(
"review request withdrawn: {} on #{}",
args.user, args.number