fix: workspace specific default tags do not override step level custom tags

This commit is contained in:
Ruben Fiszel
2024-08-16 17:00:08 +02:00
parent 43459ce03a
commit 49835ca6ca
4 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -2379,7 +2379,7 @@ async fn push_next_flow_job<R: rsmq_async::RsmqConnection + Send + Sync + Clone>
continue_on_same_worker,
err,
flow_job.visible_to_owner,
if flow_job.tag == "flow" {
if flow_job.tag == "flow" || flow_job.tag == format!("flow-{}", flow_job.workspace_id) {
payload_tag.tag
} else {
Some(flow_job.tag.clone())
@@ -10,6 +10,7 @@
import type { DurationStatus } from './graph'
import type { Writable } from 'svelte/store'
export let waitingForExecutor: boolean = false
export let result: any
export let logs: string | undefined
export let col: boolean = false
@@ -17,6 +18,7 @@
export let loading: boolean
export let filename: string | undefined = undefined
export let jobId: string | undefined = undefined
export let tag: string | undefined = undefined
export let workspaceId: string | undefined = undefined
export let refreshLog: boolean = false
export let durationStates: Writable<Record<string, DurationStatus>> | undefined
@@ -79,9 +81,9 @@
{/if}
</div>
<div class="overflow-auto {col ? '' : 'max-h-80'} relative">
<div class="absolute z-40 text-sm top-1.5 left-2"
<div class="absolute z-40 text-xs top-0 left-1"
><button class="" on:click={drawer.openDrawer}>explore all steps' logs</button></div
>
<LogViewer content={logs ?? ''} {jobId} isLoading={false} tag={undefined} />
<LogViewer content={logs ?? ''} {jobId} isLoading={waitingForExecutor} {tag} />
</div>
</div>
@@ -171,7 +171,7 @@
mod.type === 'WaitingForEvents' &&
$localModuleStates?.[innerModules?.[i - 1]?.id ?? '']?.type == 'Success'
) {
setModuleState(mod.id ?? '', { type: mod.type, args: job?.args })
setModuleState(mod.id ?? '', { type: mod.type, args: job?.args, tag: job?.tag })
} else if (
mod.type === 'WaitingForExecutor' &&
$localModuleStates[mod.id ?? '']?.scheduled_for == undefined
@@ -187,7 +187,8 @@
scheduled_for: job?.['scheduled_for'],
job_id: job?.id,
parent_module: mod['parent_module'],
args: job?.args
args: job?.args,
tag: job?.tag
}
setModuleState(mod.id ?? '', newState)
})
@@ -399,6 +400,7 @@
job_id: job.id,
logs: job.logs,
args: job.args,
tag: job.tag,
started_at,
parent_module: mod['parent_module']
},
@@ -417,6 +419,7 @@
logs: job.logs,
result: job['result'],
job_id: job.id,
tag: job.tag,
parent_module: mod['parent_module'],
duration_ms: job['duration_ms'],
started_at: started_at,
@@ -648,6 +651,7 @@
<FlowJobResult
workspaceId={job?.workspace_id}
jobId={job?.id}
tag={job?.tag}
loading={job['running'] == true}
result={job.result}
logs={job.logs}
@@ -987,6 +991,7 @@
jobId={job?.id}
filename={job.id}
loading={job['running']}
tag={job?.tag}
noBorder
col
result={job['result']}
@@ -1050,14 +1055,17 @@
/>
</div>
{/if}
<FlowJobResult
workspaceId={job?.workspace_id}
jobId={node.job_id}
noBorder
loading={node.type != 'Success' && node.type != 'Failure'}
waitingForExecutor={node.type == 'WaitingForExecutor'}
refreshLog={node.type == 'InProgress'}
col
result={node.result}
tag={node.tag}
logs={node.logs}
durationStates={localDurationStatuses}
/>
@@ -50,6 +50,7 @@ export type GraphModuleState = {
flow_jobs_results?: any
branchChosen?: number
result?: any
tag?: string
scheduled_for?: Date
job_id?: string
parent_module?: string