From 789986a1a0841f1c75d747a2d31f091456d19909 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:03:38 -0400 Subject: [PATCH] Require full logs everywhere --- ofborg/src/bin/builder.rs | 18 ++++++++---------- ofborg/src/config.rs | 2 +- ofborg/src/tasks/build.rs | 10 +--------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 7c2475f..016c66b 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -25,18 +25,16 @@ fn main() { let cloner = checkout::cached_cloner(Path::new(&cfg.checkout.root)); let nix = cfg.nix(); - let full_logs: bool = match &cfg.feedback { - &Some(ref feedback) => feedback.full_logs, - &None => { - warn!("Please define feedback.full_logs in your configuration to true or false!"); - warn!("feedback.full_logs when true will cause the full build log to be sent back"); - warn!("to the server, and be viewable by everyone."); - warn!("I strongly encourage everybody turn this on!"); - false - } + if &cfg.feedback.full_logs != Some(true) { + warn!("Please define feedback.full_logs in your configuration to true!"); + warn!("feedback.full_logs when true will cause the full build log to be sent back"); + warn!("to the server, and be viewable by everyone."); + warn!(""); + warn!("Builders are no longer allowed to operate with this off"); + warn!("so your builder will no longer start."); + panic!(); }; - let mut session = easyamqp::session_from_config(&cfg.rabbitmq).unwrap(); let mut channel = session.open_channel(1).unwrap(); channel.basic_prefetch(1).unwrap(); diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 2b81fdd..60613d0 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -15,7 +15,7 @@ use ofborg::acl; #[derive(Serialize, Deserialize, Debug)] pub struct Config { pub runner: RunnerConfig, - pub feedback: Option, + pub feedback: FeedbackConfig, pub checkout: CheckoutConfig, pub nix: NixConfig, pub rabbitmq: RabbitMQConfig, diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index dff6c82..2a96337 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -23,7 +23,6 @@ pub struct BuildWorker { nix: nix::Nix, system: String, identity: String, - full_logs: bool, } impl BuildWorker { @@ -32,14 +31,12 @@ impl BuildWorker { nix: nix::Nix, system: String, identity: String, - full_logs: bool, ) -> BuildWorker { return BuildWorker { cloner: cloner, nix: nix, system: system, identity: identity, - full_logs: full_logs, }; } @@ -346,20 +343,15 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { let mut snippet_log = VecDeque::with_capacity(10); - if !self.full_logs { - actions.log_line("Full logs are disabled on this builder."); - } for line in spawned.lines().iter() { - if self.full_logs { - actions.log_line(&line); - } if snippet_log.len() >= 10 { snippet_log.pop_front(); } snippet_log.push_back(line.to_owned()); + actions.log_line(&line); } let success = match spawned.wait() {