Skip to content

Commit b07454c

Browse files
committed
server: add more logging on what happens with an event
1 parent 26330eb commit b07454c

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

src/bin/server/worker.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ impl Worker {
120120
},
121121
};
122122

123-
info!("Processing build #{}...", build_id);
123+
info!("build {}: started processing", build_id);
124124

125125
if self.seen.contains(&build_id) {
126-
info!("Ignore recently seen build id");
126+
info!("build {}: ignoring recently seen id", build_id);
127127
return Ok(());
128128
}
129129
self.seen.push_front(build_id);
@@ -143,8 +143,12 @@ impl Worker {
143143
_ => build.outcome(),
144144
};
145145

146+
debug!("build {}: current outcome: {:?}", build_id, outcome);
147+
debug!("build {}: PR number: {:?}", build_id, build.pr_number());
148+
debug!("build {}: branch name: {:?}", build_id, build.pr_number(),);
149+
146150
if !outcome.is_finished() {
147-
info!("Ignoring in-progress build.");
151+
info!("build {}: ignoring in-progress build", build_id);
148152
if let Some(idx) = self.seen.iter().position(|id| *id == build_id) {
149153
// Remove ignored builds, as we haven't reported anything for them and the
150154
// in-progress status might be misleading (e.g., leading edge of a group of
@@ -154,10 +158,17 @@ impl Worker {
154158
return Ok(());
155159
}
156160
if !outcome.is_passed() {
161+
info!("build {}: preparing report", build_id);
157162
self.report_failed(build.as_ref())?;
158163
}
159164
if build.pr_number().is_none() && build.branch_name() == "auto" {
165+
info!("build {}: learning from the log", build_id);
160166
self.learn(build.as_ref())?;
167+
} else {
168+
info!(
169+
"build {}: did not learn as it's not an auto build",
170+
build_id
171+
);
161172
}
162173

163174
Ok(())

src/ci/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub enum BuildCommit<'a> {
1616
Head { sha: &'a str },
1717
}
1818

19-
pub trait Outcome {
19+
pub trait Outcome: std::fmt::Debug {
2020
fn is_finished(&self) -> bool;
2121
fn is_passed(&self) -> bool;
2222
fn is_failed(&self) -> bool;

0 commit comments

Comments
 (0)