fix: dynamic node names in graph view
https://github.com/flyteorg/flyte/issues/3370
TL;DR
This PR fixes bug where display names for nodes in the graph view for the workflow are not correctly overridden when an override is provided using the with_overrides chain method.
See https://flyte-org.slack.com/archives/CP2HDHKE1/p1677082683989289 for complete context.
How to reproduce
https://localhost.development.uniondemo.run:3000/console/projects/flytesnacks/domains/development/executions/fffe8fffa9cdc403a909?duration=all
How to fix
- implements logic to get
nodeExecutionwhen rendering a given node to fetch the displayId. Falls back tonode text => execution.node.idif nodisplayIdis found
Type
- [x] Bug Fix
- [ ] Feature
- [ ] Plugin
Are all requirements met?
- [x] Code completed
- [x] Smoke tested
- [ ] Unit tests added
- [ ] Code documentation added
- [ ] Any pending items have an associated Issue
Complete description
- The display name of a specific node in a worflow could be overriden by making a chained called a
.with_overrides(name=foo)method when defining the workflow in the python file. This lets users create nodes with dynamic names. For a specific use-case, see https://flyte-org.slack.com/archives/CP2HDHKE1/p1677082683989289 - The value of the node names are correctly overridden when in the list nodes view but fail in the graph view.
- The PR takes logic used in the
nodeExecutionColumns.tsxfile to implement similar logic to fetchdisplayIdof a node by fetching its execution and if not fallbacks to thetext
Tracking Issue
Fixes https://github.com/flyteorg/flyte/issues/3370
Codecov Report
Merging #694 (700c757) into master (3c5d6e8) will decrease coverage by
0.22%. The diff coverage is42.22%.
@@ Coverage Diff @@
## master #694 +/- ##
==========================================
- Coverage 67.18% 66.96% -0.22%
==========================================
Files 453 457 +4
Lines 11228 11303 +75
Branches 2074 2087 +13
==========================================
+ Hits 7543 7569 +26
- Misses 3685 3734 +49
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...sole/src/components/common/FileUpload/FileItem.tsx | 0.00% <0.00%> (ø) |
|
| ...le/src/components/common/FileUpload/FileUpload.tsx | 0.00% <0.00%> (ø) |
|
| packages/console/src/components/common/strings.ts | 100.00% <ø> (ø) |
|
| ...ents/flytegraph/ReactFlow/customNodeComponents.tsx | 17.02% <0.00%> (-1.70%) |
:arrow_down: |
| packages/console/src/models/Common/constants.ts | 100.00% <ø> (ø) |
|
| packages/console/src/models/Project/api.ts | 83.33% <50.00%> (-6.67%) |
:arrow_down: |
| packages/console/src/models/Project/utils.ts | 66.66% <50.00%> (+4.16%) |
:arrow_up: |
| ...onsole/src/components/Project/ProjectDashboard.tsx | 96.15% <88.88%> (-1.11%) |
:arrow_down: |
| ...ages/console/src/components/WorkflowGraph/utils.ts | 86.02% <100.00%> (-0.19%) |
:arrow_down: |
| ...le/src/components/common/DomainSettingsSection.tsx | 93.75% <100.00%> (ø) |
|
| ... and 7 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.