Skip to content

Commit b686df9

Browse files
blaketastic2Blake Jackson
andauthored
feat: Execution Detail Page Link to Parent (#881)
link to the parent Signed-off-by: Blake Jackson <blake@ip-192-168-0-102.ec2.internal> Co-authored-by: Blake Jackson <blake@ip-192-168-0-102.ec2.internal>
1 parent a24c4d3 commit b686df9

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

packages/oss-console/src/components/Executions/ExecutionDetails/ExecutionMetadata.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export const ExecutionMetadata: React.FC<{}> = () => {
6969
const startedAt = execution?.closure?.startedAt;
7070
const workflowId = execution?.closure?.workflowId;
7171

72-
const { referenceExecution, systemMetadata } = execution.spec.metadata;
72+
const {
73+
referenceExecution,
74+
systemMetadata ,
75+
parentNodeExecution,
76+
} = execution.spec.metadata;
7377
const cluster = systemMetadata?.executionCluster ?? dashedValueString;
7478

7579
const details: DetailItem[] = [
@@ -107,6 +111,20 @@ export const ExecutionMetadata: React.FC<{}> = () => {
107111
});
108112
}
109113

114+
if (parentNodeExecution != null && parentNodeExecution.executionId != null) {
115+
details.push({
116+
label: ExecutionMetadataLabels.parent,
117+
value: (
118+
<RouterLink
119+
className={commonStyles.primaryLinks}
120+
to={Routes.ExecutionDetails.makeUrl(parentNodeExecution.executionId)}
121+
>
122+
{parentNodeExecution.executionId.name}
123+
</RouterLink>
124+
)
125+
})
126+
}
127+
110128
return (
111129
<StyledContainer>
112130
<Grid container className="detailsContainer" spacing={4}>

packages/oss-console/src/components/Executions/ExecutionDetails/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export enum ExecutionMetadataLabels {
1212
securityContextDefault = 'default',
1313
interruptible = 'Interruptible override',
1414
overwriteCache = 'Overwrite cached outputs',
15+
parent = 'Parent',
1516
}
1617

1718
export const tabs = {

packages/oss-console/src/components/Executions/ExecutionDetails/test/ExecutionMetadata.test.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { render } from '@testing-library/react';
1+
import { getByTestId, render } from '@testing-library/react';
22
import Protobuf from '@clients/common/flyteidl/protobuf';
33
import * as React from 'react';
44
import { MemoryRouter } from 'react-router';
@@ -14,6 +14,8 @@ const startTimeTestId = `metadata-${ExecutionMetadataLabels.time}`;
1414
const durationTestId = `metadata-${ExecutionMetadataLabels.duration}`;
1515
const interruptibleTestId = `metadata-${ExecutionMetadataLabels.interruptible}`;
1616
const overwriteCacheTestId = `metadata-${ExecutionMetadataLabels.overwriteCache}`;
17+
const relatedToTestId = `metadata-${ExecutionMetadataLabels.relatedTo}`;
18+
const parentNodeExecutionTestId = `metadata-${ExecutionMetadataLabels.parent}`
1719

1820
jest.mock('../../../../models/Launch/api', () => ({
1921
getLaunchPlan: jest.fn(() => Promise.resolve({ spec: {} })),
@@ -106,4 +108,14 @@ describe('ExecutionMetadata', () => {
106108
const { getByTestId } = renderMetadata();
107109
expect(getByTestId(overwriteCacheTestId)).toHaveTextContent('false');
108110
});
111+
112+
it('shows related to if metadata is available', () => {
113+
const { getByTestId } = renderMetadata();
114+
expect(getByTestId(relatedToTestId)).toHaveTextContent('name');
115+
})
116+
117+
it('shows parent execution if metadata is available', () => {
118+
const { getByTestId } = renderMetadata();
119+
expect(getByTestId(parentNodeExecutionTestId)).toHaveTextContent('name');
120+
})
109121
});

packages/oss-console/src/models/__mocks__/executionsData.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ export const MOCK_WORKFLOW_ID = {
2121
version: 'version',
2222
};
2323

24+
export const MOCK_EXECUTION_ID = {
25+
project: 'project',
26+
domain: 'domain',
27+
name: 'name',
28+
}
29+
2430
export function fixedDuration(): Protobuf.Duration {
2531
return {
2632
nanos: 0,
@@ -77,6 +83,15 @@ export function generateExecutionMetadata(): ExecutionMetadata {
7783
systemMetadata: {
7884
executionCluster: 'flyte',
7985
},
86+
referenceExecution: {
87+
...MOCK_EXECUTION_ID
88+
},
89+
parentNodeExecution: {
90+
nodeId: 'node',
91+
executionId: {
92+
...MOCK_EXECUTION_ID
93+
}
94+
},
8095
};
8196
}
8297

0 commit comments

Comments
 (0)