Don't attempt to build a job with zero defined attrs

This commit is contained in:
Graham Christensen 2018-02-03 20:26:51 -05:00
parent 28d2d3c28d
commit c1bfe1b01c
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C

View file

@ -105,6 +105,10 @@ impl<'a, 'b> JobActions<'a, 'b> {
self.tell(worker::Action::Ack); self.tell(worker::Action::Ack);
} }
pub fn nothing_to_do(&mut self) {
self.tell(worker::Action::Ack);
}
pub fn merge_failed(&mut self) { pub fn merge_failed(&mut self) {
let msg = buildresult::BuildResult { let msg = buildresult::BuildResult {
repo: self.job.repo.clone(), repo: self.job.repo.clone(),
@ -232,6 +236,11 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker {
) { ) {
let mut actions = self.actions(&job, notifier); let mut actions = self.actions(&job, notifier);
if job.attrs.len() == 0 {
actions.nothing_to_do();
return;
}
info!("Working on {}", job.pr.number); info!("Working on {}", job.pr.number);
let project = self.cloner.project( let project = self.cloner.project(
job.repo.full_name.clone(), job.repo.full_name.clone(),