Require full logs everywhere

This commit is contained in:
Graham Christensen 2018-03-18 16:03:38 -04:00
parent 29fadfaa4b
commit 789986a1a0
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
3 changed files with 10 additions and 20 deletions

View file

@ -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();

View file

@ -15,7 +15,7 @@ use ofborg::acl;
#[derive(Serialize, Deserialize, Debug)]
pub struct Config {
pub runner: RunnerConfig,
pub feedback: Option<FeedbackConfig>,
pub feedback: FeedbackConfig,
pub checkout: CheckoutConfig,
pub nix: NixConfig,
pub rabbitmq: RabbitMQConfig,

View file

@ -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() {