From 8424c32478e408c82ddb26039de5cb4588727b97 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Thu, 21 May 2020 20:52:01 +0200 Subject: [PATCH] add structured logging to evaluation filter --- ofborg/src/tasks/evaluationfilter.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ofborg/src/tasks/evaluationfilter.rs b/ofborg/src/tasks/evaluationfilter.rs index 23b52a8..6735e89 100644 --- a/ofborg/src/tasks/evaluationfilter.rs +++ b/ofborg/src/tasks/evaluationfilter.rs @@ -3,7 +3,7 @@ use crate::ghevent; use crate::message::{evaluationjob, Pr, Repo}; use crate::worker; -use tracing::info; +use tracing::{debug_span, info}; pub struct EvaluationFilterWorker { acl: acl::ACL, @@ -30,6 +30,9 @@ impl worker::SimpleWorker for EvaluationFilterWorker { } fn consumer(&mut self, job: &ghevent::PullRequestEvent) -> worker::Actions { + let span = debug_span!("job", pr = ?job.number); + let _enter = span.enter(); + if !self.acl.is_repo_eligible(&job.repository.full_name) { info!("Repo not authorized ({})", job.repository.full_name); return vec![worker::Action::Ack];