From 9c1df0f869a617ce4c62f3a5a475c965b8879d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 6 Jun 2025 14:18:08 +0200 Subject: [PATCH] Fix self-assign fast path We were checking the author of the PR, rather than the author of the comment. --- src/handlers/assign.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/handlers/assign.rs b/src/handlers/assign.rs index 12321b67a..699b3b0ed 100644 --- a/src/handlers/assign.rs +++ b/src/handlers/assign.rs @@ -397,6 +397,7 @@ async fn determine_assignee( &teams, config, &event.issue, + &event.issue.user.login, &[name], ) .await @@ -420,6 +421,7 @@ async fn determine_assignee( &teams, config, &event.issue, + &event.issue.user.login, &candidates, ) .await @@ -461,6 +463,7 @@ async fn determine_assignee( &teams, config, &event.issue, + &event.issue.user.login, fallback, ) .await @@ -645,6 +648,7 @@ pub(super) async fn handle_command( &teams, config, issue, + &event.user().login, &[assignee.to_string()], ) .await @@ -871,11 +875,12 @@ async fn find_reviewer_from_names( teams: &Teams, config: &AssignConfig, issue: &Issue, + requested_by: &str, names: &[String], ) -> Result { // Fast path for self-assign, which is always allowed. if let [name] = names { - if is_self_assign(&name, &issue.user.login) { + if is_self_assign(&name, requested_by) { return Ok(ReviewerSelection::from_name(name.clone())); } }