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::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker;
@ -5,14 +6,16 @@ use ofborg::message::buildjob::BuildJob;
use std::path::Path;
use tasks::eval::{EvaluationStrategy, StepResult};
pub struct NixpkgsStrategy {}
impl NixpkgsStrategy {
pub fn new() -> NixpkgsStrategy {
Self {}
pub struct NixpkgsStrategy<'a> {
issue_ref: &'a IssueRef<'a>,
}
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<()> {
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 mut evaluation_strategy: Box<eval::EvaluationStrategy> = if job.is_nixpkgs() {
Box::new(eval::NixpkgsStrategy::new())
Box::new(eval::NixpkgsStrategy::new(&issue_ref))
} else {
Box::new(eval::GenericStrategy::new())
};