forked from the-distro/ofborg
nixpkgs: pass in issue_ref
This commit is contained in:
parent
721276fbd1
commit
d9d3ac5fcb
|
@ -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(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -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())
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue