diff --git a/package.json b/package.json index 17080f068..afd45fd9a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ ] }, "dependencies": { - "@flyteorg/flyteidl": "https://github.com/flyteorg/flyteidl.git#feature/gate-nodes" + "@flyteorg/flyteidl": "1.2.1" }, "devDependencies": { "@storybook/addon-actions": "^6.4.19", diff --git a/packages/zapp/console/package.json b/packages/zapp/console/package.json index 29cdc8739..f2674a50e 100644 --- a/packages/zapp/console/package.json +++ b/packages/zapp/console/package.json @@ -57,7 +57,7 @@ "@commitlint/cli": "^8.3.5", "@commitlint/config-conventional": "^8.3.4", "@date-io/moment": "1.3.9", - "@flyteorg/flyteidl": "https://github.com/flyteorg/flyteidl.git#feature/gate-nodes", + "@flyteorg/flyteidl": "1.2.1", "@material-ui/core": "^4.0.0", "@material-ui/icons": "^4.0.0", "@material-ui/pickers": "^3.2.2", diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx index 8cf4f29f7..5b9c2f963 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionNodeViews.tsx @@ -54,7 +54,7 @@ interface WorkflowNodeExecution extends NodeExecution { logsByPhase?: LogsByPhase; } -export interface ExecutionNodeViewsProps { +interface ExecutionNodeViewsProps { execution: Execution; } diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx index c5dd4a50b..1616ab663 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTab.tsx @@ -9,7 +9,7 @@ import { useNodeExecutionContext } from '../contextProvider/NodeExecutionDetails import { ScaleProvider } from './Timeline/scaleContext'; import { ExecutionTabContent } from './ExecutionTabContent'; -export interface ExecutionTabProps { +interface ExecutionTabProps { tabType: string; filteredNodeExecutions?: NodeExecution[]; } diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx index db69cd778..21d418583 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionTabContent.tsx @@ -29,7 +29,7 @@ import { DetailsPanelContext } from './DetailsPanelContext'; import { useNodeExecutionFiltersState } from '../filters/useExecutionFiltersState'; import { nodeExecutionPhaseConstants } from '../constants'; -export interface ExecutionTabContentProps { +interface ExecutionTabContentProps { tabType: string; filteredNodeExecutions?: NodeExecution[]; } diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx index 68ef14786..6500bc803 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/NodeExecutionDetailsPanelContent.tsx @@ -241,7 +241,7 @@ export const NodeExecutionDetailsPanelContent: React.FC { let isCurrent = true; - detailsContext.getNodeExecutionDetails(nodeExecution).then((res) => { + getNodeExecutionDetails(nodeExecution).then((res) => { if (isCurrent) { setDetails(res); } diff --git a/packages/zapp/console/src/components/Executions/NodeExecutionCacheStatus.tsx b/packages/zapp/console/src/components/Executions/NodeExecutionCacheStatus.tsx index 11171b62e..1345ba684 100644 --- a/packages/zapp/console/src/components/Executions/NodeExecutionCacheStatus.tsx +++ b/packages/zapp/console/src/components/Executions/NodeExecutionCacheStatus.tsx @@ -7,7 +7,7 @@ import { isMapTaskType } from 'models/Task/utils'; import { useEffect, useState } from 'react'; import { CacheStatus } from './CacheStatus'; -export interface NodeExecutionCacheStatusProps { +interface NodeExecutionCacheStatusProps { execution: NodeExecution; /** `normal` will render an icon with description message beside it * `iconOnly` will render just the icon with the description as a tooltip @@ -27,12 +27,12 @@ export const NodeExecutionCacheStatus: React.FC = variant = 'normal', }) => { const taskNodeMetadata = execution.closure?.taskNodeMetadata; - const detailsContext = useNodeExecutionContext(); + const { getNodeExecutionDetails } = useNodeExecutionContext(); const [nodeDetails, setNodeDetails] = useState(); useEffect(() => { let isCurrent = true; - detailsContext.getNodeExecutionDetails(execution).then((res) => { + getNodeExecutionDetails(execution).then((res) => { if (isCurrent) { setNodeDetails(res); } diff --git a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx index 6074e7a17..5fbb68fda 100644 --- a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx +++ b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx @@ -48,9 +48,15 @@ export const NodeExecutionActions = ({ execution }: NodeExecutionActionsProps): ); useEffect(() => { + let isCurrent = true; getNodeExecutionDetails(execution).then((res) => { - setNodeExecutionDetails(res); + if (isCurrent) { + setNodeExecutionDetails(res); + } }); + return () => { + isCurrent = false; + }; }); useEffect(() => { diff --git a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx index d32c2104a..0fbe35edf 100644 --- a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx +++ b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionsTable.tsx @@ -19,7 +19,7 @@ import { useNodeExecutionContext } from '../contextProvider/NodeExecutionDetails import { NodeExecutionRow } from './NodeExecutionRow'; import { useNodeExecutionFiltersState } from '../filters/useExecutionFiltersState'; -export interface NodeExecutionsTableProps { +interface NodeExecutionsTableProps { initialNodes: dNode[]; filteredNodes?: dNode[]; } diff --git a/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionActions.test.tsx b/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionActions.test.tsx index 2f2a9fb92..19fa4e3f5 100644 --- a/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionActions.test.tsx +++ b/packages/zapp/console/src/components/Executions/Tables/test/NodeExecutionActions.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { fireEvent, render, waitFor } from '@testing-library/react'; +import { act, fireEvent, render, waitFor } from '@testing-library/react'; import { NodeExecutionDetailsContextProvider } from 'components/Executions/contextProvider/NodeExecutionDetails'; import { mockWorkflowId } from 'mocks/data/fixtures/types'; import { QueryClient, QueryClientProvider } from 'react-query'; @@ -42,17 +42,25 @@ describe('Executions > Tables > NodeExecutionActions', () => { ); it('should render rerun action, if id can be determined', async () => { - const { queryByTitle } = renderComponent({ execution, state }); - await waitFor(() => queryByTitle('Rerun')); + let queryByTitle; + await act(() => { + const component = renderComponent({ execution, state }); + queryByTitle = component.queryByTitle; + }); + await waitFor(() => queryByTitle('View Inputs & Outputs')); expect(queryByTitle('View Inputs & Outputs')).toBeInTheDocument(); - expect(queryByTitle('Rerun')).toBeInTheDocument(); expect(queryByTitle('Resume')).not.toBeInTheDocument(); + expect(queryByTitle('Rerun')).toBeInTheDocument(); }); it('should render resume action, if the status is PAUSED', async () => { const mockExecution = { ...execution, closure: { phase: 100 } }; - const { queryByTitle } = renderComponent({ execution: mockExecution, state }); + let queryByTitle; + await act(() => { + const component = renderComponent({ execution: mockExecution, state }); + queryByTitle = component.queryByTitle; + }); await waitFor(() => queryByTitle('Resume')); expect(queryByTitle('View Inputs & Outputs')).toBeInTheDocument(); @@ -62,9 +70,12 @@ describe('Executions > Tables > NodeExecutionActions', () => { it('should render ResumeForm on resume button click', async () => { const mockExecution = { ...execution, closure: { phase: 100 } }; - const { queryByTitle, getByTitle, queryByTestId } = renderComponent({ - execution: mockExecution, - state, + let queryByTitle, getByTitle, queryByTestId; + await act(() => { + const component = renderComponent({ execution: mockExecution, state }); + queryByTitle = component.queryByTitle; + getByTitle = component.getByTitle; + queryByTestId = component.queryByTestId; }); await waitFor(() => queryByTitle('Resume')); diff --git a/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts b/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts index 4d696900d..7638a9f5a 100644 --- a/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts +++ b/packages/zapp/console/src/components/Executions/nodeExecutionQueries.ts @@ -351,7 +351,16 @@ export function useAllTreeNodeExecutionGroupsQuery( } }; - const key = `${nodeExecutions?.[0]?.scopedId}-${nodeExecutions?.[0]?.closure?.phase}`; + const n = nodeExecutions.length - 1; + let key = ''; + if (n >= 0) { + const keyP1 = `${nodeExecutions[0]?.scopedId}-${nodeExecutions[0].closure.phase}-${nodeExecutions[0].closure?.startedAt?.nanos}`; + key = keyP1; + if (n >= 1) { + const keyP2 = `${nodeExecutions[n]?.scopedId}-${nodeExecutions[n].closure.phase}-${nodeExecutions[n].closure?.startedAt?.nanos}`; + key = keyP1 + '-' + keyP2; + } + } return useConditionalQuery( { diff --git a/yarn.lock b/yarn.lock index 53d26f665..23a34309d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1662,9 +1662,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@flyteorg/flyteidl@https://github.com/flyteorg/flyteidl.git#feature/gate-nodes": - version "0.0.0-develop" - resolved "https://github.com/flyteorg/flyteidl.git#30fed9fd8d9d99d6ca34a9023f3b33e095bb4ea5" +"@flyteorg/flyteidl@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@flyteorg/flyteidl/-/flyteidl-1.2.1.tgz#124032da9db6dfabf10007c4549ba469d0b62127" + integrity sha512-NYMwCS7V0gpvSTi+lkvx8NuxvXIsLr/lcKRwdLPMbnHDcpXMq7pTRBUJk+0iicdMqm+bUJOgx7uQYUG0hxp68w== "@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3"