Report failures to enumerate output paths

This commit is contained in:
Graham Christensen 2017-11-25 17:38:49 -05:00
parent 7a3b7d0fa0
commit 79fbe3fd3a
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 23 additions and 7 deletions

View file

@ -52,31 +52,35 @@ impl OutPathDiff {
return result; return result;
} }
pub fn find_before(&mut self) { pub fn find_before(&mut self) -> bool {
let x = self.run(); let x = self.run();
match x { match x {
Ok(f) => { Ok(f) => {
self.original = Some(self.parse(f)) self.original = Some(self.parse(f));
return true;
} }
Err(_) => { Err(_) => {
info!("Failed to find Before list"); info!("Failed to find Before list");
return false;
} }
} }
} }
pub fn find_after(&mut self) { pub fn find_after(&mut self) -> bool {
if self.original == None { if self.original == None {
debug!("Before is None, not bothering with After"); debug!("Before is None, not bothering with After");
return return false;
} }
let x = self.run(); let x = self.run();
match x { match x {
Ok(f) => { Ok(f) => {
self.current = Some(self.parse(f)) self.current = Some(self.parse(f));
return true;
} }
Err(_) => { Err(_) => {
info!("Failed to find After list"); info!("Failed to find After list");
return false;
} }
} }
} }

View file

@ -109,7 +109,13 @@ impl worker::SimpleWorker for MassRebuildWorker {
hubcaps::statuses::State::Pending hubcaps::statuses::State::Pending
); );
rebuildsniff.find_before(); if !rebuildsniff.find_before() {
overall_status.set_with_description(
format!("Failed to enumerate outputs of {}", &target_branch).as_ref(),
hubcaps::statuses::State::Failure
);
return self.actions().skip(&job);
}
overall_status.set_with_description( overall_status.set_with_description(
"Fetching PR", "Fetching PR",
@ -155,7 +161,13 @@ impl worker::SimpleWorker for MassRebuildWorker {
hubcaps::statuses::State::Pending hubcaps::statuses::State::Pending
); );
rebuildsniff.find_after(); if !rebuildsniff.find_after() {
overall_status.set_with_description(
format!("Failed to enumerate outputs after merging to ", &target_branch).as_ref(),
hubcaps::statuses::State::Failure
);
return self.actions().skip(&job);
}
println!("Got path: {:?}, building", refpath); println!("Got path: {:?}, building", refpath);
overall_status.set_with_description( overall_status.set_with_description(