share the standing-review rule between hive-forge and the controller
pr assign-reviewer behaves as before; the latest-review fold and the superseded check move to hive-types::review.
This commit is contained in:
parent
65329fb506
commit
463c5cbfcc
1 changed files with 259 additions and 115 deletions
|
|
@ -55,10 +55,8 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
|
|||
// Guard the add path only — withdrawing a request is always safe.
|
||||
// Re-requesting from someone who already reviewed dismisses that review
|
||||
// instead of no-op'ing (see the module doc-comment above).
|
||||
if let Some(existing) = super::latest_reviews(client, client.repo()?, args.number)?
|
||||
.into_iter()
|
||||
.find(|r| r.login == args.user && !r.superseded())
|
||||
{
|
||||
let reviews = super::latest_reviews(client, client.repo()?, args.number)?;
|
||||
if let Some(existing) = hive_types::review::standing(&reviews, &args.user) {
|
||||
println!(
|
||||
"not re-requesting: {} already has a standing {} review on #{} (re-requesting would dismiss it)",
|
||||
args.user, existing.state, args.number
|
||||
|
|
|
|||
Loading…
Reference in a new issue