summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@atos.net>2021-09-09 08:38:26 +0200
committerMatthias Beyer <matthias.beyer@atos.net>2021-09-09 08:38:26 +0200
commit9e2173b8b3eb11ec1f620d1479ee6b6d93250120 (patch)
treedbc7e93058a45f32b3a8e48fcecbb9dcab39074e
parent910af91c2eb5d58b9fdf0317ba086c4ed687d690 (diff)
parent800ec41fadf58762ec30d864622806087cadc09c (diff)
Merge branch 'submits-on-image'
-rw-r--r--src/cli.rs8
-rw-r--r--src/commands/db.rs7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 37df36c..5c4b399 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -255,6 +255,14 @@ pub fn cli<'a>() -> App<'a> {
.value_name("HASH")
.about("Limit listed submits to one commit hash")
)
+ .arg(Arg::new("image")
+ .required(false)
+ .multiple(false)
+ .long("image")
+ .takes_value(true)
+ .value_name("IMAGE")
+ .about("Limit listed submits to submits on IMAGE")
+ )
)
.subcommand(App::new("jobs")
diff --git a/src/commands/db.rs b/src/commands/db.rs
index f3a6721..38f4beb 100644
--- a/src/commands/db.rs
+++ b/src/commands/db.rs
@@ -341,6 +341,7 @@ fn submits(conn_cfg: DbConnectionConfig<'_>, matches: &ArgMatches) -> Result<()>
let query = schema::submits::table
.order_by(schema::submits::id.desc()) // required for the --limit implementation
.inner_join(schema::githashes::table.on(schema::submits::repo_hash_id.eq(schema::githashes::id)))
+ .inner_join(schema::images::table)
.into_boxed();
let query = if let Some(commithash) = commit.as_ref() {
@@ -349,6 +350,12 @@ fn submits(conn_cfg: DbConnectionConfig<'_>, matches: &ArgMatches) -> Result<()>
query
};
+ let query = if let Some(image) = matches.value_of("image") {
+ query.filter(schema::images::name.eq(image))
+ } else {
+ query
+ };
+
let submits = if let Some(pkgname) = matches.value_of("with_pkg").map(String::from) {
// Get all submits which included the package, but were not necessarily made _for_ the package
let query = query