From 94f5d9b0ccfcf1b170ff97d95fc3ef68b5b3efa7 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 29 Nov 2017 08:24:49 -0500 Subject: [PATCH] mass rebuild: skip closed PRs, closes #9 --- ofborg/src/tasks/massrebuilder.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ofborg/src/tasks/massrebuilder.rs b/ofborg/src/tasks/massrebuilder.rs index e03ba9e..65d720d 100644 --- a/ofborg/src/tasks/massrebuilder.rs +++ b/ofborg/src/tasks/massrebuilder.rs @@ -63,6 +63,20 @@ impl worker::SimpleWorker for MassRebuildWorker { let gists = self.github.gists(); let issue = repo.issue(job.pr.number); + match issue.get() { + Ok(iss) => { + if iss.state == "closed" { + info!("Skipping {} because it is closed", job.pr.number); + return self.actions().skip(&job); + } + } + Err(e) => { + info!("Error fetching {}!", job.pr.number); + info!("E: {:?}", e); + return self.actions().skip(&job); + } + } + let mut overall_status = CommitStatus::new( repo.statuses(), job.pr.head_sha.clone(),