nixpkgs: pass in issue_ref

This commit is contained in:
Graham Christensen 2019-03-22 13:32:34 -04:00
parent 721276fbd1
commit d9d3ac5fcb
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
2 changed files with 9 additions and 6 deletions

View file

@ -1,3 +1,4 @@
use hubcaps::issues::IssueRef;
use ofborg::checkout::CachedProjectCo; use ofborg::checkout::CachedProjectCo;
use ofborg::commitstatus::CommitStatus; use ofborg::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker; use ofborg::evalchecker::EvalChecker;
@ -5,14 +6,16 @@ use ofborg::message::buildjob::BuildJob;
use std::path::Path; use std::path::Path;
use tasks::eval::{EvaluationStrategy, StepResult}; use tasks::eval::{EvaluationStrategy, StepResult};
pub struct NixpkgsStrategy {} pub struct NixpkgsStrategy<'a> {
impl NixpkgsStrategy { issue_ref: &'a IssueRef<'a>,
pub fn new() -> NixpkgsStrategy { }
Self {} impl<'a> NixpkgsStrategy<'a> {
pub fn new(issue_ref: &'a IssueRef) -> NixpkgsStrategy<'a> {
Self { issue_ref }
} }
} }
impl EvaluationStrategy for NixpkgsStrategy { impl<'a> EvaluationStrategy for NixpkgsStrategy<'a> {
fn pre_clone(&mut self) -> StepResult<()> { fn pre_clone(&mut self) -> StepResult<()> {
Ok(()) Ok(())
} }

View file

@ -130,7 +130,7 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for EvaluationWorker<E>
let auto_schedule_build_archs: Vec<systems::System>; let auto_schedule_build_archs: Vec<systems::System>;
let mut evaluation_strategy: Box<eval::EvaluationStrategy> = if job.is_nixpkgs() { let mut evaluation_strategy: Box<eval::EvaluationStrategy> = if job.is_nixpkgs() {
Box::new(eval::NixpkgsStrategy::new()) Box::new(eval::NixpkgsStrategy::new(&issue_ref))
} else { } else {
Box::new(eval::GenericStrategy::new()) Box::new(eval::GenericStrategy::new())
}; };