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

Error classification UI #1257

Merged
merged 1 commit into from
Jan 10, 2025
Merged

Conversation

GnsP
Copy link
Collaborator

@GnsP GnsP commented Nov 26, 2024

UI components for error classification

Description

Adds support for classifying errors in pipeline execution and highlight errored stages.

PR Type

  • Bug Fix
  • Feature
  • Build Fix
  • Testing
  • General Improvement
  • Cherry Pick

Links

Jira: CDAP-21100

Test Plan

e2e tests to be added, when support for error classification in hydrator plugins is added.
currently it's infeasible to add e2e tests for this feature that can run in the gh-runner envirinment.

Screenshots

image

image

image

@GnsP GnsP force-pushed the error-classification-ui branch 2 times, most recently from 0658689 to 15844a8 Compare January 2, 2025 02:35
@GnsP GnsP changed the title [WIP] Error classification UI Error classification UI Jan 2, 2025
@GnsP GnsP added the build triggers github action label Jan 2, 2025
top: 100%;
left: 0;
right: 0;
background: #ffefef;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be any theming/standard color palette?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.


useEffect(() => {
if (!errorDetails && !loading && currentRun?.status === 'FAILED') {
fetchErrorDetails();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will this result in multiple or dangling subscriptions if multiple errors occur while the component is present?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, it should not result in dangling subscriptions, because:

  1. The fetch function runs only when the error details (for a failed pipeline) has not been fetched before and not being fetched currently.
  2. The fetch function puts the data (which is always same for the same runid, given that the run has completed) in the redux store. So, it does not make sense for the fetch to be aborted when the component unmounts. If the component unmounts before the data is fetched, the error details should still be fetched and on the subsequent mounting of the component, data should be taken from the redux store instead of calling the API again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

However, in the original implementation, the loading state was maintained in the component. I have moved this state up, to the redux store.

* the License.
*/

export function sleep(durationInMs: number): Promise<void> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't know if sleep is the best name here - sleep implies that nothing is happening. delay or wait might be better names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed to delay

@GnsP GnsP force-pushed the error-classification-ui branch 4 times, most recently from f57da9c to c86a972 Compare January 7, 2025 05:02
@@ -43,6 +43,10 @@ const ConnectedRunNumWarnings = connect(mapStateToProps)(RunNumWarnings);
const ConnectedRunNumErrors = connect(mapStateToProps)(RunNumErrors);

export default function RunLevelInfo() {
// error and warning counts are disabled when error classification is available,
// i.e. post v6.11.0
const shouldShowErrorAndWarningCounts = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the condition that enables this flag? I see that it is always false now which means Warnings & Error options will be not be shown. Is that expected ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it's expected. We have moved the error and warning counts to logviewer in this PR. Ideally I would have removed this block of code entirely.

I have not removed the old components from the codebase, as the runLevelInfo panel is likely to be rewritten and I wanted to use the old code as reference.

) : (
<p />
)}
<LogsButtonsContaner>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Typo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Corrected.

endIcon={<GetAppIcon />}
data-testid={getDataTestid(`${TEST_PREFIX}.downloadLogsButton`)}
>
{T.translate(`${PREFIX}.downloadLogsButton`)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please update the screenshot in the PR's description reflecting latest changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated the screenshot

@GnsP GnsP force-pushed the error-classification-ui branch from c86a972 to 9b0944f Compare January 7, 2025 07:10
return (
<div className={classes.root} data-cy="log-viewer-top-panel" data-testid="log-viewer-top-panel">
<div className={classes.leftContainer}>
<RunLogsStatsChips />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where and when this component is shown? Can you add a screenshot for this also please?

<React.Fragment>
<ConnectedRunNumWarnings />
<ConnectedRunNumErrors />
</React.Fragment>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Current change-set will not show error snack bar if the error classification api response is empty, also we are removing Error and Warning info as per above code. Then what is the indication of error for end user when a pipeline run fails and classification api response is empty?

Copy link
Collaborator Author

@GnsP GnsP Jan 7, 2025

Choose a reason for hiding this comment

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

Have accounted for this in the latest set of changes. If the error classification response is an empty list, we display the error count from metrics in the snackbar and the CTA in the snackbar opens the log viewer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can you please add a screenshot for this too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update: after another discussion, we decided not to use the error count from metrics in the snackbar, as this value does not represent the actual number of errors / exceptions. So, in this specific case, the message is "Pipeline execution failed. [VIEW LOGS]"

Added the screenshot.

@GnsP GnsP force-pushed the error-classification-ui branch 2 times, most recently from 104c198 to c236a86 Compare January 8, 2025 10:29
@GnsP GnsP requested a review from itsankit-google January 10, 2025 02:54
@GnsP GnsP force-pushed the error-classification-ui branch from c236a86 to 2e3b563 Compare January 10, 2025 03:00
@itsankit-google itsankit-google merged commit efd6574 into cdapio:develop Jan 10, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build triggers github action
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants