Skip to content

Commit ea8c53d

Browse files
feat: small additions (#800)
1 parent ebb6be2 commit ea8c53d

File tree

7 files changed

+77
-12
lines changed

7 files changed

+77
-12
lines changed

src/app/runs/[id]/_Tabs/Configuration/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ export function ConfigurationTab() {
4141
)}
4242
<CodeCollapsible runId={runId} />
4343
<EnvironmentCollapsible run={data} />
44+
<NestedCollapsible
45+
isInitialOpen
46+
title="Cache Policy"
47+
sortKeysAlphabetically={false}
48+
data={data.metadata?.config.cache_policy ?? undefined}
49+
/>
4450
<NestedCollapsible
4551
isInitialOpen
4652
title="Resources"

src/app/runs/[id]/_Tabs/Overview/Details.tsx

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { Key, Value } from "@/components/KeyValue";
1010
import { RepoBadge } from "@/components/repositories/RepoBadge";
1111
import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query";
1212
import { calculateTimeDifference } from "@/lib/dates";
13+
import { snakeCaseToTitleCase } from "@/lib/strings";
1314
import { routes } from "@/router/routes";
1415
import {
1516
CollapsibleContent,
@@ -48,6 +49,9 @@ export function Details() {
4849
if (isError) return null;
4950
if (isPending) return <Skeleton className="h-[200px] w-full" />;
5051

52+
const statusReason = data.body?.status_reason;
53+
const executionMode = data.metadata?.config.execution_mode;
54+
5155
return (
5256
<CollapsiblePanel open={open} onOpenChange={setOpen}>
5357
<CollapsibleHeader className="flex items-center gap-[10px]">
@@ -71,15 +75,31 @@ export function Details() {
7175
</Value>
7276
<Key>Status</Key>
7377
<Value>
74-
<Tag
75-
className="inline-flex items-center gap-0.5"
76-
emphasis="subtle"
77-
color={getExecutionStatusTagColor(data.body?.status)}
78-
>
79-
<ExecutionStatusIcon className="fill-current" status={data.body?.status} />
80-
{data.body?.status}
81-
</Tag>
78+
{(() => {
79+
const statusTag = (
80+
<Tag
81+
className="inline-flex items-center gap-0.5"
82+
emphasis="subtle"
83+
color={getExecutionStatusTagColor(data.body?.status)}
84+
>
85+
<ExecutionStatusIcon className="fill-current" status={data.body?.status} />
86+
{statusReason ?? data.body?.status}
87+
</Tag>
88+
);
89+
90+
return statusReason ? (
91+
<TooltipProvider>
92+
<Tooltip>
93+
<TooltipTrigger>{statusTag}</TooltipTrigger>
94+
<TooltipContent>{data.body?.status}</TooltipContent>
95+
</Tooltip>
96+
</TooltipProvider>
97+
) : (
98+
statusTag
99+
);
100+
})()}
82101
</Value>
102+
83103
<Key>Pipeline</Key>
84104
<Value>
85105
{data.body?.pipeline ? (
@@ -102,6 +122,8 @@ export function Details() {
102122
"Not available"
103123
)}
104124
</Value>
125+
<Key>Execution Mode</Key>
126+
<Value>{executionMode ? snakeCaseToTitleCase(executionMode) : "Not available"}</Value>
105127
<Key>
106128
<div className="flex items-center space-x-0.5 truncate">
107129
<span className="truncate">Repository/Commit</span>

src/components/ExecutionStatus.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export function getExecutionStatusColor(status?: ExecutionStatus | "unknown" | n
1818
case "failed":
1919
return "fill-error-500";
2020
case "initializing":
21+
case "provisioning":
2122
return "fill-primary-400";
2223
case "cached":
2324
case "stopped":
@@ -62,6 +63,7 @@ export function getExecutionStatusBackgroundColor(status?: ExecutionStatus | "un
6263
case "failed":
6364
return "bg-error-50";
6465
case "initializing":
66+
case "provisioning":
6567
return "bg-primary-50";
6668
case "cached":
6769
case "stopped":
@@ -86,6 +88,7 @@ export function getExecutionStatusTagColor(
8688
case "failed":
8789
return "red";
8890
case "initializing":
91+
case "provisioning":
8992
return "purple";
9093
case "cached":
9194
case "stopped":
@@ -115,6 +118,7 @@ export function ExecutionStatusIcon({
115118
case "failed":
116119
return <AlertCircle className={classNames} />;
117120
case "initializing":
121+
case "provisioning":
118122
case "stopping":
119123
return <Initializing className={classNames} />;
120124
case "cached":

src/components/NestedCollapsible.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type Props = {
2020
title: ReactNode;
2121
isInitialOpen?: boolean;
2222
contentClassName?: string;
23+
sortKeysAlphabetically?: boolean;
2324
className?: string;
2425
schema?: JSONSchemaDefinition;
2526
};
@@ -34,7 +35,8 @@ export function NestedCollapsible({
3435
contentClassName,
3536
className,
3637
children,
37-
isInitialOpen = false
38+
isInitialOpen = false,
39+
sortKeysAlphabetically = true
3840
}: PropsWithChildren<Props>) {
3941
const objects: { [key: string]: Record<string, unknown> } = {};
4042
const nonObjects: { [key: string]: unknown } = {};
@@ -52,7 +54,9 @@ export function NestedCollapsible({
5254

5355
// sort keys of nonObjects alphabetically
5456
const values = Object.entries(nonObjects);
55-
values.sort((a, b) => a[0].localeCompare(b[0]));
57+
if (sortKeysAlphabetically) {
58+
values.sort((a, b) => a[0].localeCompare(b[0]));
59+
}
5660

5761
const hasNoData = Object.keys(data || {}).length === 0;
5862

src/components/runs/stop-group/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ export function RunStopGroup({ runId }: Props) {
1212
if (runQuery.isError) return null;
1313
if (runQuery.isPending) return <Skeleton className="h-6 w-[100px]" />;
1414

15-
const status = runQuery.data?.body?.status;
16-
const isActive = status === "running" || status === "initializing";
15+
const status = runQuery.data.body?.status;
16+
const orchestratorRunID = runQuery.data.metadata?.orchestrator_run_id;
17+
const isActive =
18+
(status === "running" || status === "initializing" || status === "provisioning") &&
19+
!!orchestratorRunID;
1720

1821
return (
1922
<div className="flex">

src/components/steps/step-sheet/ConfigurationTab.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ export function StepConfigTab({ stepId }: Props) {
9494
title="Resources"
9595
data={(data.metadata?.config.settings as { [key: string]: any })?.resources || {}}
9696
/>
97+
<NestedCollapsible
98+
isInitialOpen
99+
title="Cache Policy"
100+
sortKeysAlphabetically={false}
101+
data={data.metadata?.config.cache_policy}
102+
/>
103+
<NestedCollapsible
104+
isInitialOpen
105+
title="Retry"
106+
data={data.metadata?.config.retry ?? undefined}
107+
/>
97108
<NestedCollapsible
98109
isInitialOpen
99110
title="Substitutions"

src/types/core.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4769,6 +4769,12 @@ export type components = {
47694769
/** The line number of the step code that raised the exception. */
47704770
step_code_line?: number | null;
47714771
};
4772+
/**
4773+
* ExecutionMode
4774+
* @description Enum that represents the execution mode of a pipeline run.
4775+
* @enum {string}
4776+
*/
4777+
ExecutionMode: "fail_fast" | "stop_on_failure" | "continue_on_failure";
47724778
/**
47734779
* ExecutionStatus
47744780
* @description Enum that represents the execution status of a step or pipeline run.
@@ -6445,6 +6451,8 @@ export type components = {
64456451
enable_step_logs?: boolean | null;
64466452
/** Enable Pipeline Logs */
64476453
enable_pipeline_logs?: boolean | null;
6454+
/** @default continue_on_failure */
6455+
execution_mode?: components["schemas"]["ExecutionMode"];
64486456
/**
64496457
* Settings
64506458
* @default {}
@@ -6495,6 +6503,8 @@ export type components = {
64956503
enable_step_logs?: boolean | null;
64966504
/** Enable Pipeline Logs */
64976505
enable_pipeline_logs?: boolean | null;
6506+
/** @default continue_on_failure */
6507+
execution_mode?: components["schemas"]["ExecutionMode"];
64986508
/**
64996509
* Settings
65006510
* @default {}
@@ -6892,6 +6902,8 @@ export type components = {
68926902
project_id: string;
68936903
/** The status of the pipeline run. */
68946904
status: components["schemas"]["ExecutionStatus"];
6905+
/** Whether the pipeline run is in progress. */
6906+
in_progress: boolean;
68956907
/** The reason for the status of the pipeline run. */
68966908
status_reason?: string | null;
68976909
/** The stack that was used for this run. */
@@ -13900,6 +13912,7 @@ export type operations = {
1390013912
template_id?: string | null;
1390113913
model_version_id?: string | null;
1390213914
status?: string | null;
13915+
in_progress?: boolean | null;
1390313916
start_time?: string | null;
1390413917
end_time?: string | null;
1390513918
unlisted?: boolean | null;
@@ -14453,6 +14466,7 @@ export type operations = {
1445314466
template_id?: string | null;
1445414467
model_version_id?: string | null;
1445514468
status?: string | null;
14469+
in_progress?: boolean | null;
1445614470
start_time?: string | null;
1445714471
end_time?: string | null;
1445814472
unlisted?: boolean | null;
@@ -21405,6 +21419,7 @@ export type operations = {
2140521419
template_id?: string | null;
2140621420
model_version_id?: string | null;
2140721421
status?: string | null;
21422+
in_progress?: boolean | null;
2140821423
start_time?: string | null;
2140921424
end_time?: string | null;
2141021425
unlisted?: boolean | null;

0 commit comments

Comments
 (0)