From d15d5dfeb653e551fc3409dc7cfac0dbd91910ad Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 19:57:06 +0000 Subject: [PATCH] Add trigger_kind filter to runs page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add trigger_kind field to ListCompletedQuery and ListQueueQuery structs - Implement filtering logic in filter_list_completed_query and filter_list_queue_query - Update OpenAPI spec to document new trigger_kind parameter - Add trigger kind filter UI in RunsFilter component with dropdown for all trigger types - Update JobsLoader to pass trigger_kind to API calls - Update main runs page to handle trigger_kind state and URL params 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Diego Imbert --- backend/windmill-api/openapi.yaml | 15 ++++++++ .../windmill-api/src/concurrency_groups.rs | 1 + backend/windmill-api/src/jobs.rs | 11 ++++++ .../src/lib/components/HistoricInputs.svelte | 1 + .../src/lib/components/SavedInputs.svelte | 1 + .../src/lib/components/runs/JobsLoader.svelte | 9 +++-- .../src/lib/components/runs/RunsFilter.svelte | 34 ++++++++++++++++++- .../(logged)/runs/[...path]/+page.svelte | 24 +++++++++++++ 8 files changed, 93 insertions(+), 3 deletions(-) diff --git a/backend/windmill-api/openapi.yaml b/backend/windmill-api/openapi.yaml index bacc426053..95b89e9fc8 100644 --- a/backend/windmill-api/openapi.yaml +++ b/backend/windmill-api/openapi.yaml @@ -8100,6 +8100,11 @@ paths: in: query schema: type: boolean + - name: trigger_kind + description: filter by trigger kind (webhook, http, websocket, kafka, email, nats, schedule, app, ui, postgres, sqs, gcp) + in: query + schema: + type: string responses: "200": description: All queued jobs @@ -8469,6 +8474,11 @@ paths: in: query schema: type: boolean + - name: trigger_kind + description: filter by trigger kind (webhook, http, websocket, kafka, email, nats, schedule, app, ui, postgres, sqs, gcp) + in: query + schema: + type: string responses: "200": description: All jobs @@ -14442,6 +14452,11 @@ paths: in: query schema: type: boolean + - name: trigger_kind + description: filter by trigger kind (webhook, http, websocket, kafka, email, nats, schedule, app, ui, postgres, sqs, gcp) + in: query + schema: + type: string responses: "200": description: time diff --git a/backend/windmill-api/src/concurrency_groups.rs b/backend/windmill-api/src/concurrency_groups.rs index bfd0b8182f..625129ef5c 100644 --- a/backend/windmill-api/src/concurrency_groups.rs +++ b/backend/windmill-api/src/concurrency_groups.rs @@ -222,6 +222,7 @@ async fn get_concurrent_intervals( all_workspaces: _, concurrency_key: Some(_), allow_wildcards: None, + trigger_kind: None, } => true, _ => false, }; diff --git a/backend/windmill-api/src/jobs.rs b/backend/windmill-api/src/jobs.rs index d006c2ec15..e161011db2 100644 --- a/backend/windmill-api/src/jobs.rs +++ b/backend/windmill-api/src/jobs.rs @@ -1781,6 +1781,7 @@ pub struct ListQueueQuery { pub is_not_schedule: Option, pub concurrency_key: Option, pub allow_wildcards: Option, + pub trigger_kind: Option, } impl From for ListQueueQuery { @@ -1812,6 +1813,7 @@ impl From for ListQueueQuery { is_not_schedule: lcq.is_not_schedule, concurrency_key: lcq.concurrency_key, allow_wildcards: lcq.allow_wildcards, + trigger_kind: lcq.trigger_kind, } } } @@ -1935,6 +1937,10 @@ pub fn filter_list_queue_query( sqlb.and_where("trigger_kind IS DISTINCT FROM 'schedule'"); } + if let Some(tk) = &lq.trigger_kind { + sqlb.and_where_eq("v2_job.trigger_kind", "?".bind(tk)); + } + sqlb } @@ -7639,6 +7645,10 @@ pub fn filter_list_completed_query( sqlb.and_where("trigger_kind IS DISTINCT FROM 'schedule'"); } + if let Some(tk) = &lq.trigger_kind { + sqlb.and_where_eq("v2_job.trigger_kind", "?".bind(tk)); + } + sqlb } @@ -7715,6 +7725,7 @@ pub struct ListCompletedQuery { pub concurrency_key: Option, pub worker: Option, pub allow_wildcards: Option, + pub trigger_kind: Option, } async fn list_completed_jobs( diff --git a/frontend/src/lib/components/HistoricInputs.svelte b/frontend/src/lib/components/HistoricInputs.svelte index 2f3ac70672..94ca731d18 100644 --- a/frontend/src/lib/components/HistoricInputs.svelte +++ b/frontend/src/lib/components/HistoricInputs.svelte @@ -110,6 +110,7 @@ folder={null} concurrencyKey={null} tag={null} + triggerKind={null} success="running" argFilter={searchArgs ? JSON.stringify(searchArgs) : undefined} bind:loading diff --git a/frontend/src/lib/components/SavedInputs.svelte b/frontend/src/lib/components/SavedInputs.svelte index 242d430af3..28ae942cc4 100644 --- a/frontend/src/lib/components/SavedInputs.svelte +++ b/frontend/src/lib/components/SavedInputs.svelte @@ -161,6 +161,7 @@ folder={null} concurrencyKey={null} tag={null} + triggerKind={null} success="running" argFilter={undefined} bind:loading diff --git a/frontend/src/lib/components/runs/JobsLoader.svelte b/frontend/src/lib/components/runs/JobsLoader.svelte index 22ee0750b4..c8eff74532 100644 --- a/frontend/src/lib/components/runs/JobsLoader.svelte +++ b/frontend/src/lib/components/runs/JobsLoader.svelte @@ -39,6 +39,7 @@ externalJobs?: Job[] | undefined concurrencyKey: string | null tag: string | null + triggerKind: string | null showSkipped?: boolean extendedJobs?: ExtendedJobs | undefined argError?: string @@ -78,6 +79,7 @@ externalJobs = $bindable(undefined), concurrencyKey, tag, + triggerKind, extendedJobs = $bindable(undefined), argError = '', resultError = '', @@ -217,7 +219,8 @@ : undefined, allWorkspaces: allWorkspaces ? true : undefined, perPage, - allowWildcards: allowWildcards ? true : undefined + allowWildcards: allowWildcards ? true : undefined, + triggerKind: triggerKind === null || triggerKind === '' ? undefined : triggerKind }) } catch (e) { sendUserToast('There was an issue loading jobs, see browser console for more details', true) @@ -267,7 +270,8 @@ : undefined, allWorkspaces: allWorkspaces ? true : undefined, perPage, - allowWildcards + allowWildcards, + triggerKind: triggerKind === null || triggerKind === '' ? undefined : triggerKind }) } catch (e) { sendUserToast('There was an issue loading jobs, see browser console for more details', true) @@ -548,6 +552,7 @@ jobKinds, concurrencyKey, tag, + triggerKind, lookback, user, folder, diff --git a/frontend/src/lib/components/runs/RunsFilter.svelte b/frontend/src/lib/components/runs/RunsFilter.svelte index 24b85b3cfc..01f8d53c58 100644 --- a/frontend/src/lib/components/runs/RunsFilter.svelte +++ b/frontend/src/lib/components/runs/RunsFilter.svelte @@ -26,6 +26,7 @@ concurrencyKey?: string | null worker?: string | null tag?: string | null + triggerKind?: string | null success?: 'running' | 'waiting' | 'suspended' | 'queued' | 'success' | 'failure' | undefined showSkipped?: boolean | undefined argFilter: string @@ -52,6 +53,7 @@ | 'worker' | 'tag' | 'schedulePath' + | 'triggerKind' small?: boolean calendarSmall?: boolean } @@ -62,6 +64,7 @@ concurrencyKey = $bindable(null), worker = $bindable(null), tag = $bindable(null), + triggerKind = $bindable(null), success = $bindable(undefined), showSkipped = $bindable(undefined), argFilter = $bindable(), @@ -103,6 +106,8 @@ filterBy = 'tag' } else if (schedulePath !== undefined && schedulePath !== '' && filterBy !== 'schedulePath') { filterBy = 'schedulePath' + } else if (triggerKind !== null && triggerKind !== '' && filterBy !== 'triggerKind') { + filterBy = 'triggerKind' } else if (worker !== null && worker !== '' && filterBy !== 'worker') { filterBy = 'worker' } @@ -120,7 +125,7 @@ let displayedSchedule = $derived(schedulePath) let displayedWorker = $derived(worker) $effect(() => { - ;(path || user || folder || label || worker || concurrencyKey || tag || schedulePath) && + ;(path || user || folder || label || worker || concurrencyKey || tag || triggerKind || schedulePath) && untrack(() => autosetFilter()) }) @@ -131,6 +136,7 @@ label = null concurrencyKey = null tag = null + triggerKind = null schedulePath = undefined worker = null } @@ -204,6 +210,7 @@ { label: 'Concurrency key', value: 'concurrencyKey' }, { label: 'Label', value: 'label' }, { label: 'Tag', value: 'tag' }, + { label: 'Trigger', value: 'triggerKind' }, { label: 'Worker', value: 'worker' } ]} {item} @@ -433,6 +440,31 @@ {/key} + {:else if filterBy === 'triggerKind'} + + {#key triggerKind} +