fix: fix list jobs by tag

This commit is contained in:
Ruben Fiszel
2025-04-05 10:50:28 +00:00
parent efacda7453
commit 0c3cb3700a

View File

@@ -1447,7 +1447,7 @@ pub fn filter_list_queue_query(
sqlb.and_where_eq("created_by", "?".bind(cb));
}
if let Some(t) = &lq.tag {
sqlb.and_where_eq("tag", "?".bind(t));
sqlb.and_where_eq("v2_job.tag", "?".bind(t));
}
if let Some(r) = &lq.running {
sqlb.and_where_eq("running", &r);
@@ -1539,7 +1539,10 @@ pub fn list_queue_jobs_query(
.clone();
if let Some(tags) = tags {
sqlb.and_where_in("tag", &tags.iter().map(|x| quote(x)).collect::<Vec<_>>());
sqlb.and_where_in(
"v2_job.tag",
&tags.iter().map(|x| quote(x)).collect::<Vec<_>>(),
);
}
filter_list_queue_query(sqlb, lq, w_id, join_outstanding_wait_times)
@@ -1746,7 +1749,10 @@ async fn list_filtered_uuids(
.or_where_is_null("v2_job.trigger_kind");
if let Some(tags) = get_scope_tags(&authed) {
sqlb.and_where_in("tag", &tags.iter().map(|x| quote(x)).collect::<Vec<_>>());
sqlb.and_where_in(
"v2_job.tag",
&tags.iter().map(|x| quote(x)).collect::<Vec<_>>(),
);
}
sqlb = filter_list_queue_query(sqlb, &lq, w_id.as_str(), false);
@@ -1829,7 +1835,7 @@ async fn count_completed_jobs_detail(
if let Some(tags) = query.tags {
sqlb.and_where_in(
"tag",
"v2_job.tag",
&tags
.split(",")
.map(|t| format!("'{}'", t))
@@ -5469,7 +5475,7 @@ pub fn filter_list_completed_query(
sqlb.and_where_eq("runnable_id", "?".bind(h));
}
if let Some(t) = &lq.tag {
sqlb.and_where_eq("tag", "?".bind(t));
sqlb.and_where_eq("v2_job.tag", "?".bind(t));
}
if let Some(cb) = &lq.created_by {
sqlb.and_where_eq("created_by", "?".bind(cb));
@@ -5570,7 +5576,10 @@ pub fn list_completed_jobs_query(
.clone();
if let Some(tags) = tags {
sqlb.and_where_in("tag", &tags.iter().map(|x| quote(x)).collect::<Vec<_>>());
sqlb.and_where_in(
"v2_job.tag",
&tags.iter().map(|x| quote(x)).collect::<Vec<_>>(),
);
}
filter_list_completed_query(sqlb, lq, w_id, join_outstanding_wait_times)