Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#278): wrong nodeExecutions details are showed in node executions list #277

Merged
merged 4 commits into from
Feb 11, 2022

Conversation

anrusina
Copy link
Contributor

@anrusina anrusina commented Feb 6, 2022

Issue: Wrong node execution details are shown if scopeId for two items are the same.

It is a partial fix, which solves naming for items with same scopeId, where parent have different scopeId.
Fully solving the issue requires us to do some infrastructure work: https://github.com/flyteorg/flyteconsole/issues/279

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Video walk through through test cases:
Part 1 (~1.5 min): https://share.getcloudapp.com/12u0QnAw (nested, branch, simple dynamic)
Part 2 (30 sec): https://share.getcloudapp.com/X6u8nPQK (branch + dynamic)

This PR:

  • removes unneeded useNodeExecutionCode (useWorkflow and FetchTasks execution was called too many times)
  • adds NodeExecutionDetailsContextProvider which wraps NodeExcution's tabs section (which includes Nodes/Graph/ Timeline). This wrapping allows us to perform only one fetchWorkflow request while we are working in the same workflow scope. Additional fetchTaskExecutionList happen only if task wasn't found in the initial workflow, which usually means it was part of a dynamic task and it's info is tied to a specific node execution
  • Updates Unit tests with minimal changes, to ensure that all previous cases are still working as expected
  • Updates storybook to properly consume the data
  • Fixes memory leak issue in NodeExecutionDetailsPanelContent.tsx by adding isMounted pattern.
  • Fixes issues in Details Panel, when user selects Task tab and then switches to non-task node item: https://share.getcloudapp.com/xQuzN1wO

Tested with next workflows:

Nested:

Branch

Dynamic

fixes https://github.com/flyteorg/flyte/issues/

Follow-up issue

Behavior should be fully fixed by Infra task: https://github.com/flyteorg/flyteconsole/issues/279

</ExecutionContext.Provider>
</NodeExecutionsRequestConfigContext.Provider>
</QueryClientProvider>
);

describe('when rendering the DetailsPanel', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is moved as is with addition of fetchWorkflow mock implementation from the bottom of the file, as I wasn't able to fully clear jest.spyOn() effect, which was messing up with this test return.
added:

 fetchWorkflow.mockImplementation(() =>
                Promise.resolve(fixture.workflows.top)
            );

@codecov
Copy link

codecov bot commented Feb 6, 2022

Codecov Report

❗ No coverage uploaded for pull request base (master@1e5432f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #277   +/-   ##
=========================================
  Coverage          ?   65.77%           
=========================================
  Files             ?      380           
  Lines             ?     8438           
  Branches          ?     1538           
=========================================
  Hits              ?     5550           
  Misses            ?     2888           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e5432f...481aae3. Read the comment docs.

Signed-off-by: Nastya Rusina <[email protected]>
@anrusina anrusina linked an issue Feb 7, 2022 that may be closed by this pull request
@anrusina anrusina marked this pull request as ready for review February 7, 2022 18:34
@anrusina anrusina requested review from a team, jsonporter and govalt and removed request for a team February 7, 2022 18:35
<div className={styles.filters}>
<ExecutionFilters {...filterState} />
</div>
<NodeExecutionDetailsContextProvider
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only change here: wrapped Tabs content with NodeExecutionDetailsContextProvider. github compare just gone rogue :)

@@ -4,12 +4,6 @@ import {
NodeExecutionMetadata,
WorkflowNodeMetadata
} from 'models/Execution/types';
import {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code and below is removed as not in use anymore

@@ -75,7 +74,7 @@ export function convertFlyteGraphToDAG(

// Filter out any nodes with no parents (except for the start node)
const result = values(nodeMap).filter(
n => n.id === nodeIds.start || (n.parentIds && n.parentIds.length > 0)
n => n.id === startNodeId || (n.parentIds && n.parentIds.length > 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nodeIds.start was using same string to compare, replaced with startNodeId for consistency with other code.

@anrusina anrusina changed the title fiw: wrong nodeExecutions details are showed in node executions list fix(#278): wrong nodeExecutions details are showed in node executions list Feb 8, 2022
const nodeExecutionQuery = useQuery<NodeExecution, Error>({
...makeNodeExecutionQuery(nodeExecutionId),
// The selected NodeExecution has been fetched at this point, we don't want to
// issue an additional fetch.
staleTime: Infinity
});

React.useEffect(() => {
let isCurrent = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand this? Won't this always be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would change to false, whenever return() is called (in this case on component unmount)

Copy link
Contributor

@jsonporter jsonporter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one comment, just needs clarify - otherwise lgtm 👍

@anrusina anrusina merged commit 15878ab into master Feb 11, 2022
@anrusina anrusina deleted the narusina/executionDEtails branch February 11, 2022 00:37
@flyte-bot
Copy link
Collaborator

🎉 This PR is included in version 0.42.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Wrong, duplicated Sub-workflow name in Node view
3 participants