@@ -48,10 +48,10 @@ pub async fn handle_bors_repository_event<Client: RepositoryClient>(
48
48
ctx : Arc < BorsContext > ,
49
49
) -> anyhow:: Result < ( ) > {
50
50
let db = Arc :: clone ( & ctx. db ) ;
51
- match event {
52
- BorsRepositoryEvent :: Comment ( comment ) => {
53
- // We want to ignore comments made by this bot
54
- if let Some ( repo ) = get_repo_state ( state , & comment . repository ) {
51
+ if let Some ( repo ) = get_repo_state ( state , & event. repository ( ) ) {
52
+ match event {
53
+ BorsRepositoryEvent :: Comment ( comment ) => {
54
+ // We want to ignore comments made by this bot
55
55
if repo. client . is_comment_internal ( & comment) . await ? {
56
56
tracing:: trace!(
57
57
"Ignoring comment {comment:?} because it was authored by this bot"
@@ -81,10 +81,8 @@ pub async fn handle_bors_repository_event<Client: RepositoryClient>(
81
81
. context ( "Cannot send comment reacting to an error" ) ?;
82
82
}
83
83
}
84
- }
85
84
86
- BorsRepositoryEvent :: WorkflowStarted ( payload) => {
87
- if let Some ( _) = get_repo_state ( state, & payload. repository ) {
85
+ BorsRepositoryEvent :: WorkflowStarted ( payload) => {
88
86
let span = tracing:: info_span!(
89
87
"Workflow started" ,
90
88
repo = payload. repository. to_string( ) ,
@@ -97,9 +95,7 @@ pub async fn handle_bors_repository_event<Client: RepositoryClient>(
97
95
span. log_error ( error) ;
98
96
}
99
97
}
100
- }
101
- BorsRepositoryEvent :: WorkflowCompleted ( payload) => {
102
- if let Some ( repo) = get_repo_state ( state, & payload. repository ) {
98
+ BorsRepositoryEvent :: WorkflowCompleted ( payload) => {
103
99
let span = tracing:: info_span!(
104
100
"Workflow completed" ,
105
101
repo = payload. repository. to_string( ) ,
@@ -112,9 +108,7 @@ pub async fn handle_bors_repository_event<Client: RepositoryClient>(
112
108
span. log_error ( error) ;
113
109
}
114
110
}
115
- }
116
- BorsRepositoryEvent :: CheckSuiteCompleted ( payload) => {
117
- if let Some ( repo) = get_repo_state ( state, & payload. repository ) {
111
+ BorsRepositoryEvent :: CheckSuiteCompleted ( payload) => {
118
112
let span = tracing:: info_span!(
119
113
"Check suite completed" ,
120
114
repo = payload. repository. to_string( ) ,
0 commit comments