Skip to content

Commit 4cb261c

Browse files
Merge pull request #1666 from ehuss/ignore-r-unconfigured
Ignore r? in unconfigured repositories
2 parents 0bd2fe0 + 9684e9f commit 4cb261c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/handlers.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::config::{self, Config, ConfigurationError};
22
use crate::github::{Event, GithubClient, IssueCommentAction, IssuesAction, IssuesEvent};
33
use octocrab::Octocrab;
4-
use parser::command::{Command, Input};
4+
use parser::command::{assign::AssignCommand, Command, Input};
55
use std::fmt;
66
use std::sync::Arc;
77
use tracing as log;
@@ -208,6 +208,15 @@ macro_rules! command_handlers {
208208
let config = match config {
209209
Ok(config) => config,
210210
Err(e @ ConfigurationError::Missing) => {
211+
// r? is conventionally used to mean "hey, can you review"
212+
// even if the repo doesn't have a triagebot.toml. In that
213+
// case, just ignore it.
214+
if commands
215+
.iter()
216+
.all(|cmd| matches!(cmd, Command::Assign(Ok(AssignCommand::ReviewName { .. }))))
217+
{
218+
return;
219+
}
211220
return errors.push(HandlerError::Message(e.to_string()));
212221
}
213222
Err(e @ ConfigurationError::Toml(_)) => {

0 commit comments

Comments
 (0)