mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-25 00:03:52 +00:00
fix: pipeline editor badge requires asset-parse, not just main-function parse
A pipeline script's asset lineage is load-bearing — a deploy that can't parse assets silently records no edges. The editor "parsable" dot only reflected inferArgs (the main function), so a body the asset parser rejects (e.g. a trailing `/////` in DuckDB) still showed green and deployed with empty lineage. ScriptEditor gains `requireValidAssets` (set by the pipeline pane); when on, the EditorBar badge is green only if BOTH the main function and inferAssets parse, with the tooltip distinguishing "Main function not parsable" / "Assets not parsable" / "Parsable". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
f84c4cf963
commit
4013921802
@@ -86,6 +86,10 @@
|
||||
iconOnly?: boolean
|
||||
compactHelpers?: boolean
|
||||
validCode?: boolean
|
||||
// Asset-parse validity, when the context cares about it (pipeline
|
||||
// editor). `undefined` = not applicable; `false` makes the badge red
|
||||
// even if the main function parses.
|
||||
validAssets?: boolean | undefined
|
||||
kind?: 'script' | 'trigger' | 'approval'
|
||||
template?:
|
||||
| 'pgsql'
|
||||
@@ -122,6 +126,7 @@
|
||||
iconOnly = false,
|
||||
compactHelpers = false,
|
||||
validCode = true,
|
||||
validAssets = undefined,
|
||||
kind = 'script',
|
||||
template = 'script',
|
||||
collabMode = false,
|
||||
@@ -945,8 +950,14 @@ JsonNode ${windmillPathToCamelCaseName(path)} = JsonNode.Parse(await client.GetS
|
||||
<div class="flex justify-between items-center overflow-y-auto w-full p-0.5">
|
||||
<div class="flex gap-3 items-center">
|
||||
<div
|
||||
title={validCode ? 'Main function parsable' : 'Main function not parsable'}
|
||||
class="rounded-full w-2 h-2 mx-2 {validCode ? 'bg-green-300' : 'bg-red-300'}"
|
||||
title={!validCode
|
||||
? 'Main function not parsable'
|
||||
: validAssets === false
|
||||
? 'Assets not parsable'
|
||||
: 'Parsable'}
|
||||
class="rounded-full w-2 h-2 mx-2 {validCode && validAssets !== false
|
||||
? 'bg-green-300'
|
||||
: 'bg-red-300'}"
|
||||
></div>
|
||||
<div class="flex items-center gap-2">
|
||||
{#if compactHelpers}
|
||||
|
||||
@@ -150,6 +150,11 @@
|
||||
saveToWorkspace?: boolean
|
||||
watchChanges?: boolean
|
||||
customUi?: ScriptEditorWhitelabelCustomUi | undefined
|
||||
// Pipeline editor: an asset-parse failure should also turn the
|
||||
// "parsable" badge red — asset lineage is load-bearing there, so a
|
||||
// green badge must mean both the main function AND the asset parse
|
||||
// succeeded.
|
||||
requireValidAssets?: boolean
|
||||
args: Record<string, any>
|
||||
selectedTab?: 'main' | 'preprocessor' | 'diagram'
|
||||
hasPreprocessor?: boolean
|
||||
@@ -206,6 +211,7 @@
|
||||
saveToWorkspace = false,
|
||||
watchChanges = false,
|
||||
customUi = undefined,
|
||||
requireValidAssets = false,
|
||||
args = $bindable(),
|
||||
selectedTab = $bindable('main'),
|
||||
hasPreprocessor = $bindable(false),
|
||||
@@ -553,6 +559,12 @@
|
||||
() => inferAssetsRes.current?.sql_queries,
|
||||
() => $workspaceStore
|
||||
)
|
||||
// Asset-parse validity for the editor badge. `undefined` while loading (so
|
||||
// the badge doesn't flicker red); only an explicit parser error counts as
|
||||
// invalid. Surfaced only when `requireValidAssets` (pipeline editor).
|
||||
let validAssets = $derived(
|
||||
requireValidAssets ? inferAssetsRes.current?.status !== 'error' : undefined
|
||||
)
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
@@ -1605,6 +1617,7 @@
|
||||
collabLive={wsProvider?.shouldConnect}
|
||||
{collabMode}
|
||||
{validCode}
|
||||
{validAssets}
|
||||
iconOnly={width < EDITOR_BAR_WIDTH_THRESHOLD}
|
||||
compactHelpers={width < EDITOR_BAR_HELPERS_COMPACT_THRESHOLD}
|
||||
on:collabPopup={() => (showCollabPopup = true)}
|
||||
|
||||
@@ -1052,6 +1052,7 @@
|
||||
bind:this={scriptEditorRef}
|
||||
showCaptures={false}
|
||||
noSyncFromGithub
|
||||
requireValidAssets
|
||||
lang={script.language}
|
||||
path={script.path}
|
||||
tag={script.tag}
|
||||
|
||||
Reference in New Issue
Block a user