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

Bug 1986803: Add error boundary around each horizontal tab route (used in DetailsPage) #9659

Merged
merged 1 commit into from Jul 29, 2021

Conversation

jerolimov
Copy link
Member

@jerolimov jerolimov commented Jul 28, 2021

Fixes:
https://issues.redhat.com/browse/ODC-6204
https://bugzilla.redhat.com/show_bug.cgi?id=1986803

Analysis / Root cause:
When one of the tabs on a DetailsPage crashes, the complete console content area shows an error page. Switching between the tabs is not possible anymore.

Solution Description:
Wrap each route component with an ErrorBoundary.

Screen shots / Gifs for design review:

Without error boundary (before):

unhandled-tab-crash

With error boundary (with this PR):

handled-tab-crash

Unit test coverage report:
Unchanged

Test setup:
Produce a crash on a single tab of the DetailsPage component. For example on the environment page of a BuildConfig. This specific case is fixed in #9653. Otherwise you need to find another crash..

  1. Open developer perspective
  2. Navigate to Builds
  3. Click on "Create BuildConfig" button
  4. Just create the BuildConfig without additional changes
  5. Switch to the "Environment" tab
  6. Press "Add from ConfigMap or Secret" without selecting a ConfigMap or Secret and enter a name for this environment variable
  7. Press "Save"

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci openshift-ci bot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jul 28, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 28, 2021

@jerolimov: This pull request references Bugzilla bug 1986803, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (gamore@redhat.com), skipping review request.

In response to this:

Bug 1986803: Add error boundary around each horizontal tab route (used in DetailsPage)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot requested review from jcaianirh and kyoto July 28, 2021 11:25
@openshift-ci openshift-ci bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 28, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 28, 2021

@jerolimov: This pull request references Bugzilla bug 1986803, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.9.0) matches configured target release for branch (4.9.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (gamore@redhat.com), skipping review request.

In response to this:

Bug 1986803: Add error boundary around each horizontal tab route (used in DetailsPage)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.


import { K8sResourceKind, K8sResourceCommon } from '../../module/k8s';
import { referenceForModel, referenceFor } from '../../module/k8s/k8s';
import { ErrorBoundaryFallback } from '../error';
import { EmptyBox, LoadingBox, StatusBox } from './status-box';
Copy link
Contributor

@nemesis09 nemesis09 Jul 28, 2021

Choose a reason for hiding this comment

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

Arranging as per the lint rules for imports, this import should be at the last i think

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Rearrange is now done by eslint.

import * as React from 'react';
import * as classNames from 'classnames';
import { History, Location } from 'history';
import * as _ from 'lodash-es';
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I did not notice before. Lint does not seem to throw an error in this package, but lodash-es is a restricted import since webpack already uses lodash-es. can we change the import to lodash?

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed in slack, the public package uses 213x lodash-es and only 14 times lodash. So I think we should not fix / change this individual import at the moment.

Copy link
Contributor

Choose a reason for hiding this comment

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

okay. we can change this later if we sanitize according to lint later.

@nemesis09
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 29, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 29, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerolimov, nemesis09

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

@nemesis09
Copy link
Contributor

/retest

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 54b5cf7 into openshift:master Jul 29, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 29, 2021

@jerolimov: All pull requests linked via external trackers have merged:

Bugzilla bug 1986803 has been moved to the MODIFIED state.

In response to this:

Bug 1986803: Add error boundary around each horizontal tab route (used in DetailsPage)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.9 milestone Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants