openshift / troubleshooting-panel-console-plugin

Console Plugin to add a troubleshooting side panel to display Korrel8r data
Apache License 2.0
0 stars 7 forks source link

OU-455: Prevent uncaught error and usage in developer perspective #29

Closed PeterYurkovich closed 5 months ago

PeterYurkovich commented 5 months ago

The action creation uses the key 'alert-detail-toolbar-actions' to add add the "Troubleshooting Panel" button to the alerts detail page. However, the developer perspective also uses that key to retrieve actions. This led to an unexpected URL being parsed, causing an uncaught error.

This PR looks to prevent an uncaught error and prevent the developer perspective from having access to the troubleshooting panel button.

It also refactors two useState's + a useEffect into two useMemo's since they are only being used as computed values.

Of note this PR adds a console.error whenever the URL fails to get parsed, which may be incorrect. I can see the value in knowing why something failed when trying to debug, but also it may be providing extraneous information and filling up the console with errors when it isn't relevant most of the time.

openshift-ci-robot commented 5 months ago

@PeterYurkovich: This pull request references OU-455 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/openshift/troubleshooting-panel-console-plugin/pull/29): >The action creation uses the key 'alert-detail-toolbar-actions' to add add the "Troubleshooting Panel" button to the alerts detail page. However, the developer console also uses that key to retrieve actions. This led to an unexpected URL being parses, causing an uncaught error. > >This PR looks to prevent an uncaught error and prevent the developer perspective from having access to the troubleshooting panel button. > >It also refactors two useState's + a useEffect into two useMemo's since they are only being used as computed values. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Ftroubleshooting-panel-console-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci-robot commented 5 months ago

@PeterYurkovich: This pull request references OU-455 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/openshift/troubleshooting-panel-console-plugin/pull/29): >The action creation uses the key 'alert-detail-toolbar-actions' to add add the "Troubleshooting Panel" button to the alerts detail page. However, the developer console also uses that key to retrieve actions. This led to an unexpected URL being parsed, causing an uncaught error. > >This PR looks to prevent an uncaught error and prevent the developer perspective from having access to the troubleshooting panel button. > >It also refactors two useState's + a useEffect into two useMemo's since they are only being used as computed values. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Ftroubleshooting-panel-console-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci-robot commented 5 months ago

@PeterYurkovich: This pull request references OU-455 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/openshift/troubleshooting-panel-console-plugin/pull/29): >The action creation uses the key 'alert-detail-toolbar-actions' to add add the "Troubleshooting Panel" button to the alerts detail page. However, the developer console also uses that key to retrieve actions. This led to an unexpected URL being parsed, causing an uncaught error. > >This PR looks to prevent an uncaught error and prevent the developer perspective from having access to the troubleshooting panel button. > >It also refactors two useState's + a useEffect into two useMemo's since they are only being used as computed values. > >Of note this PR adds a console.error whenever the URL fails to get parsed, which may be incorrect. I can see the value in knowing why something failed when trying to debug, but also it may be providing extraneous information and filling up the console with errors when it isn't relevant most of the time. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Ftroubleshooting-panel-console-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
openshift-ci[bot] commented 5 months ago

@PeterYurkovich: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci-robot commented 5 months ago

@PeterYurkovich: This pull request references OU-455 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "4.17.0" version, but no target version was set.

In response to [this](https://github.com/openshift/troubleshooting-panel-console-plugin/pull/29): >The action creation uses the key 'alert-detail-toolbar-actions' to add add the "Troubleshooting Panel" button to the alerts detail page. However, the developer perspective also uses that key to retrieve actions. This led to an unexpected URL being parsed, causing an uncaught error. > >This PR looks to prevent an uncaught error and prevent the developer perspective from having access to the troubleshooting panel button. > >It also refactors two useState's + a useEffect into two useMemo's since they are only being used as computed values. > >Of note this PR adds a console.error whenever the URL fails to get parsed, which may be incorrect. I can see the value in knowing why something failed when trying to debug, but also it may be providing extraneous information and filling up the console with errors when it isn't relevant most of the time. Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Ftroubleshooting-panel-console-plugin). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
jgbernalp commented 5 months ago

/lgtm

openshift-ci[bot] commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jgbernalp, PeterYurkovich

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: - ~~[OWNERS](https://github.com/openshift/troubleshooting-panel-console-plugin/blob/main/OWNERS)~~ [PeterYurkovich,jgbernalp] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
PeterYurkovich commented 5 months ago

/cherry-pick release-0.1

openshift-cherrypick-robot commented 5 months ago

@PeterYurkovich: new pull request created: #31

In response to [this](https://github.com/openshift/troubleshooting-panel-console-plugin/pull/29#issuecomment-2166469593): >/cherry-pick release-0.1 Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.