If output path diffing fails in the After step, upload the error log
This commit is contained in:
parent
7c11535ef0
commit
55e8e42d1f
|
@ -9,7 +9,6 @@ use std::io::BufReader;
|
|||
use std::path::PathBuf;
|
||||
use ofborg::nix;
|
||||
use std::io::Write;
|
||||
use ofborg::evalchecker::EvalChecker;
|
||||
|
||||
pub struct OutPathDiff {
|
||||
path: PathBuf,
|
||||
|
@ -66,21 +65,21 @@ impl OutPathDiff {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn find_after(&mut self) -> bool {
|
||||
pub fn find_after(&mut self) -> Result<bool, File> {
|
||||
if self.original == None {
|
||||
debug!("Before is None, not bothering with After");
|
||||
return false;
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
let x = self.run();
|
||||
match x {
|
||||
Ok(f) => {
|
||||
self.current = Some(self.parse(f));
|
||||
return true;
|
||||
return Ok(true);
|
||||
}
|
||||
Err(_) => {
|
||||
Err(e) => {
|
||||
info!("Failed to find After list");
|
||||
return false;
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,8 +130,9 @@ impl OutPathDiff {
|
|||
}
|
||||
|
||||
fn execute(&self) -> Result<File, File>{
|
||||
let checker = EvalChecker::new("out-paths",
|
||||
self.nix.safely(
|
||||
"nix-env",
|
||||
&self.path,
|
||||
vec![
|
||||
String::from("-f"),
|
||||
String::from(".gc-of-borg-out-list.nix"),
|
||||
|
@ -141,8 +141,7 @@ impl OutPathDiff {
|
|||
String::from("--out-path"),
|
||||
String::from("--show-trace"),
|
||||
],
|
||||
self.nix.clone()
|
||||
);
|
||||
checker.execute(&self.path)
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,13 @@ impl worker::SimpleWorker for MassRebuildWorker {
|
|||
hubcaps::statuses::State::Pending
|
||||
);
|
||||
|
||||
if !rebuildsniff.find_after() {
|
||||
if let Err(mut output) = rebuildsniff.find_after() {
|
||||
overall_status.set_url(make_gist(
|
||||
&gists,
|
||||
"Output path comparison".to_owned(),
|
||||
Some("".to_owned()),
|
||||
file_to_str(&mut output),
|
||||
));
|
||||
overall_status.set_with_description(
|
||||
format!("Failed to enumerate outputs after merging to {}", &target_branch).as_ref(),
|
||||
hubcaps::statuses::State::Failure
|
||||
|
|
Loading…
Reference in a new issue