Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval: Only support Nixpkgs #649

Open
wants to merge 1 commit into
base: released
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions ofborg/src/tasks/eval/generic.rs

This file was deleted.

2 changes: 0 additions & 2 deletions ofborg/src/tasks/eval/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
mod generic;
mod nixpkgs;
pub mod stdenvs;

pub use self::generic::GenericStrategy;
pub use self::nixpkgs::NixpkgsStrategy;
pub use self::stdenvs::Stdenvs;
use crate::checkout::CachedProjectCo;
Expand Down
13 changes: 8 additions & 5 deletions ofborg/src/tasks/evaluate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
}
};

let mut evaluation_strategy: Box<dyn eval::EvaluationStrategy> = if job.is_nixpkgs() {
if !job.is_nixpkgs() {
error!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will only log an error, not cause the function to exit with an error; you'll need to return Err(.........); after this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this, but I'm not sure where the error should be handled. Ideally already at ofborg startup.

"Ofborg only supports nixpkgs repositories, but this is {}",
job.repo.full_name
);
}
let mut evaluation_strategy: Box<dyn eval::EvaluationStrategy> =
Box::new(eval::NixpkgsStrategy::new(
job,
&pull,
Expand All @@ -299,10 +305,7 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
&repo,
&self.gists,
self.nix.clone(),
))
} else {
Box::new(eval::GenericStrategy::new())
};
));

let prefix = get_prefix(repo.statuses(), &job.pr.head_sha)?;

Expand Down