Merge pull request #444 from cole-h/2018

2018-ification
This commit is contained in:
Graham Christensen 2020-04-01 07:56:46 -04:00 committed by GitHub
commit 7be15ba6d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 740 additions and 764 deletions

View file

@ -1,15 +1,17 @@
# Generated by carnix 0.9.2: carnix generate-nix --src .
# Generated by carnix 0.10.0: carnix generate-nix --src .
{ lib, buildPlatform, buildRustCrate, buildRustCrateHelpers, cratesIO, fetchgit }:
with buildRustCrateHelpers;
let inherit (lib.lists) fold;
inherit (lib.attrsets) recursiveUpdate;
in
let crates = cratesIO // rec {
rec {
crates = cratesIO // rec {
# amqp-0.1.0
crates.amqp."0.1.0" = deps: { features?(features_.amqp."0.1.0" deps {}) }: buildRustCrate {
crateName = "amqp";
version = "0.1.0";
description = "AMQP/RabbitMQ protocol client";
authors = [ "Andrii Dmytrenko <andrey@reevoo.com>" ];
src = fetchgit {
url = "https://github.com/grahamc/rust-amqp.git";
@ -30,15 +32,15 @@ let crates = cratesIO // rec {
features_.amqp."0.1.0" = deps: f: updateFeatures f (rec {
amq_proto."${deps.amqp."0.1.0".amq_proto}".default = true;
amqp = fold recursiveUpdate {} [
{ "0.1.0".default = (f.amqp."0.1.0".default or true); }
{ "0.1.0".openssl =
(f.amqp."0.1.0".openssl or false) ||
{ "0.1.0"."openssl" =
(f.amqp."0.1.0"."openssl" or false) ||
(f.amqp."0.1.0".tls or false) ||
(amqp."0.1.0"."tls" or false); }
{ "0.1.0".tls =
(f.amqp."0.1.0".tls or false) ||
{ "0.1.0"."tls" =
(f.amqp."0.1.0"."tls" or false) ||
(f.amqp."0.1.0".default or false) ||
(amqp."0.1.0"."default" or false); }
{ "0.1.0".default = (f.amqp."0.1.0".default or true); }
];
env_logger."${deps.amqp."0.1.0".env_logger}".default = true;
log."${deps.amqp."0.1.0".log}".default = true;
@ -61,6 +63,7 @@ let crates = cratesIO // rec {
crates.hubcaps."0.3.16" = deps: { features?(features_.hubcaps."0.3.16" deps {}) }: buildRustCrate {
crateName = "hubcaps";
version = "0.3.16";
description = "Rust interface for Github";
authors = [ "softprops <d.tangren@gmail.com>" ];
src = fetchgit {
url = "https://github.com/grahamc/hubcaps.git";
@ -108,6 +111,7 @@ let crates = cratesIO // rec {
crateName = "ofborg";
version = "0.1.8";
authors = [ "Graham Christensen <graham@grahamc.com>" ];
edition = "2018";
src = include [ "Cargo.toml" "Cargo.lock" "src" "test-srcs" "build.rs" ] ./.;
build = "build.rs";
dependencies = mapFeatures features ([
@ -181,9 +185,8 @@ let crates = cratesIO // rec {
# end
}; in
};
rec {
ofborg = crates.crates.ofborg."0.1.8" deps;
__all = [ (ofborg {}) ];
deps.aho_corasick."0.5.3" = {

View file

@ -4,7 +4,7 @@ version = "0.1.8"
authors = ["Graham Christensen <graham@grahamc.com>"]
include = ["Cargo.toml", "Cargo.lock", "src", "test-srcs", "build.rs"]
build = "build.rs"
edition = "2018"
[dependencies]
either = "1.4.0"

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
use ofborg::systems::System;
use crate::systems::System;
pub struct ACL {
trusted_users: Vec<String>,

View file

@ -1,18 +1,8 @@
use std::thread;
use std::collections::HashMap;
use std::io;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Read;
use std::process::Child;
use std::process::Command;
use std::process::ExitStatus;
use std::process::Stdio;
use std::sync::mpsc;
use std::sync::mpsc::sync_channel;
use std::sync::mpsc::{Receiver, SyncSender};
use std::thread::JoinHandle;
use std::io::{self, BufRead, BufReader, Read};
use std::process::{Child, Command, ExitStatus, Stdio};
use std::sync::mpsc::{self, sync_channel, Receiver, SyncSender};
use std::thread::{self, JoinHandle};
// Specifically set to fall under 1/2 of the AMQP library's
// SyncSender limitation.

View file

@ -1,22 +1,12 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
extern crate hubcaps;
extern crate hyper;
extern crate hyper_native_tls;
use std::env;
use ofborg::commentparser;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::message::buildjob;
use ofborg::message::{Pr, Repo};
use ofborg::notifyworker;
use ofborg::notifyworker::NotificationReceiver;
use ofborg::message::{buildjob, Pr, Repo};
use ofborg::notifyworker::{self, NotificationReceiver};
use ofborg::worker;
use std::env;
fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log();

View file

@ -1,19 +1,12 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
#[macro_use]
extern crate log;
use std::env;
use amqp::Basic;
use log::{log, warn};
use ofborg::checkout;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
use ofborg::easyamqp::{self, TypedWrappers};
use ofborg::notifyworker;
use ofborg::tasks;
use std::env;
use std::path::Path;
fn main() {

View file

@ -1,21 +1,11 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
extern crate hubcaps;
extern crate hyper;
extern crate hyper_native_tls;
use std::env;
use amqp::Basic;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
use ofborg::easyamqp::{self, TypedWrappers};
use ofborg::tasks;
use ofborg::worker;
use std::env;
fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log();

View file

@ -1,21 +1,11 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
extern crate hubcaps;
extern crate hyper;
extern crate hyper_native_tls;
use std::env;
use amqp::Basic;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
use ofborg::easyamqp::{self, TypedWrappers};
use ofborg::tasks;
use ofborg::worker;
use std::env;
fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log();

View file

@ -1,21 +1,11 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
extern crate hubcaps;
extern crate hyper;
extern crate hyper_native_tls;
use std::env;
use amqp::Basic;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
use ofborg::easyamqp::{self, TypedWrappers};
use ofborg::tasks;
use ofborg::worker;
use std::env;
fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log();

View file

@ -1,16 +1,11 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
use ofborg::config;
use ofborg::easyamqp::{self, TypedWrappers};
use ofborg::tasks;
use ofborg::worker;
use std::env;
use std::path::PathBuf;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
use ofborg::tasks;
use ofborg::worker;
fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log();

View file

@ -1,19 +1,13 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
use ofborg::config;
use ofborg::easyamqp;
use ofborg::message::{buildjob, Pr, Repo};
use ofborg::notifyworker;
use ofborg::tasks::build;
use std::env;
use std::thread;
use std::time::Duration;
use ofborg::message::{Pr, Repo};
use ofborg::config;
use ofborg::easyamqp;
use ofborg::message::buildjob;
use ofborg::notifyworker;
use ofborg::tasks::build;
fn main() {
let cfg = config::load(env::args().nth(1).unwrap().as_ref());
ofborg::setup_log();

View file

@ -1,21 +1,15 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
extern crate sys_info;
use amqp::Basic;
use ofborg::checkout;
use ofborg::config;
use ofborg::easyamqp::{self, TypedWrappers};
use ofborg::stats;
use ofborg::tasks;
use ofborg::worker;
use std::env;
use std::path::Path;
use std::process;
use amqp::Basic;
use ofborg::easyamqp;
use ofborg::easyamqp::TypedWrappers;
use ofborg::stats;
use ofborg::worker;
fn main() {
let memory_info = sys_info::mem_info().expect("Unable to get memory information from OS");

View file

@ -1,11 +1,7 @@
extern crate amqp;
extern crate env_logger;
extern crate ofborg;
use std::env;
use ofborg::config;
use ofborg::nix;
use std::env;
use std::fs::File;
use std::io::Read;
use std::path::Path;

View file

@ -1,14 +1,9 @@
extern crate amqp;
extern crate hyper;
extern crate ofborg;
use ofborg::{config, easyamqp, stats, tasks, worker};
use std::env;
use amqp::Basic;
use hyper::server::{Request, Response, Server};
use ofborg::easyamqp::TypedWrappers;
use ofborg::{config, easyamqp, stats, tasks, worker};
use std::env;
use std::thread;
fn main() {

View file

@ -1,8 +1,6 @@
use md5;
use ofborg::clone;
use ofborg::clone::GitClonable;
use std::ffi::OsStr;
use std::ffi::OsString;
use crate::clone::{self, GitClonable};
use std::ffi::{OsStr, OsString};
use std::fs;
use std::io::{Error, ErrorKind};
use std::path::{Path, PathBuf};
@ -253,7 +251,7 @@ impl clone::GitClonable for CachedProject {
#[cfg(test)]
mod tests {
use super::*;
use ofborg::test_scratch::TestScratch;
use crate::test_scratch::TestScratch;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

View file

@ -1,4 +1,5 @@
use fs2::FileExt;
use std::ffi::OsStr;
use std::fs;
use std::io::{Error, ErrorKind};

View file

@ -16,11 +16,16 @@ pub fn parse(text: &str) -> Option<Vec<Instruction>> {
}
}
named!(normal_token(CompleteStr) -> CompleteStr,
verify!(take_while1!(|c: char| c.is_ascii_graphic()),
|s: CompleteStr| !s.0.eq_ignore_ascii_case("@grahamcofborg"))
named!(
normal_token(CompleteStr) -> CompleteStr,
verify!(
take_while1!(|c: char| c.is_ascii_graphic()),
|s: CompleteStr| !s.0.eq_ignore_ascii_case("@grahamcofborg")
)
);
named!(parse_line_impl(CompleteStr) -> Option<Vec<Instruction>>, alt!(
named!(
parse_line_impl(CompleteStr) -> Option<Vec<Instruction>>,
alt!(
do_parse!(
res: ws!(many1!(ws!(preceded!(
alt!(tag_no_case!("@grahamcofborg") | tag_no_case!("@ofborg")),
@ -41,12 +46,11 @@ named!(parse_line_impl(CompleteStr) -> Option<Vec<Instruction>>, alt!(
// commands couldn't be handled?
value!(None, many_till!(take!(1), tag_no_case!("@grahamcofborg")))
)
)))) >>
eof!() >>
(Some(res.into_iter().filter_map(|x| x).collect()))
) |
value!(None)
));
)))) >> eof!()
>> (Some(res.into_iter().filter_map(|x| x).collect()))
) | value!(None)
)
);
pub fn parse_line(text: &str) -> Option<Vec<Instruction>> {
match parse_line_impl(CompleteStr(text)) {

View file

@ -1,8 +1,3 @@
extern crate amqp;
extern crate env_logger;
use hubcaps;
pub struct CommitStatus<'a> {
api: hubcaps::statuses::Statuses<'a>,
sha: String,

View file

@ -1,10 +1,11 @@
use crate::acl;
use crate::nix::Nix;
use hubcaps::{Credentials, Github, InstallationTokenGenerator, JWTCredentials};
use hyper::net::HttpsConnector;
use hyper::Client;
use hyper_native_tls::NativeTlsClient;
use nix::Nix;
use ofborg::acl;
use serde_json;
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;

View file

@ -1,7 +1,7 @@
use amqp;
use crate::config::RabbitMQConfig;
use crate::ofborg;
use amqp::Basic;
use ofborg;
use ofborg::config::RabbitMQConfig;
pub struct ConsumeConfig {
/// Specifies the name of the queue to consume from.

View file

@ -1,7 +1,5 @@
extern crate amqp;
extern crate env_logger;
use crate::nix;
use ofborg::nix;
use std::fs::File;
use std::path::Path;

View file

@ -1,4 +1,4 @@
use ofborg::ghevent::{Comment, Issue, Repository};
use crate::ghevent::{Comment, Issue, Repository};
#[derive(Serialize, Deserialize, Debug)]
pub struct IssueComment {

View file

@ -1,4 +1,4 @@
use ofborg::ghevent::Repository;
use crate::ghevent::Repository;
#[derive(Serialize, Deserialize)]
pub struct PullRequestEvent {

View file

@ -7,9 +7,6 @@
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate log;
@ -17,20 +14,6 @@ extern crate log;
#[macro_use]
extern crate nom;
extern crate amqp;
extern crate chrono;
extern crate either;
extern crate env_logger;
extern crate fs2;
extern crate hubcaps;
extern crate hyper;
extern crate hyper_native_tls;
extern crate lru_cache;
extern crate md5;
extern crate separator;
extern crate tempfile;
extern crate uuid;
use std::env;
pub mod acl;
@ -61,29 +44,29 @@ pub mod worker;
pub mod writetoline;
pub mod ofborg {
pub use acl;
pub use asynccmd;
pub use checkout;
pub use clone;
pub use commentparser;
pub use commitstatus;
pub use config;
pub use easyamqp;
pub use evalchecker;
pub use files;
pub use ghevent;
pub use locks;
pub use message;
pub use nix;
pub use notifyworker;
pub use outpathdiff;
pub use stats;
pub use systems;
pub use tagger;
pub use tasks;
pub use test_scratch;
pub use worker;
pub use writetoline;
pub use crate::acl;
pub use crate::asynccmd;
pub use crate::checkout;
pub use crate::clone;
pub use crate::commentparser;
pub use crate::commitstatus;
pub use crate::config;
pub use crate::easyamqp;
pub use crate::evalchecker;
pub use crate::files;
pub use crate::ghevent;
pub use crate::locks;
pub use crate::message;
pub use crate::nix;
pub use crate::notifyworker;
pub use crate::outpathdiff;
pub use crate::stats;
pub use crate::systems;
pub use crate::tagger;
pub use crate::tasks;
pub use crate::test_scratch;
pub use crate::worker;
pub use crate::writetoline;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

View file

@ -1,4 +1,5 @@
use fs2::FileExt;
use std::fs;
use std::io::Error;
use std::path::PathBuf;

View file

@ -1,8 +1,10 @@
use ofborg::nix::Nix;
use crate::nix::Nix;
use tempfile::NamedTempFile;
use std::collections::{HashMap, HashSet};
use std::io::Write;
use std::path::Path;
use tempfile::NamedTempFile;
#[derive(Deserialize, Debug, Eq, PartialEq)]
pub struct ImpactedMaintainers(HashMap<Maintainer, Vec<Package>>);
@ -125,9 +127,9 @@ impl std::fmt::Display for ImpactedMaintainers {
#[cfg(test)]
mod tests {
use super::*;
use checkout::cached_cloner;
use clone::GitClonable;
use ofborg::test_scratch::TestScratch;
use crate::checkout::cached_cloner;
use crate::clone::GitClonable;
use crate::test_scratch::TestScratch;
use std::env;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};

View file

@ -1,6 +1,5 @@
use ofborg::commentparser::Subset;
use ofborg::message::{Pr, Repo};
use serde_json;
use crate::commentparser::Subset;
use crate::message::{Pr, Repo};
#[derive(Serialize, Deserialize, Debug)]
pub struct BuildJob {

View file

@ -1,5 +1,6 @@
use crate::message::{Pr, Repo};
use hubcaps::checks::Conclusion;
use ofborg::message::{Pr, Repo};
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub enum BuildStatus {

View file

@ -1,6 +1,5 @@
use ofborg::message::{Pr, Repo};
use ofborg::worker;
use serde_json;
use crate::message::{Pr, Repo};
use crate::worker;
pub fn from(data: &[u8]) -> Result<EvaluationJob, serde_json::error::Error> {
serde_json::from_slice(&data)

View file

@ -1,17 +1,16 @@
use ofborg::asynccmd::{AsyncCmd, SpawnedAsyncCmd};
use ofborg::partition_result;
use crate::asynccmd::{AsyncCmd, SpawnedAsyncCmd};
use crate::ofborg::partition_result;
use tempfile::tempfile;
use std::collections::HashMap;
use std::env;
use std::ffi::OsStr;
use std::fmt;
use std::fs;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::{BufRead, BufReader, Seek, SeekFrom};
use std::path::Path;
use std::process::{Command, Stdio};
use tempfile::tempfile;
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum File {

View file

@ -1,16 +1,11 @@
/// Evaluates the expression like Hydra would, with regards to
/// architecture support and recursed packages.
//! Evaluates the expression like Hydra would, with regards to
//! architecture support and recursed packages.
use crate::nix;
use crate::nixstats::EvaluationStats;
use crate::outpathdiff;
use ofborg::nix;
use serde_json;
use std::fs;
use std::fs::File;
use std::io::Read;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::Write;
use std::io::{BufRead, BufReader};
use std::fs::{self, File};
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write};
use std::path::PathBuf;
pub struct HydraNixEnv {
@ -42,11 +37,11 @@ impl HydraNixEnv {
.lines()
.collect::<Result<Vec<String>, _>>()?
.into_iter()
.filter(|msg| msg.trim().len() > 0)
.filter(|msg| !msg.trim().is_empty())
.filter(|line| !nix::is_user_setting_warning(line))
.collect::<Vec<String>>();
if evaluation_errors.len() > 0 {
if !evaluation_errors.is_empty() {
return Err(Error::UncleanEvaluation(evaluation_errors));
}
@ -105,7 +100,8 @@ impl HydraNixEnv {
let (status, stdout, stderr) = self.nix.run_stderr_stdout(cmd);
let stats = File::open(self.outpath_stats_path());
return (status, stdout, stderr, stats);
(status, stdout, stderr, stats)
}
}

View file

@ -1,5 +1,6 @@
//! Statistics emitted by Nix when NIX_SHOW_STATS=1
use separator::Separatable;
/// Statistics emitted by Nix when NIX_SHOW_STATS=1
use std::collections::HashMap;
#[derive(Deserialize)]

View file

@ -1,8 +1,9 @@
use crate::worker::Action;
use amqp::protocol::basic::{BasicProperties, Deliver};
use amqp::Basic;
use amqp::{Channel, Consumer};
use amqp::{Basic, Channel, Consumer};
use std::marker::Send;
use worker::Action;
pub struct NotifyWorker<T: SimpleNotifyWorker> {
internal: T,

View file

@ -1,10 +1,9 @@
use crate::nixenv::Error as NixEnvError;
use crate::nixenv::HydraNixEnv;
use crate::nix;
use crate::nixenv::{Error as NixEnvError, HydraNixEnv};
use crate::nixstats::{EvaluationStats, EvaluationStatsDiff};
use ofborg::nix;
use std::collections::{HashMap, HashSet};
use std::io::BufRead;
use std::path::PathBuf;
pub struct OutPathDiff {

View file

@ -1,7 +1,5 @@
use amqp::protocol::basic::BasicProperties;
use amqp::Basic;
use amqp::Channel;
use serde_json;
use amqp::{Basic, Channel};
include!(concat!(env!("OUT_DIR"), "/events.rs"));

View file

@ -1,6 +1,7 @@
use crate::maintainers::{Maintainer, MaintainersByPackage};
use ofborg::outpathdiff::PackageArch;
use ofborg::tasks;
use crate::outpathdiff::PackageArch;
use crate::tasks;
use std::collections::HashMap;
pub struct StdenvTagger {

View file

@ -1,20 +1,15 @@
extern crate amqp;
extern crate env_logger;
extern crate uuid;
use uuid::Uuid;
use ofborg::checkout;
use ofborg::commentparser;
use ofborg::message::buildjob;
use ofborg::message::buildlogmsg;
use ofborg::message::buildresult::{BuildResult, BuildStatus, V1Tag};
use ofborg::nix;
use std::collections::VecDeque;
use crate::checkout;
use crate::commentparser;
use crate::message::buildresult::{BuildResult, BuildStatus, V1Tag};
use crate::message::{buildjob, buildlogmsg};
use crate::nix;
use crate::notifyworker;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::notifyworker;
use ofborg::worker;
use uuid::Uuid;
use std::collections::VecDeque;
pub struct BuildWorker {
cloner: checkout::CachedCloner,
@ -394,9 +389,9 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker {
#[cfg(test)]
mod tests {
use super::*;
use notifyworker::SimpleNotifyWorker;
use ofborg::message::{Pr, Repo};
use ofborg::test_scratch::TestScratch;
use crate::message::{Pr, Repo};
use crate::notifyworker::SimpleNotifyWorker;
use crate::test_scratch::TestScratch;
use std::env;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};

View file

@ -1,8 +1,9 @@
use ofborg::checkout::CachedProjectCo;
use ofborg::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker;
use crate::checkout::CachedProjectCo;
use crate::commitstatus::CommitStatus;
use crate::evalchecker::EvalChecker;
use crate::tasks::eval::{EvaluationComplete, EvaluationStrategy, StepResult};
use std::path::Path;
use tasks::eval::{EvaluationComplete, EvaluationStrategy, StepResult};
#[derive(Default)]
pub struct GenericStrategy {}

View file

@ -1,14 +1,17 @@
pub mod stdenvs;
pub use self::stdenvs::Stdenvs;
mod nixpkgs;
pub use self::nixpkgs::NixpkgsStrategy;
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;
use crate::commitstatus::{CommitStatus, CommitStatusError};
use crate::evalchecker::EvalChecker;
use crate::message::buildjob::BuildJob;
use hubcaps::checks::CheckRunOptions;
use ofborg::checkout::CachedProjectCo;
use ofborg::commitstatus::{CommitStatus, CommitStatusError};
use ofborg::evalchecker::EvalChecker;
use ofborg::message::buildjob::BuildJob;
use std::path::Path;
pub trait EvaluationStrategy {

View file

@ -1,30 +1,30 @@
use crate::maintainers;
use crate::maintainers::ImpactedMaintainers;
use crate::checkout::CachedProjectCo;
use crate::commentparser::Subset;
use crate::commitstatus::CommitStatus;
use crate::evalchecker::EvalChecker;
use crate::maintainers::{self, ImpactedMaintainers};
use crate::message::buildjob::BuildJob;
use crate::message::evaluationjob::EvaluationJob;
use crate::nix::{self, Nix};
use crate::nixenv::HydraNixEnv;
use crate::outpathdiff::{OutPathDiff, PackageArch};
use crate::tagger::{
MaintainerPRTagger, PathsTagger, PkgsAddedRemovedTagger, RebuildTagger, StdenvTagger,
};
use crate::tasks::eval::{
stdenvs::Stdenvs, Error, EvaluationComplete, EvaluationStrategy, StepResult,
};
use crate::tasks::evaluate::{make_gist, update_labels};
use chrono::Utc;
use hubcaps::checks::{CheckRunOptions, CheckRunState, Conclusion, Output};
use hubcaps::gists::Gists;
use hubcaps::issues::{Issue, IssueRef};
use hubcaps::repositories::Repository;
use ofborg::checkout::CachedProjectCo;
use ofborg::commentparser::Subset;
use ofborg::commitstatus::CommitStatus;
use ofborg::evalchecker::EvalChecker;
use ofborg::message::buildjob::BuildJob;
use ofborg::message::evaluationjob::EvaluationJob;
use ofborg::nix;
use ofborg::nix::Nix;
use ofborg::outpathdiff::{OutPathDiff, PackageArch};
use ofborg::tagger::{MaintainerPRTagger, PathsTagger, RebuildTagger};
use ofborg::tagger::{PkgsAddedRemovedTagger, StdenvTagger};
use ofborg::tasks::eval::{
stdenvs::Stdenvs, Error, EvaluationComplete, EvaluationStrategy, StepResult,
};
use ofborg::tasks::evaluate::update_labels;
use uuid::Uuid;
use std::collections::HashMap;
use std::path::Path;
use tasks::evaluate::make_gist;
use uuid::Uuid;
pub struct NixpkgsStrategy<'a> {
job: &'a EvaluationJob,

View file

@ -1,5 +1,6 @@
use ofborg::files::file_to_str;
use ofborg::nix;
use crate::files::file_to_str;
use crate::nix;
use std::path::PathBuf;
enum StdenvFrom {

View file

@ -1,28 +1,25 @@
/// This is what evaluates every pull-request
extern crate amqp;
extern crate env_logger;
extern crate uuid;
use crate::acl::ACL;
use crate::checkout;
use crate::commitstatus::{CommitStatus, CommitStatusError};
use crate::config::GithubAppVendingMachine;
use crate::files::file_to_str;
use crate::message::{buildjob, evaluationjob};
use crate::nix;
use crate::stats::{self, Event};
use crate::systems;
use crate::tasks::eval;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use hubcaps;
use hubcaps::checks::CheckRunOptions;
use hubcaps::gists::Gists;
use hubcaps::issues::Issue;
use ofborg::acl::ACL;
use ofborg::checkout;
use ofborg::commitstatus::{CommitStatus, CommitStatusError};
use ofborg::config::GithubAppVendingMachine;
use ofborg::files::file_to_str;
use ofborg::message::{buildjob, evaluationjob};
use ofborg::nix;
use ofborg::stats;
use ofborg::stats::Event;
use ofborg::systems;
use ofborg::worker;
use std::collections::HashMap;
use std::path::Path;
use std::sync::RwLock;
use std::time::Instant;
use tasks::eval;
pub struct EvaluationWorker<E> {
cloner: checkout::CachedCloner,
@ -126,6 +123,7 @@ struct OneEval<'a, E> {
}
impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
#[allow(clippy::too_many_arguments)]
fn new(
client_app: &'a hubcaps::Github,
client_legacy: &'a hubcaps::Github,
@ -236,7 +234,7 @@ impl<'a, E: stats::SysEvents + 'static> OneEval<'a, E> {
}
}
return self.actions().skip(&self.job);
self.actions().skip(&self.job)
}
fn evaluate_job(&mut self) -> Result<worker::Actions, EvalWorkerError> {

View file

@ -1,13 +1,9 @@
extern crate amqp;
extern crate env_logger;
use ofborg::acl;
use ofborg::ghevent;
use serde_json;
use crate::acl;
use crate::ghevent;
use crate::message::{evaluationjob, Pr, Repo};
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::message::{evaluationjob, Pr, Repo};
use ofborg::worker;
pub struct EvaluationFilterWorker {
acl: acl::ACL,
@ -107,7 +103,7 @@ impl worker::SimpleWorker for EvaluationFilterWorker {
#[cfg(test)]
mod tests {
use super::*;
use worker::SimpleWorker;
use crate::worker::SimpleWorker;
#[test]
fn changed_base() {

View file

@ -1,17 +1,11 @@
extern crate amqp;
extern crate env_logger;
extern crate uuid;
use ofborg::acl;
use ofborg::ghevent;
use serde_json;
use uuid::Uuid;
use crate::acl;
use crate::commentparser;
use crate::ghevent;
use crate::message::{buildjob, evaluationjob, Pr, Repo};
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use hubcaps;
use ofborg::commentparser;
use ofborg::message::{buildjob, evaluationjob, Pr, Repo};
use ofborg::worker;
use uuid::Uuid;
pub struct GitHubCommentWorker {
acl: acl::ACL,

View file

@ -1,16 +1,12 @@
extern crate amqp;
extern crate env_logger;
use serde_json;
use crate::config::GithubAppVendingMachine;
use crate::message::buildjob::{BuildJob, QueuedBuildJobs};
use crate::message::buildresult::{BuildResult, BuildStatus, LegacyBuildResult};
use crate::message::Repo;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use chrono::{DateTime, Utc};
use hubcaps::checks::{CheckRunOptions, CheckRunState, Conclusion, Output};
use message::buildjob::{BuildJob, QueuedBuildJobs};
use ofborg::config::GithubAppVendingMachine;
use ofborg::message::buildresult::{BuildResult, BuildStatus, LegacyBuildResult};
use ofborg::message::Repo;
use ofborg::worker;
pub struct GitHubCommentPoster {
github_vend: GithubAppVendingMachine,
@ -210,8 +206,8 @@ fn list_segment(name: &str, things: &[String]) -> Vec<String> {
#[cfg(test)]
mod tests {
use super::*;
use crate::message::{Pr, Repo};
use chrono::TimeZone;
use message::{Pr, Repo};
#[test]
pub fn test_queued_build() {

View file

@ -1,17 +1,14 @@
extern crate amqp;
extern crate env_logger;
use lru_cache::LruCache;
use serde_json;
use std::fs;
use std::fs::{File, OpenOptions};
use std::io::Write;
use std::path::{Component, PathBuf};
use crate::message::buildlogmsg::{BuildLogMsg, BuildLogStart};
use crate::message::buildresult::BuildResult;
use crate::worker;
use crate::writetoline::LineWriter;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::message::buildlogmsg::{BuildLogMsg, BuildLogStart};
use ofborg::message::buildresult::BuildResult;
use ofborg::worker;
use ofborg::writetoline::LineWriter;
use lru_cache::LruCache;
use std::fs::{self, File, OpenOptions};
use std::io::Write;
use std::path::{Component, PathBuf};
#[derive(Eq, PartialEq, Hash, Debug, Clone)]
pub struct LogFrom {
@ -237,10 +234,10 @@ impl worker::SimpleWorker for LogMessageCollector {
#[cfg(test)]
mod tests {
use super::*;
use ofborg::message::buildresult::{BuildStatus, V1Tag};
use ofborg::message::{Pr, Repo};
use ofborg::test_scratch::TestScratch;
use ofborg::worker::SimpleWorker;
use crate::message::buildresult::{BuildStatus, V1Tag};
use crate::message::{Pr, Repo};
use crate::test_scratch::TestScratch;
use crate::worker::SimpleWorker;
use std::io::Read;
use std::path::PathBuf;

View file

@ -1,10 +1,7 @@
extern crate amqp;
extern crate env_logger;
use crate::stats;
use crate::worker;
use amqp::protocol::basic::{BasicProperties, Deliver};
use ofborg::stats;
use ofborg::worker;
use serde_json;
pub struct StatCollectorWorker<E> {
events: E,

View file

@ -1,8 +1,7 @@
use amqp::protocol::basic::{BasicProperties, Deliver};
use amqp::Basic;
use amqp::{Channel, Consumer};
use amqp::{Basic, Channel, Consumer};
use serde::Serialize;
use serde_json;
use std::marker::Send;
pub struct Worker<T: SimpleWorker> {

View file

@ -1,9 +1,5 @@
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::Write;
use std::io::{BufRead, BufReader, Seek, SeekFrom, Write};
pub struct LineWriter {
file: File,
@ -84,7 +80,7 @@ impl LineWriter {
#[cfg(test)]
mod tests {
use super::*;
use ofborg::test_scratch::TestScratch;
use crate::test_scratch::TestScratch;
use std::fs::File;
use std::fs::OpenOptions;
use std::io::Read;