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

Changing cache node color to green #2897

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

dpanshug
Copy link
Contributor

@dpanshug dpanshug commented Jun 11, 2024

RHOAIENG-7144

Description

Dashboard shows cached pipeline steps in gray (no info about what it means). Changed the cache (successfull) node color to green, keeping the cache icon.

image

How Has This Been Tested?

Duplicate a pipeline run to see the cache node.

Test Impact

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Commits have been squashed into descriptive, self-contained units of work (e.g. 'WIP' and 'Implements feedback' style messages have been removed)
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change (find relevant UX in the SMEs section).

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

@yannnz

@dpanshug dpanshug requested a review from jenny-s51 June 11, 2024 10:26
@dpanshug dpanshug force-pushed the cache-node branch 2 times, most recently from aeeb8ab to de1425f Compare June 11, 2024 11:26
Copy link
Member

@Gkrumbach07 Gkrumbach07 left a comment

Choose a reason for hiding this comment

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

/lgtm

code looks good. make sure you are tagging UX

Copy link
Contributor

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

Updates to the styling look great @dpanshug - I have a question regarding the JIRA ticket - according @yannnz 's comments in https://issues.redhat.com/browse/RHOAIENG-7144 , would we want to show "Skipped" as the status in the drawer? Currently we are showing "Succeeded" for those skipped tasks.

The suggestion is to show the graph in green color while keep the cached icons.

Reason for this approach:

With the green color in the graph, the user will understand it is succeed.
The cached icons for the first time user will make them thinking it is not a common completed status. Then in the drawer, the user will find out the icon status represent cached.

Otherwise LGTM.

@Gkrumbach07
Copy link
Member

would we want to show "Skipped" as the status in the drawer? Currently we are showing "Succeeded" for those skipped tasks.

Yes you are correct Jenny. @dpanshug Can you make sure this is reflected

@dpanshug
Copy link
Contributor Author

dpanshug commented Jun 12, 2024

would we want to show "Skipped" as the status in the drawer? Currently we are showing "Succeeded" for those skipped tasks.

Yes you are correct Jenny. @dpanshug Can you make sure this is reflected

@Gkrumbach07 @jenny-s51 That's what i was bothered about from start. We are not using custom nodes in the pipeline topology, the badge color and status both are defined in the same function translateStatusForNode. Changing the color of node from skipped to succeed also changes it's status.

Should I move with the custom node? but that will need to refactor a lot of things, or is there any other solution we can think of.

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.49%. Comparing base (7725a1f) to head (93adbd1).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2897      +/-   ##
==========================================
+ Coverage   78.47%   78.49%   +0.01%     
==========================================
  Files        1127     1127              
  Lines       23925    23931       +6     
  Branches     6029     6033       +4     
==========================================
+ Hits        18775    18784       +9     
+ Misses       5150     5147       -3     
Files Coverage Δ
...concepts/topology/customNodes/StandardTaskNode.tsx 86.95% <71.42%> (-7.17%) ⬇️

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

@Gkrumbach07
Copy link
Member

@dpanshug Is there just a way to save that it is cached in the node so that later on we can read from that?

@Gkrumbach07
Copy link
Member

@dpanshug This solution should work

diff --git a/frontend/src/concepts/pipelines/topology/parseUtils.ts b/frontend/src/concepts/pipelines/topology/parseUtils.ts
index a45733fb..775bd58b 100644
--- a/frontend/src/concepts/pipelines/topology/parseUtils.ts
+++ b/frontend/src/concepts/pipelines/topology/parseUtils.ts
@@ -315,8 +315,8 @@ export const translateStatusForNode = (
       return RunStatus.InProgress;
     case ExecutionStateKF.COMPLETE:
     case RuntimeStateKF.SUCCEEDED:
-    case ExecutionStateKF.CACHED:
       return RunStatus.Succeeded;
+    case ExecutionStateKF.CACHED:
     case RuntimeStateKF.SKIPPED:
       return RunStatus.Skipped;
     case RuntimeStateKF.RUNTIME_STATE_UNSPECIFIED:
diff --git a/frontend/src/concepts/topology/customNodes/StandardTaskNode.tsx b/frontend/src/concepts/topology/customNodes/StandardTaskNode.tsx
index 4f31022c..52a715c3 100644
--- a/frontend/src/concepts/topology/customNodes/StandardTaskNode.tsx
+++ b/frontend/src/concepts/topology/customNodes/StandardTaskNode.tsx
@@ -39,6 +39,13 @@ const StandardTaskNode: React.FunctionComponent<StandardTaskNodeProps> = ({
     />
   ) : null;
 
+  const getNodeStatus = () => {
+    if (data?.pipelineTask.status?.state === ExecutionStateKF.CACHED) {
+      return RunStatus.Succeeded;
+    }
+    return data?.runStatus;
+  };
+
   return (
     <g ref={hoverRef as React.LegacyRef<SVGGElement>}>
       <TaskNode
@@ -46,7 +53,7 @@ const StandardTaskNode: React.FunctionComponent<StandardTaskNodeProps> = ({
         onSelect={onSelect}
         selected={selected}
         scaleNode={hover && detailsLevel !== ScaleDetailsLevel.high}
-        status={data?.runStatus}
+        status={getNodeStatus()}
         customStatusIcon={
           data?.pipelineTask.status?.state === ExecutionStateKF.CACHED ? (
             <AngleDoubleRightIcon />

@dpanshug dpanshug force-pushed the cache-node branch 2 times, most recently from 1e6cdfd to 68f4f14 Compare June 12, 2024 14:02
@Gkrumbach07
Copy link
Member

/lgtm
/approve

this solution looks to work. and tested live

@openshift-ci openshift-ci bot added the lgtm label Jun 12, 2024
Copy link
Contributor

openshift-ci bot commented Jun 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Gkrumbach07

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit e1210fb into opendatahub-io:main Jun 12, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants