Skip to content

Commit

Permalink
fix: node executions list going blank (#788)
Browse files Browse the repository at this point in the history
* fix: node executions list going blank

Signed-off-by: Carina Ursu <[email protected]>

* chore: don't allow gad parsing issues to crash the node execution view

Signed-off-by: Carina Ursu <[email protected]>

---------

Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina authored Jul 10, 2023
1 parent e2fd2a4 commit f6d5fb9
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flyteorg/console",
"version": "0.0.39",
"version": "0.0.40",
"description": "Flyteconsole main app module",
"main": "./dist/index.js",
"module": "./lib/index.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TaskExecutionDetails } from '../TaskExecutionDetails';
const date = { seconds: long(5), nanos: 0 };
const duration = { seconds: long(0), nanos: 0 };

const dateContent = '1/1/1970 12:00:05 AM UTC (53 years ago)';
const dateContent = '1/1/1970 12:00:05 AM UTC';

describe('TaskExecutionDetails', () => {
it('should render details with task started info and duration', () => {
Expand All @@ -17,7 +17,7 @@ describe('TaskExecutionDetails', () => {

expect(queryByText('started')).toBeInTheDocument();
expect(queryByText('last updated')).not.toBeInTheDocument();
expect(queryByText(dateContent)).toBeInTheDocument();
expect(queryByText(dateContent, { exact: false })).toBeInTheDocument();
expect(queryByText('run time')).toBeInTheDocument();
expect(queryByText('0s')).toBeInTheDocument();
});
Expand All @@ -27,7 +27,7 @@ describe('TaskExecutionDetails', () => {

expect(queryByText('started')).toBeInTheDocument();
expect(queryByText('last updated')).not.toBeInTheDocument();
expect(queryByText(dateContent)).toBeInTheDocument();
expect(queryByText(dateContent, { exact: false })).toBeInTheDocument();
expect(queryByText('run time')).toBeInTheDocument();
expect(queryByText(unknownValueString)).toBeInTheDocument();
});
Expand All @@ -39,7 +39,7 @@ describe('TaskExecutionDetails', () => {

expect(queryByText('started')).not.toBeInTheDocument();
expect(queryByText('last updated')).toBeInTheDocument();
expect(queryByText(dateContent)).toBeInTheDocument();
expect(queryByText(dateContent, { exact: false })).toBeInTheDocument();
expect(queryByText('run time')).not.toBeInTheDocument();
expect(queryByText('0s')).not.toBeInTheDocument();
});
Expand All @@ -49,7 +49,7 @@ describe('TaskExecutionDetails', () => {

expect(queryByText('started')).not.toBeInTheDocument();
expect(queryByText('last updated')).toBeInTheDocument();
expect(queryByText(dateContent)).toBeInTheDocument();
expect(queryByText(dateContent, { exact: false })).toBeInTheDocument();
expect(queryByText('run time')).not.toBeInTheDocument();
expect(queryByText(unknownValueString)).not.toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,15 @@ export const WorkflowNodeExecutionsProvider = ({
nodeExecutionsById,
)
: { dag: {} as dNode, staticExecutionIdsMap: {}, error: undefined };

const { dag, staticExecutionIdsMap, error } = dagData;

if (error) {
// if an error occured, stop processing
setDagError(error);
return;
}

const nodes = dag?.nodes ?? [];

let newMergedDag = dag;
Expand All @@ -117,7 +125,6 @@ export const WorkflowNodeExecutionsProvider = ({
}
}
}
setDagError(error);
setMergedDag(prev => {
if (stringifyIsEqual(prev, newMergedDag)) {
return prev;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ const parseNode = ({
const subId = subworkflow.template.id;
if (getSubWorkflowFromId(subId, workflow) === false) {
workflow.subWorkflows?.push(subworkflow);
workflow.tasks?.push(...subworkflow.compiledWorkflow.tasks);
workflow.tasks?.push(
...(subworkflow?.compiledWorkflow?.tasks || []),
);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@flyteorg/common": "^0.0.4",
"@flyteorg/console": "^0.0.39",
"@flyteorg/console": "^0.0.40",
"long": "^4.0.0",
"protobufjs": "~6.11.3",
"react-ga4": "^1.4.1",
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ __metadata:
resolution: "@flyteconsole/client-app@workspace:website"
dependencies:
"@flyteorg/common": ^0.0.4
"@flyteorg/console": ^0.0.39
"@flyteorg/console": ^0.0.40
"@types/long": ^3.0.32
long: ^4.0.0
protobufjs: ~6.11.3
Expand Down Expand Up @@ -2059,7 +2059,7 @@ __metadata:
languageName: unknown
linkType: soft

"@flyteorg/console@^0.0.39, @flyteorg/console@workspace:packages/console":
"@flyteorg/console@^0.0.40, @flyteorg/console@workspace:packages/console":
version: 0.0.0-use.local
resolution: "@flyteorg/console@workspace:packages/console"
dependencies:
Expand Down

0 comments on commit f6d5fb9

Please sign in to comment.