diff --git a/ofborg/src/outpathdiff.rs b/ofborg/src/outpathdiff.rs index 58967fa..7591bce 100644 --- a/ofborg/src/outpathdiff.rs +++ b/ofborg/src/outpathdiff.rs @@ -52,31 +52,35 @@ impl OutPathDiff { return result; } - pub fn find_before(&mut self) { + pub fn find_before(&mut self) -> bool { let x = self.run(); match x { Ok(f) => { - self.original = Some(self.parse(f)) + self.original = Some(self.parse(f)); + return true; } Err(_) => { 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 { debug!("Before is None, not bothering with After"); - return + return false; } let x = self.run(); match x { Ok(f) => { - self.current = Some(self.parse(f)) + self.current = Some(self.parse(f)); + return true; } Err(_) => { info!("Failed to find After list"); + return false; } } } diff --git a/ofborg/src/tasks/massrebuilder.rs b/ofborg/src/tasks/massrebuilder.rs index 049c8da..c240674 100644 --- a/ofborg/src/tasks/massrebuilder.rs +++ b/ofborg/src/tasks/massrebuilder.rs @@ -109,7 +109,13 @@ impl worker::SimpleWorker for MassRebuildWorker { 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( "Fetching PR", @@ -155,7 +161,13 @@ impl worker::SimpleWorker for MassRebuildWorker { 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); overall_status.set_with_description(