diff --git a/ofborg/src/tasks/eval/nixpkgs.rs b/ofborg/src/tasks/eval/nixpkgs.rs index 27498c9..7fad199 100644 --- a/ofborg/src/tasks/eval/nixpkgs.rs +++ b/ofborg/src/tasks/eval/nixpkgs.rs @@ -3,8 +3,9 @@ use ofborg::checkout::CachedProjectCo; use ofborg::commitstatus::CommitStatus; use ofborg::evalchecker::EvalChecker; use ofborg::message::buildjob::BuildJob; +use ofborg::tasks::eval::{EvaluationStrategy, StepResult}; +use ofborg::tasks::evaluate::update_labels; use std::path::Path; -use tasks::eval::{EvaluationStrategy, StepResult}; pub struct NixpkgsStrategy<'a> { issue_ref: &'a IssueRef<'a>, @@ -13,10 +14,26 @@ impl<'a> NixpkgsStrategy<'a> { pub fn new(issue_ref: &'a IssueRef) -> NixpkgsStrategy<'a> { Self { issue_ref } } + + fn tag_from_title(&self) { + let darwin = self + .issue_ref + .get() + .map(|iss| { + iss.title.to_lowercase().contains("darwin") + || iss.title.to_lowercase().contains("macos") + }) + .unwrap_or(false); + + if darwin { + update_labels(&self.issue_ref, &[String::from("6.topic: darwin")], &[]); + } + } } impl<'a> EvaluationStrategy for NixpkgsStrategy<'a> { fn pre_clone(&mut self) -> StepResult<()> { + self.tag_from_title(); Ok(()) } diff --git a/ofborg/src/tasks/evaluate.rs b/ofborg/src/tasks/evaluate.rs index 45670e9..6f70fe6 100644 --- a/ofborg/src/tasks/evaluate.rs +++ b/ofborg/src/tasks/evaluate.rs @@ -68,20 +68,6 @@ impl EvaluationWorker { evaluationjob::Actions {} } - fn tag_from_title(&self, issue: &hubcaps::issues::IssueRef) { - let darwin = issue - .get() - .map(|iss| { - iss.title.to_lowercase().contains("darwin") - || iss.title.to_lowercase().contains("macos") - }) - .unwrap_or(false); - - if darwin { - update_labels(&issue, &[String::from("6.topic: darwin")], &[]); - } - } - fn tag_from_paths(&self, issue: &hubcaps::issues::IssueRef, paths: &[String]) { let mut tagger = PathsTagger::new(self.tag_paths.clone()); @@ -185,8 +171,6 @@ impl worker::SimpleWorker for EvaluationWorker } }; - self.tag_from_title(&issue_ref); - let mut overall_status = CommitStatus::new( repo.statuses(), job.pr.head_sha.clone(), @@ -197,6 +181,13 @@ impl worker::SimpleWorker for EvaluationWorker overall_status.set_with_description("Starting", hubcaps::statuses::State::Pending); + if self + .handle_strategy_err(evaluation_strategy.pre_clone(), &gists, &mut overall_status) + .is_err() + { + return self.actions().skip(&job); + } + let project = self .cloner .project(&job.repo.full_name, job.repo.clone_url.clone());