mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-21 08:02:26 +00:00
fix: hide _ENTRYPOINT_OVERRIDE jobs from script/flow history panel (#9088)
This commit is contained in:
@@ -172,6 +172,7 @@ async fn get_input_history(
|
||||
kind IN ('preview', 'flowpreview') as is_preview \
|
||||
FROM v2_job JOIN v2_job_completed USING (id) \
|
||||
WHERE v2_job.workspace_id = $3 AND {} = $1 AND kind = any($2) \
|
||||
AND v2_job.script_entrypoint_override IS NULL \
|
||||
{args_query} AND v2_job_completed.status != 'skipped' {include_non_root} \
|
||||
ORDER BY v2_job.created_at DESC LIMIT $4\
|
||||
) t ORDER BY completed_at DESC LIMIT $5 OFFSET $6",
|
||||
|
||||
@@ -226,6 +226,7 @@ async fn get_concurrent_intervals(
|
||||
trigger_kind: _,
|
||||
include_args: _,
|
||||
broad_filter: _,
|
||||
excludes_entrypoint_override: _,
|
||||
} => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
@@ -216,6 +216,10 @@ pub fn filter_list_queue_query(
|
||||
sqlb.and_where("trigger_kind IS DISTINCT FROM 'schedule'");
|
||||
}
|
||||
|
||||
if lq.excludes_entrypoint_override.unwrap_or(false) {
|
||||
sqlb.and_where_is_null("v2_job.script_entrypoint_override");
|
||||
}
|
||||
|
||||
if let Some(tk) = &lq.trigger_kind {
|
||||
let quoted: Vec<_> = tk.values.iter().map(|v| quote(&format!("{}", v))).collect();
|
||||
if tk.negated {
|
||||
@@ -519,6 +523,10 @@ pub fn filter_list_completed_query(
|
||||
sqlb.and_where("trigger_kind IS DISTINCT FROM 'schedule'");
|
||||
}
|
||||
|
||||
if lq.excludes_entrypoint_override.unwrap_or(false) {
|
||||
sqlb.and_where_is_null("v2_job.script_entrypoint_override");
|
||||
}
|
||||
|
||||
if let Some(tk) = &lq.trigger_kind {
|
||||
let quoted: Vec<_> = tk.values.iter().map(|v| quote(&format!("{}", v))).collect();
|
||||
if tk.negated {
|
||||
@@ -624,6 +632,7 @@ mod tests {
|
||||
trigger_path: None,
|
||||
include_args: None,
|
||||
broad_filter: None,
|
||||
excludes_entrypoint_override: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -668,6 +677,7 @@ mod tests {
|
||||
trigger_path: None,
|
||||
include_args: None,
|
||||
broad_filter: None,
|
||||
excludes_entrypoint_override: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ pub struct ListQueueQuery {
|
||||
pub trigger_path: Option<NegatedListFilter<String>>,
|
||||
pub include_args: Option<bool>,
|
||||
pub broad_filter: Option<String>,
|
||||
pub excludes_entrypoint_override: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
@@ -167,6 +168,7 @@ pub struct ListCompletedQuery {
|
||||
pub trigger_path: Option<NegatedListFilter<String>>,
|
||||
pub include_args: Option<bool>,
|
||||
pub broad_filter: Option<String>,
|
||||
pub excludes_entrypoint_override: Option<bool>,
|
||||
}
|
||||
|
||||
impl From<ListCompletedQuery> for ListQueueQuery {
|
||||
@@ -202,6 +204,7 @@ impl From<ListCompletedQuery> for ListQueueQuery {
|
||||
trigger_path: lcq.trigger_path,
|
||||
include_args: lcq.include_args,
|
||||
broad_filter: lcq.broad_filter,
|
||||
excludes_entrypoint_override: lcq.excludes_entrypoint_override,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -704,6 +707,7 @@ mod tests {
|
||||
trigger_path: None,
|
||||
include_args: None,
|
||||
broad_filter: None,
|
||||
excludes_entrypoint_override: None,
|
||||
};
|
||||
|
||||
let lqq: ListQueueQuery = lcq.into();
|
||||
@@ -772,6 +776,7 @@ mod tests {
|
||||
trigger_path: None,
|
||||
include_args: None,
|
||||
broad_filter: None,
|
||||
excludes_entrypoint_override: None,
|
||||
};
|
||||
|
||||
let lqq: ListQueueQuery = lcq.into();
|
||||
|
||||
@@ -12000,6 +12000,11 @@ paths:
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
- name: excludes_entrypoint_override
|
||||
description: exclude jobs that were started with a `_ENTRYPOINT_OVERRIDE` arg (e.g. dynamic-select helper runs and preprocessor previews)
|
||||
in: query
|
||||
schema:
|
||||
type: boolean
|
||||
- name: broad_filter
|
||||
description: broad search across multiple fields (case-insensitive substring match on path, tag, schedule path, trigger kind, label)
|
||||
in: query
|
||||
|
||||
@@ -112,7 +112,8 @@
|
||||
syncQueuedRunsCount: false,
|
||||
refreshRate: 10000,
|
||||
currentWorkspace: $workspaceStore ?? '',
|
||||
skip: !runnableId
|
||||
skip: !runnableId,
|
||||
excludesEntrypointOverride: true
|
||||
}) satisfies UseJobLoaderArgs
|
||||
)
|
||||
let jobs = $derived(jobsLoader?.jobs ?? [])
|
||||
|
||||
@@ -53,6 +53,7 @@ export interface UseJobLoaderArgs {
|
||||
skip?: boolean
|
||||
lookback?: number
|
||||
perPage?: number
|
||||
excludesEntrypointOverride?: boolean
|
||||
}
|
||||
|
||||
export function useJobsLoader(args: () => UseJobLoaderArgs) {
|
||||
@@ -69,6 +70,7 @@ export function useJobsLoader(args: () => UseJobLoaderArgs) {
|
||||
let lookback = $derived(_args.lookback ?? 0)
|
||||
let timeframe = $derived(_args?.timeframe)
|
||||
let perPage = $derived(_args?.perPage ?? 1000)
|
||||
let excludesEntrypointOverride = $derived(_args.excludesEntrypointOverride ?? false)
|
||||
|
||||
let label = $derived(filters?.label ?? null)
|
||||
let worker = $derived(filters?.worker ?? null)
|
||||
@@ -274,7 +276,8 @@ export function useJobsLoader(args: () => UseJobLoaderArgs) {
|
||||
allWorkspaces: allWorkspaces ? true : undefined,
|
||||
perPage: perPageOverride ?? perPage,
|
||||
allowWildcards: allowWildcards ? true : undefined,
|
||||
broadFilter
|
||||
broadFilter,
|
||||
excludesEntrypointOverride: excludesEntrypointOverride ? true : undefined
|
||||
})
|
||||
promise = CancelablePromiseUtils.catchErr(promise, (e) => {
|
||||
if (e instanceof CancelError) return CancelablePromiseUtils.err(e)
|
||||
|
||||
Reference in New Issue
Block a user