Skip to content

Commit

Permalink
Ignore r? in unconfigured repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Nov 1, 2022
1 parent 0bd2fe0 commit 9684e9f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/handlers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::config::{self, Config, ConfigurationError};
use crate::github::{Event, GithubClient, IssueCommentAction, IssuesAction, IssuesEvent};
use octocrab::Octocrab;
use parser::command::{Command, Input};
use parser::command::{assign::AssignCommand, Command, Input};
use std::fmt;
use std::sync::Arc;
use tracing as log;
Expand Down Expand Up @@ -208,6 +208,15 @@ macro_rules! command_handlers {
let config = match config {
Ok(config) => config,
Err(e @ ConfigurationError::Missing) => {
// r? is conventionally used to mean "hey, can you review"
// even if the repo doesn't have a triagebot.toml. In that
// case, just ignore it.
if commands
.iter()
.all(|cmd| matches!(cmd, Command::Assign(Ok(AssignCommand::ReviewName { .. }))))
{
return;
}
return errors.push(HandlerError::Message(e.to_string()));
}
Err(e @ ConfigurationError::Toml(_)) => {
Expand Down

0 comments on commit 9684e9f

Please sign in to comment.