@shipfox/client-workflows 15.0.0 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.css +4 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +41 -0
- package/dist/components/identifier/identifier.js +2 -2
- package/dist/components/identifier/identifier.js.map +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.d.ts.map +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.js +1 -1
- package/dist/components/job-detail/agent-config-failure-callout.js.map +1 -1
- package/dist/components/job-detail/job-context-panel.d.ts +6 -0
- package/dist/components/job-detail/job-context-panel.d.ts.map +1 -0
- package/dist/components/job-detail/job-context-panel.js +224 -0
- package/dist/components/job-detail/job-context-panel.js.map +1 -0
- package/dist/components/job-detail/job-detail-header.d.ts +10 -1
- package/dist/components/job-detail/job-detail-header.d.ts.map +1 -1
- package/dist/components/job-detail/job-detail-header.js +58 -39
- package/dist/components/job-detail/job-detail-header.js.map +1 -1
- package/dist/components/job-detail/job-detail-view.d.ts +1 -1
- package/dist/components/job-detail/job-detail-view.d.ts.map +1 -1
- package/dist/components/job-detail/job-detail-view.js +92 -41
- package/dist/components/job-detail/job-detail-view.js.map +1 -1
- package/dist/components/job-detail/job-empty-states.d.ts.map +1 -1
- package/dist/components/job-detail/job-empty-states.js +19 -10
- package/dist/components/job-detail/job-empty-states.js.map +1 -1
- package/dist/components/job-detail/job-execution-switcher.js +4 -4
- package/dist/components/job-detail/job-execution-switcher.js.map +1 -1
- package/dist/components/job-detail/json-code.d.ts +14 -0
- package/dist/components/job-detail/json-code.d.ts.map +1 -0
- package/dist/components/job-detail/json-code.js +93 -0
- package/dist/components/job-detail/json-code.js.map +1 -0
- package/dist/components/job-detail/step-attempt-log-panel.d.ts.map +1 -1
- package/dist/components/job-detail/step-attempt-log-panel.js +9 -6
- package/dist/components/job-detail/step-attempt-log-panel.js.map +1 -1
- package/dist/components/job-detail/step-troubleshooting.d.ts +18 -0
- package/dist/components/job-detail/step-troubleshooting.d.ts.map +1 -0
- package/dist/components/job-detail/step-troubleshooting.js +493 -0
- package/dist/components/job-detail/step-troubleshooting.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -1
- package/dist/components/job-graph/job-graph-content.js +5 -4
- package/dist/components/job-graph/job-graph-content.js.map +1 -1
- package/dist/components/job-graph/job-node.js +3 -3
- package/dist/components/job-graph/job-node.js.map +1 -1
- package/dist/components/step-list/index.d.ts +1 -0
- package/dist/components/step-list/index.d.ts.map +1 -1
- package/dist/components/step-list/index.js.map +1 -1
- package/dist/components/step-list/step-list-model.d.ts.map +1 -1
- package/dist/components/step-list/step-list-model.js +5 -0
- package/dist/components/step-list/step-list-model.js.map +1 -1
- package/dist/components/step-list/step-list.d.ts +5 -1
- package/dist/components/step-list/step-list.d.ts.map +1 -1
- package/dist/components/step-list/step-list.js +117 -82
- package/dist/components/step-list/step-list.js.map +1 -1
- package/dist/components/workflow-run-duration-label.js +1 -1
- package/dist/components/workflow-run-duration-label.js.map +1 -1
- package/dist/components/workflow-run-list/job-status-strip.js +6 -6
- package/dist/components/workflow-run-list/job-status-strip.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js +1 -1
- package/dist/components/workflow-run-list/workflow-run-filter-menu.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-filters.js +4 -4
- package/dist/components/workflow-run-list/workflow-run-filters.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-states.js +6 -6
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js +1 -1
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -1
- package/dist/components/workflow-run-list/workflow-run-row.js +7 -7
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +1 -1
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +0 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -1
- package/dist/components/workflow-run-summary/workflow-run-summary.js +9 -13
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -1
- package/dist/components/workflow-run-tabs/index.d.ts +3 -0
- package/dist/components/workflow-run-tabs/index.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/index.js +3 -0
- package/dist/components/workflow-run-tabs/index.js.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.d.ts +16 -0
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.js +50 -0
- package/dist/components/workflow-run-tabs/run-annotation-count-chip.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.d.ts +20 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.js +102 -0
- package/dist/components/workflow-run-tabs/run-annotation-item.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.d.ts +39 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.js +211 -0
- package/dist/components/workflow-run-tabs/run-annotation-list.js.map +1 -0
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.d.ts.map +1 -1
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js +90 -25
- package/dist/components/workflow-run-tabs/run-annotation-summary-line.js.map +1 -1
- package/dist/components/workflow-run-tabs/severity-visuals.d.ts +20 -0
- package/dist/components/workflow-run-tabs/severity-visuals.d.ts.map +1 -0
- package/dist/components/workflow-run-tabs/severity-visuals.js +31 -0
- package/dist/components/workflow-run-tabs/severity-visuals.js.map +1 -0
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.d.ts.map +1 -1
- package/dist/components/workflow-run-view/run-workspace-nav.js +16 -10
- package/dist/components/workflow-run-view/run-workspace-nav.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-states.js +6 -6
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +1 -3
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -1
- package/dist/components/workflow-run-view/workflow-run-view.js +217 -59
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -1
- package/dist/core/entities/job-execution.d.ts +7 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -1
- package/dist/core/entities/job-execution.js.map +1 -1
- package/dist/core/entities/job.d.ts +9 -0
- package/dist/core/entities/job.d.ts.map +1 -1
- package/dist/core/entities/job.js.map +1 -1
- package/dist/core/entities/step-attempt.d.ts +29 -0
- package/dist/core/entities/step-attempt.d.ts.map +1 -1
- package/dist/core/entities/step-attempt.js.map +1 -1
- package/dist/core/entities/step.d.ts +3 -1
- package/dist/core/entities/step.d.ts.map +1 -1
- package/dist/core/entities/step.js.map +1 -1
- package/dist/core/run-annotation.d.ts +79 -0
- package/dist/core/run-annotation.d.ts.map +1 -0
- package/dist/core/run-annotation.js +125 -0
- package/dist/core/run-annotation.js.map +1 -0
- package/dist/core/workflow-run.d.ts +1 -1
- package/dist/core/workflow-run.d.ts.map +1 -1
- package/dist/core/workflow-run.js.map +1 -1
- package/dist/hooks/api/annotations.d.ts +63 -0
- package/dist/hooks/api/annotations.d.ts.map +1 -0
- package/dist/hooks/api/annotations.js +145 -0
- package/dist/hooks/api/annotations.js.map +1 -0
- package/dist/hooks/api/run-annotation-mapper.d.ts +10 -0
- package/dist/hooks/api/run-annotation-mapper.d.ts.map +1 -0
- package/dist/hooks/api/run-annotation-mapper.js +22 -0
- package/dist/hooks/api/run-annotation-mapper.js.map +1 -0
- package/dist/hooks/api/run-annotations.d.ts +25 -0
- package/dist/hooks/api/run-annotations.d.ts.map +1 -0
- package/dist/hooks/api/run-annotations.js +78 -0
- package/dist/hooks/api/run-annotations.js.map +1 -0
- package/dist/hooks/api/step-attempt-detail.d.ts +14 -0
- package/dist/hooks/api/step-attempt-detail.d.ts.map +1 -0
- package/dist/hooks/api/step-attempt-detail.js +43 -0
- package/dist/hooks/api/step-attempt-detail.js.map +1 -0
- package/dist/hooks/api/workflow-run-mapper.d.ts +9 -2
- package/dist/hooks/api/workflow-run-mapper.d.ts.map +1 -1
- package/dist/hooks/api/workflow-run-mapper.js +47 -0
- package/dist/hooks/api/workflow-run-mapper.js.map +1 -1
- package/dist/pages/project-workflows-page.js +19 -19
- package/dist/pages/project-workflows-page.js.map +1 -1
- package/dist/pages/workflow-run-list-page.js +1 -1
- package/dist/pages/workflow-run-list-page.js.map +1 -1
- package/dist/routes/inputs.d.ts +7 -2
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +5 -6
- package/dist/routes/inputs.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/src/components/identifier/identifier.tsx +2 -2
- package/src/components/job-detail/agent-config-failure-callout.tsx +5 -1
- package/src/components/job-detail/job-context-panel.test.tsx +72 -0
- package/src/components/job-detail/job-context-panel.tsx +237 -0
- package/src/components/job-detail/job-detail-header.test.tsx +3 -0
- package/src/components/job-detail/job-detail-header.tsx +65 -34
- package/src/components/job-detail/job-detail-view.stories.tsx +555 -48
- package/src/components/job-detail/job-detail-view.tsx +101 -42
- package/src/components/job-detail/job-empty-states.tsx +23 -10
- package/src/components/job-detail/job-execution-switcher.tsx +5 -5
- package/src/components/job-detail/json-code.tsx +120 -0
- package/src/components/job-detail/step-attempt-log-panel.test.tsx +1 -0
- package/src/components/job-detail/step-attempt-log-panel.tsx +17 -6
- package/src/components/job-detail/step-troubleshooting.stories.tsx +120 -0
- package/src/components/job-detail/step-troubleshooting.test.tsx +337 -0
- package/src/components/job-detail/step-troubleshooting.tsx +537 -0
- package/src/components/job-graph/job-graph-content.tsx +4 -3
- package/src/components/job-graph/job-node.tsx +3 -3
- package/src/components/step-list/index.ts +1 -0
- package/src/components/step-list/step-list-model.ts +5 -0
- package/src/components/step-list/step-list.test.tsx +75 -2
- package/src/components/step-list/step-list.tsx +73 -20
- package/src/components/workflow-run-duration-label.tsx +1 -1
- package/src/components/workflow-run-list/job-status-strip.tsx +6 -6
- package/src/components/workflow-run-list/workflow-run-filter-menu.tsx +1 -1
- package/src/components/workflow-run-list/workflow-run-filters.tsx +4 -4
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +6 -6
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +1 -1
- package/src/components/workflow-run-list/workflow-run-row.tsx +7 -7
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +1 -1
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +12 -12
- package/src/components/workflow-run-tabs/index.ts +7 -0
- package/src/components/workflow-run-tabs/run-annotation-count-chip.tsx +63 -0
- package/src/components/workflow-run-tabs/run-annotation-item.tsx +123 -0
- package/src/components/workflow-run-tabs/run-annotation-list.tsx +273 -0
- package/src/components/workflow-run-tabs/run-annotation-summary-line.test.tsx +77 -3
- package/src/components/workflow-run-tabs/run-annotation-summary-line.tsx +95 -20
- package/src/components/workflow-run-tabs/run-annotations.stories.tsx +293 -0
- package/src/components/workflow-run-tabs/severity-visuals.ts +37 -0
- package/src/components/workflow-run-view/run-workspace-nav.test.tsx +44 -0
- package/src/components/workflow-run-view/run-workspace-nav.tsx +22 -9
- package/src/components/workflow-run-view/workflow-run-states.tsx +6 -6
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +246 -20
- package/src/components/workflow-run-view/workflow-run-view.tsx +255 -37
- package/src/core/entities/job-execution.ts +7 -0
- package/src/core/entities/job.ts +9 -0
- package/src/core/entities/step-attempt.ts +33 -0
- package/src/core/entities/step.ts +3 -1
- package/src/core/run-annotation.test.ts +315 -0
- package/src/core/run-annotation.ts +244 -0
- package/src/core/workflow-run.ts +4 -0
- package/src/hooks/api/annotations.test.ts +84 -0
- package/src/hooks/api/annotations.ts +240 -0
- package/src/hooks/api/run-annotation-mapper.ts +30 -0
- package/src/hooks/api/run-annotations.ts +137 -0
- package/src/hooks/api/step-attempt-detail.ts +67 -0
- package/src/hooks/api/workflow-run-mapper.ts +46 -0
- package/src/hooks/api/workflow-runs.test.tsx +61 -1
- package/src/pages/project-workflows-page.tsx +19 -19
- package/src/pages/workflow-job-detail-page.test.tsx +118 -1
- package/src/pages/workflow-run-list-page.tsx +1 -1
- package/src/routes/inputs.ts +7 -2
- package/test/fixtures/workflow-run.ts +7 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/dist/core/workflow-run-tabs.d.ts +0 -9
- package/dist/core/workflow-run-tabs.d.ts.map +0 -1
- package/dist/core/workflow-run-tabs.js +0 -3
- package/dist/core/workflow-run-tabs.js.map +0 -1
- package/src/core/workflow-run-tabs.ts +0 -8
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-workflows",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "17.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -27,15 +27,16 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@swc/helpers": "^0.5.17",
|
|
29
29
|
"date-fns": "^4.1.0",
|
|
30
|
-
"@shipfox/
|
|
31
|
-
"@shipfox/api-
|
|
30
|
+
"@shipfox/annotations-dto": "12.3.0",
|
|
31
|
+
"@shipfox/api-definitions-dto": "12.3.0",
|
|
32
|
+
"@shipfox/api-workflows-dto": "12.3.0",
|
|
32
33
|
"@shipfox/client-api": "6.0.1",
|
|
33
|
-
"@shipfox/client-logs": "
|
|
34
|
-
"@shipfox/client-projects": "
|
|
35
|
-
"@shipfox/client-shell": "
|
|
36
|
-
"@shipfox/client-triggers": "
|
|
37
|
-
"@shipfox/client-ui": "
|
|
38
|
-
"@shipfox/react-ui": "1.
|
|
34
|
+
"@shipfox/client-logs": "17.0.0",
|
|
35
|
+
"@shipfox/client-projects": "17.0.0",
|
|
36
|
+
"@shipfox/client-shell": "17.0.0",
|
|
37
|
+
"@shipfox/client-triggers": "17.0.0",
|
|
38
|
+
"@shipfox/client-ui": "17.0.0",
|
|
39
|
+
"@shipfox/react-ui": "1.2.0"
|
|
39
40
|
},
|
|
40
41
|
"peerDependencies": {
|
|
41
42
|
"@tanstack/react-query": "^5.101.0",
|
|
@@ -112,7 +112,7 @@ export function Identifier({
|
|
|
112
112
|
onClick={() => {
|
|
113
113
|
void handleCopy();
|
|
114
114
|
}}
|
|
115
|
-
className="inline-flex h-20 min-w-0 shrink-0 items-center gap-
|
|
115
|
+
className="inline-flex h-20 min-w-0 shrink-0 items-center gap-tight rounded-4 px-[var(--pad-menu-surface)] text-foreground-neutral-muted outline-none transition-colors hover:bg-background-components-hover hover:text-foreground-neutral-base focus-visible:shadow-border-interactive-with-active"
|
|
116
116
|
>
|
|
117
117
|
<Icon name="copy" aria-hidden="true" className="size-12 shrink-0" />
|
|
118
118
|
<Code as="span" variant="label" className="truncate">
|
|
@@ -167,7 +167,7 @@ function CopyFeedbackPortal({
|
|
|
167
167
|
: `translate(-50%, ${COPY_FEEDBACK_OFFSET_PX}px)`,
|
|
168
168
|
}}
|
|
169
169
|
className={cn(
|
|
170
|
-
'pointer-events-none fixed z-50 whitespace-nowrap rounded-8 bg-background-components-base px-
|
|
170
|
+
'pointer-events-none fixed z-50 whitespace-nowrap rounded-8 bg-background-components-base px-tight py-[4px] text-xs font-display font-medium leading-20 shadow-tooltip',
|
|
171
171
|
kind === 'failed' ? 'text-foreground-highlight-error' : 'text-foreground-neutral-base',
|
|
172
172
|
)}
|
|
173
173
|
>
|
|
@@ -21,7 +21,11 @@ export function AgentConfigFailureCallout({
|
|
|
21
21
|
const copy = agentConfigFailureCopy(config, error);
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
|
-
<Alert
|
|
24
|
+
<Alert
|
|
25
|
+
variant="warning"
|
|
26
|
+
animated={false}
|
|
27
|
+
className="rounded-none border-x-0 border-t-0 border-b border-tag-warning-border bg-transparent px-0 py-row"
|
|
28
|
+
>
|
|
25
29
|
<AlertContent>
|
|
26
30
|
<AlertTitle>{copy.title}</AlertTitle>
|
|
27
31
|
<AlertDescription>{copy.description}</AlertDescription>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {render, screen, within} from '@testing-library/react';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import {workflowJob, workflowJobExecutionDto} from '#test/fixtures/workflow-run.js';
|
|
4
|
+
import {JobContextPanel} from './job-context-panel.js';
|
|
5
|
+
|
|
6
|
+
describe('JobContextPanel', () => {
|
|
7
|
+
test('opens job details in a labelled sheet from the info action', async () => {
|
|
8
|
+
const user = userEvent.setup();
|
|
9
|
+
const job = workflowJob({
|
|
10
|
+
name: 'build',
|
|
11
|
+
runner: ['runner-linux-x64'],
|
|
12
|
+
job_executions: [
|
|
13
|
+
workflowJobExecutionDto({
|
|
14
|
+
status: 'succeeded',
|
|
15
|
+
outputs: {failed_tests: 4},
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
const execution = job.jobExecutions[0];
|
|
20
|
+
if (!execution) throw new Error('Test fixture is missing a job execution.');
|
|
21
|
+
|
|
22
|
+
render(<JobContextPanel job={job} execution={execution} />);
|
|
23
|
+
|
|
24
|
+
expect(screen.queryByRole('dialog', {name: 'build'})).not.toBeInTheDocument();
|
|
25
|
+
await user.click(screen.getByRole('button', {name: 'Inspect job details'}));
|
|
26
|
+
|
|
27
|
+
const dialog = await screen.findByRole('dialog', {name: 'build'});
|
|
28
|
+
expect(within(dialog).getByText('Runner')).toBeInTheDocument();
|
|
29
|
+
expect(within(dialog).getAllByText('Outputs')).not.toHaveLength(0);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test('separates execution-name traces from job condition traces', async () => {
|
|
33
|
+
const user = userEvent.setup();
|
|
34
|
+
const job = workflowJob({
|
|
35
|
+
name: 'build',
|
|
36
|
+
evaluation_trace: [
|
|
37
|
+
{
|
|
38
|
+
expression: 'inputs.environment == "production"',
|
|
39
|
+
roots: ['inputs.environment'],
|
|
40
|
+
fill_target: 'job-activation',
|
|
41
|
+
evaluated_at: '2026-08-05T12:00:00.000Z',
|
|
42
|
+
field: 'job.if',
|
|
43
|
+
value: 'true',
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
job_executions: [
|
|
47
|
+
workflowJobExecutionDto({
|
|
48
|
+
status: 'succeeded',
|
|
49
|
+
evaluation_trace: [
|
|
50
|
+
{
|
|
51
|
+
expression: 'inputs.environment',
|
|
52
|
+
roots: ['inputs.environment'],
|
|
53
|
+
fill_target: 'execution-creation',
|
|
54
|
+
evaluated_at: '2026-08-05T12:00:00.000Z',
|
|
55
|
+
field: 'job.execution_name',
|
|
56
|
+
value: 'production',
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
const execution = job.jobExecutions[0];
|
|
63
|
+
if (!execution) throw new Error('Test fixture is missing a job execution.');
|
|
64
|
+
|
|
65
|
+
render(<JobContextPanel job={job} execution={execution} />);
|
|
66
|
+
await user.click(screen.getByRole('button', {name: 'Inspect job details'}));
|
|
67
|
+
|
|
68
|
+
const dialog = await screen.findByRole('dialog', {name: 'build'});
|
|
69
|
+
expect(within(dialog).getByText('Execution name evaluation (1)')).toBeInTheDocument();
|
|
70
|
+
expect(within(dialog).getByText('Condition evaluation (1)')).toBeInTheDocument();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {Icon} from '@shipfox/react-ui/icon';
|
|
2
|
+
import {
|
|
3
|
+
Sheet,
|
|
4
|
+
SheetBody,
|
|
5
|
+
SheetContent,
|
|
6
|
+
SheetDescription,
|
|
7
|
+
SheetHeader,
|
|
8
|
+
SheetTitle,
|
|
9
|
+
} from '@shipfox/react-ui/sheet';
|
|
10
|
+
import {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';
|
|
11
|
+
import {Code, Text} from '@shipfox/react-ui/typography';
|
|
12
|
+
import {useState} from 'react';
|
|
13
|
+
import type {EvaluationTraceEntry, Job, JobExecution} from '#core/workflow-run.js';
|
|
14
|
+
import {formatJobExecutionTime} from './job-execution-time-text.js';
|
|
15
|
+
import {JsonCode} from './json-code.js';
|
|
16
|
+
import {EvaluationTrace} from './step-troubleshooting.js';
|
|
17
|
+
|
|
18
|
+
export function JobContextPanel({job, execution}: {job: Job; execution: JobExecution}) {
|
|
19
|
+
const runner = execution.runner?.length ? execution.runner : job.runner;
|
|
20
|
+
const outputs = execution.outputs ?? job.outputs;
|
|
21
|
+
const trace = [...(job.evaluationTrace ?? []), ...(execution.evaluationTrace ?? [])];
|
|
22
|
+
const statusReason = execution.statusReason ?? job.statusReason;
|
|
23
|
+
const hasTiming = Boolean(execution.queueTime || execution.runTime);
|
|
24
|
+
const hasContext = Boolean(
|
|
25
|
+
runner?.length ||
|
|
26
|
+
outputs ||
|
|
27
|
+
execution.triggerEvents.length ||
|
|
28
|
+
job.success ||
|
|
29
|
+
statusReason ||
|
|
30
|
+
trace?.length ||
|
|
31
|
+
hasTiming,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (!hasContext) return null;
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<JobContextSheet
|
|
38
|
+
job={job}
|
|
39
|
+
execution={execution}
|
|
40
|
+
runner={runner}
|
|
41
|
+
outputs={outputs}
|
|
42
|
+
trace={trace}
|
|
43
|
+
statusReason={statusReason}
|
|
44
|
+
/>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function JobContextSheet({
|
|
49
|
+
job,
|
|
50
|
+
execution,
|
|
51
|
+
runner,
|
|
52
|
+
outputs,
|
|
53
|
+
trace,
|
|
54
|
+
statusReason,
|
|
55
|
+
}: {
|
|
56
|
+
job: Job;
|
|
57
|
+
execution: JobExecution;
|
|
58
|
+
runner: string[] | null;
|
|
59
|
+
outputs: Record<string, unknown> | null;
|
|
60
|
+
trace: EvaluationTraceEntry[];
|
|
61
|
+
statusReason: JobExecution['statusReason'];
|
|
62
|
+
}) {
|
|
63
|
+
const [open, setOpen] = useState(false);
|
|
64
|
+
const {conditionTrace, executionNameTrace} = splitJobEvaluationTrace(trace);
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
68
|
+
<Tooltip>
|
|
69
|
+
<TooltipTrigger asChild>
|
|
70
|
+
<button
|
|
71
|
+
type="button"
|
|
72
|
+
aria-label="Inspect job details"
|
|
73
|
+
onClick={() => setOpen(true)}
|
|
74
|
+
className="flex size-28 shrink-0 items-center justify-center rounded-4 bg-transparent text-foreground-neutral-muted outline-none transition-colors hover:bg-transparent hover:text-foreground-neutral-base active:bg-transparent focus-visible:shadow-button-neutral-focus"
|
|
75
|
+
>
|
|
76
|
+
<Icon name="informationLine" size={14} aria-hidden="true" />
|
|
77
|
+
</button>
|
|
78
|
+
</TooltipTrigger>
|
|
79
|
+
<TooltipContent>Inspect job details</TooltipContent>
|
|
80
|
+
</Tooltip>
|
|
81
|
+
<SheetContent side="right" className="w-full sm:max-w-[560px]">
|
|
82
|
+
<SheetHeader>
|
|
83
|
+
<SheetTitle>{job.displayName}</SheetTitle>
|
|
84
|
+
<SheetDescription>
|
|
85
|
+
Execution #{execution.sequence} · {execution.displayName}
|
|
86
|
+
</SheetDescription>
|
|
87
|
+
</SheetHeader>
|
|
88
|
+
<SheetBody className="gap-section">
|
|
89
|
+
<div className="grid w-full min-w-0 gap-group min-[640px]:grid-cols-2">
|
|
90
|
+
{runner?.length ? <ContextList label="Runner" values={runner} mono /> : null}
|
|
91
|
+
{execution.queueTime || execution.runTime ? (
|
|
92
|
+
<div className="flex min-w-0 flex-col gap-tight">
|
|
93
|
+
<Text size="xs" bold className="text-foreground-neutral-base">
|
|
94
|
+
Timing
|
|
95
|
+
</Text>
|
|
96
|
+
<div className="flex flex-wrap gap-inline text-xs text-foreground-neutral-muted">
|
|
97
|
+
{execution.queueTime ? (
|
|
98
|
+
<span>Queue {formatJobExecutionTime(execution.queueTime)}</span>
|
|
99
|
+
) : null}
|
|
100
|
+
{execution.runTime ? (
|
|
101
|
+
<span>Run {formatJobExecutionTime(execution.runTime)}</span>
|
|
102
|
+
) : null}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
) : null}
|
|
106
|
+
{outputs ? (
|
|
107
|
+
<JsonCode
|
|
108
|
+
title="Outputs"
|
|
109
|
+
value={outputs}
|
|
110
|
+
emptyMessage="No outputs declared; the `outputs:` mapping is empty."
|
|
111
|
+
/>
|
|
112
|
+
) : null}
|
|
113
|
+
{job.success ? <ContextValue label="Condition" value={job.success} mono /> : null}
|
|
114
|
+
{statusReason ? (
|
|
115
|
+
<ContextValue label="Status reason" value={humanize(statusReason)} />
|
|
116
|
+
) : null}
|
|
117
|
+
{execution.triggerEvents.length ? (
|
|
118
|
+
<JsonCode
|
|
119
|
+
title={`Trigger events (${execution.triggerEvents.length})`}
|
|
120
|
+
value={execution.triggerEvents}
|
|
121
|
+
/>
|
|
122
|
+
) : null}
|
|
123
|
+
{executionNameTrace.length ? (
|
|
124
|
+
<EvaluationTraceSection
|
|
125
|
+
title={`Execution name evaluation (${executionNameTrace.length})`}
|
|
126
|
+
trace={executionNameTrace}
|
|
127
|
+
/>
|
|
128
|
+
) : null}
|
|
129
|
+
{conditionTrace.length ? (
|
|
130
|
+
<EvaluationTraceSection
|
|
131
|
+
title={`Condition evaluation (${conditionTrace.length})`}
|
|
132
|
+
trace={conditionTrace}
|
|
133
|
+
/>
|
|
134
|
+
) : null}
|
|
135
|
+
</div>
|
|
136
|
+
</SheetBody>
|
|
137
|
+
</SheetContent>
|
|
138
|
+
</Sheet>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function EvaluationTraceSection({
|
|
143
|
+
title,
|
|
144
|
+
trace,
|
|
145
|
+
}: {
|
|
146
|
+
title: string;
|
|
147
|
+
trace: readonly EvaluationTraceEntry[];
|
|
148
|
+
}) {
|
|
149
|
+
return (
|
|
150
|
+
<div className="flex min-w-0 flex-col gap-tight">
|
|
151
|
+
<Text size="xs" bold className="text-foreground-neutral-base">
|
|
152
|
+
{title}
|
|
153
|
+
</Text>
|
|
154
|
+
<EvaluationTrace trace={trace} />
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function ContextValue({
|
|
160
|
+
label,
|
|
161
|
+
value,
|
|
162
|
+
mono = false,
|
|
163
|
+
}: {
|
|
164
|
+
label: string;
|
|
165
|
+
value: string;
|
|
166
|
+
mono?: boolean;
|
|
167
|
+
}) {
|
|
168
|
+
return (
|
|
169
|
+
<div className="flex min-w-0 flex-col gap-tight">
|
|
170
|
+
<Text size="xs" bold className="text-foreground-neutral-base">
|
|
171
|
+
{label}
|
|
172
|
+
</Text>
|
|
173
|
+
<Text
|
|
174
|
+
size="xs"
|
|
175
|
+
className={
|
|
176
|
+
mono
|
|
177
|
+
? 'break-words font-code text-foreground-neutral-muted'
|
|
178
|
+
: 'text-foreground-neutral-muted'
|
|
179
|
+
}
|
|
180
|
+
>
|
|
181
|
+
{value}
|
|
182
|
+
</Text>
|
|
183
|
+
</div>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function ContextList({
|
|
188
|
+
label,
|
|
189
|
+
values,
|
|
190
|
+
mono = false,
|
|
191
|
+
}: {
|
|
192
|
+
label: string;
|
|
193
|
+
values: string[];
|
|
194
|
+
mono?: boolean;
|
|
195
|
+
}) {
|
|
196
|
+
return (
|
|
197
|
+
<div className="flex min-w-0 flex-col gap-tight">
|
|
198
|
+
<Text size="xs" bold className="text-foreground-neutral-base">
|
|
199
|
+
{label}
|
|
200
|
+
</Text>
|
|
201
|
+
<div className="flex min-w-0 flex-wrap gap-tight">
|
|
202
|
+
{values.map((value) => (
|
|
203
|
+
<Code
|
|
204
|
+
key={value}
|
|
205
|
+
as="span"
|
|
206
|
+
variant="label"
|
|
207
|
+
className={mono ? 'text-foreground-neutral-muted' : 'text-foreground-neutral-base'}
|
|
208
|
+
>
|
|
209
|
+
{value}
|
|
210
|
+
</Code>
|
|
211
|
+
))}
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function humanize(value: string): string {
|
|
218
|
+
return value.replaceAll('_', ' ').replace(/\b\w/g, (letter) => letter.toUpperCase());
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function splitJobEvaluationTrace(trace: readonly EvaluationTraceEntry[]): {
|
|
222
|
+
conditionTrace: EvaluationTraceEntry[];
|
|
223
|
+
executionNameTrace: EvaluationTraceEntry[];
|
|
224
|
+
} {
|
|
225
|
+
const conditionTrace: EvaluationTraceEntry[] = [];
|
|
226
|
+
const executionNameTrace: EvaluationTraceEntry[] = [];
|
|
227
|
+
|
|
228
|
+
for (const entry of trace) {
|
|
229
|
+
if (!('dropped' in entry) && entry.field === 'job.execution_name') {
|
|
230
|
+
executionNameTrace.push(entry);
|
|
231
|
+
} else {
|
|
232
|
+
conditionTrace.push(entry);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return {conditionTrace, executionNameTrace};
|
|
237
|
+
}
|
|
@@ -2,8 +2,10 @@ import {Icon} from '@shipfox/react-ui/icon';
|
|
|
2
2
|
import {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';
|
|
3
3
|
import {Code, Text} from '@shipfox/react-ui/typography';
|
|
4
4
|
import {formatTimestamp} from '@shipfox/react-ui/utils';
|
|
5
|
+
import type {ReactNode} from 'react';
|
|
5
6
|
import {getWorkflowStatusVisual} from '#components/workflow-status/status-visuals.js';
|
|
6
7
|
import {WorkflowStatusIcon} from '#components/workflow-status/workflow-status-icon.js';
|
|
8
|
+
import type {RunAnnotationSummary} from '#core/run-annotation.js';
|
|
7
9
|
import {
|
|
8
10
|
defaultJobExecution,
|
|
9
11
|
deriveJobDisplayStatus,
|
|
@@ -11,6 +13,7 @@ import {
|
|
|
11
13
|
type Job,
|
|
12
14
|
type JobExecution,
|
|
13
15
|
} from '#core/workflow-run.js';
|
|
16
|
+
import {RunAnnotationCountChip} from '../workflow-run-tabs/index.js';
|
|
14
17
|
import {JobExecutionSwitcher} from './job-execution-switcher.js';
|
|
15
18
|
import {JobExecutionTimeText} from './job-execution-time-text.js';
|
|
16
19
|
|
|
@@ -18,52 +21,80 @@ export interface JobDetailHeaderProps {
|
|
|
18
21
|
job: Job;
|
|
19
22
|
selectedJobExecution: JobExecution | undefined;
|
|
20
23
|
onSelectedJobExecutionChange: (jobExecutionId: string) => void;
|
|
24
|
+
workspaceSlug: string;
|
|
25
|
+
projectSlug: string;
|
|
26
|
+
workflowRunId: string;
|
|
27
|
+
runAttempt?: number | undefined;
|
|
28
|
+
/** Counts for this job only. Renders a link into the run's Annotations section, never a body. */
|
|
29
|
+
annotationSummary?: RunAnnotationSummary | undefined;
|
|
30
|
+
jobContext?: ReactNode;
|
|
21
31
|
}
|
|
22
32
|
|
|
23
33
|
export function JobDetailHeader({
|
|
24
34
|
job,
|
|
25
35
|
selectedJobExecution,
|
|
26
36
|
onSelectedJobExecutionChange,
|
|
37
|
+
workspaceSlug,
|
|
38
|
+
projectSlug,
|
|
39
|
+
workflowRunId,
|
|
40
|
+
runAttempt,
|
|
41
|
+
annotationSummary,
|
|
42
|
+
jobContext,
|
|
27
43
|
}: JobDetailHeaderProps) {
|
|
28
44
|
const selectedStatus = selectedExecutionStatus(job, selectedJobExecution);
|
|
29
45
|
const jobStatus = getWorkflowStatusVisual(selectedStatus);
|
|
30
46
|
|
|
31
47
|
return (
|
|
32
|
-
<header className="border-b border-border-neutral-base px-
|
|
33
|
-
<div className="flex min-w-0
|
|
34
|
-
<div className="flex min-w-0
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
<header className="border-b border-border-neutral-base px-row py-row">
|
|
49
|
+
<div className="flex min-w-0 items-start justify-between gap-cluster">
|
|
50
|
+
<div className="flex min-w-0 flex-col gap-inline">
|
|
51
|
+
<div className="flex min-w-0 items-center gap-inline">
|
|
52
|
+
<WorkflowStatusIcon
|
|
53
|
+
status={selectedStatus}
|
|
54
|
+
size={14}
|
|
55
|
+
tooltip
|
|
56
|
+
ariaLabel={`Job status: ${jobStatus.label}`}
|
|
57
|
+
/>
|
|
58
|
+
<Code
|
|
59
|
+
as="h1"
|
|
60
|
+
variant="paragraph"
|
|
61
|
+
bold
|
|
62
|
+
tabIndex={-1}
|
|
63
|
+
className="min-w-0 truncate text-lg leading-24 text-foreground-neutral-base outline-none"
|
|
64
|
+
data-job-heading
|
|
65
|
+
>
|
|
66
|
+
{job.displayName}
|
|
67
|
+
</Code>
|
|
68
|
+
</div>
|
|
52
69
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
{selectedJobExecution || annotationSummary?.total ? (
|
|
71
|
+
<div className="flex min-w-0 flex-wrap items-center gap-inline text-foreground-neutral-muted">
|
|
72
|
+
{selectedJobExecution && job.executionCountVisible ? (
|
|
73
|
+
<JobExecutionSwitcher
|
|
74
|
+
job={job}
|
|
75
|
+
selectedJobExecution={selectedJobExecution.id}
|
|
76
|
+
onSelectedJobExecutionChange={onSelectedJobExecutionChange}
|
|
77
|
+
variant="title"
|
|
78
|
+
/>
|
|
79
|
+
) : null}
|
|
80
|
+
{selectedJobExecution ? (
|
|
81
|
+
<>
|
|
82
|
+
<JobDurationMeta execution={selectedJobExecution} kind="queue" />
|
|
83
|
+
<JobDurationMeta execution={selectedJobExecution} kind="run" />
|
|
84
|
+
</>
|
|
85
|
+
) : null}
|
|
86
|
+
<RunAnnotationCountChip
|
|
87
|
+
summary={annotationSummary}
|
|
88
|
+
workspaceSlug={workspaceSlug}
|
|
89
|
+
projectSlug={projectSlug}
|
|
90
|
+
workflowRunId={workflowRunId}
|
|
91
|
+
runAttempt={runAttempt}
|
|
92
|
+
jobId={job.id}
|
|
61
93
|
/>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
) : null}
|
|
94
|
+
</div>
|
|
95
|
+
) : null}
|
|
96
|
+
</div>
|
|
97
|
+
{jobContext}
|
|
67
98
|
</div>
|
|
68
99
|
</header>
|
|
69
100
|
);
|
|
@@ -91,7 +122,7 @@ function JobDurationMeta({execution, kind}: {execution: JobExecution; kind: 'que
|
|
|
91
122
|
return (
|
|
92
123
|
<Tooltip>
|
|
93
124
|
<TooltipTrigger asChild>
|
|
94
|
-
<span className="inline-flex items-center gap-
|
|
125
|
+
<span className="inline-flex items-center gap-tight whitespace-nowrap font-code text-xs leading-20 tabular-nums">
|
|
95
126
|
<Icon
|
|
96
127
|
name={kind === 'queue' ? 'hourglassLine' : 'timerLine'}
|
|
97
128
|
size={12}
|