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

OCPBUGS-4026: Fix rerender loop/crash when bindable-kinds is found but has no status #12296

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

jerolimov
Copy link
Member

Fixes:
https://issues.redhat.com/browse/OCPBUGS-4026

Analysis / Root cause:
This statement creates always a new bindableServices array when the bindable-kinds resource is found, but has no status.

  const bindableServices: BindableServiceGVK[] = bindableKindsRes?.status ?? [];

Since this is used for the useCallback dependencies this catalog providers updates the catalog again and again.

Solution Description:
Changed the useCallback dependencies to the bindableKinds and loaded so that the callback is only updated if one of these both changed. Checked that the status array is defined (with isArray) in the callback function.

Screen shots / Gifs for design review:
Before:

before.mp4

After:

after.mp4

Unit test coverage report:
Unchanged

Test setup:

  1. Install Service Binding Operator
  2. Create or update the BindableKinds resource "bindable-kinds"
apiVersion: binding.operators.coreos.com/v1alpha1
kind: BindableKinds
metadata:
  name: bindable-kinds
  1. Open the browser console log
  2. Open the console UI and navigate to the add page

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid 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 Nov 23, 2022
@openshift-ci-robot
Copy link
Contributor

@jerolimov: This pull request references Jira Issue OCPBUGS-4026, which is valid. The bug has been moved to the POST state.

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

Requesting review from QA contact:
/cc @sanketpathak

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Fixes:
https://issues.redhat.com/browse/OCPBUGS-4026

Analysis / Root cause:
This statement creates always a new bindableServices array when the bindable-kinds resource is found, but has no status.

 const bindableServices: BindableServiceGVK[] = bindableKindsRes?.status ?? [];

Since this is used for the useCallback dependencies this catalog providers updates the catalog again and again.

Solution Description:
Changed the useCallback dependencies to the bindableKinds and loaded so that the callback is only updated if one of these both changed. Checked that the status array is defined (with isArray) in the callback function.

Screen shots / Gifs for design review:
Before:

before.mp4

After:

after.mp4

Unit test coverage report:
Unchanged

Test setup:

  1. Install Service Binding Operator
  2. Create or update the BindableKinds resource "bindable-kinds"
apiVersion: binding.operators.coreos.com/v1alpha1
kind: BindableKinds
metadata:
 name: bindable-kinds
  1. Open the browser console log
  2. Open the console UI and navigate to the add page

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

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 added component/dev-console Related to dev-console approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 23, 2022
@jerolimov
Copy link
Member Author

/kind bug
/uncc andrewballantyne rohitkrai03
/cc @divyanshiGupta @debsmita1

@openshift-ci openshift-ci bot requested review from debsmita1 and divyanshiGupta and removed request for rohitkrai03 and andrewballantyne November 23, 2022 11:39
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Nov 23, 2022
@jerolimov
Copy link
Member Author

/cherry-pick release-4.12

@openshift-cherrypick-robot

@jerolimov: once the present PR merges, I will cherry-pick it on top of release-4.12 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.12

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.

@invincibleJai
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 23, 2022
Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

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

Verified it locally. and it works as expected

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 23, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: invincibleJai, jerolimov, vikram-raj

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-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD a4ad164 and 2 for PR HEAD e34fe38 in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 857f388 and 1 for PR HEAD e34fe38 in total

@openshift-merge-robot openshift-merge-robot merged commit 9a04388 into openshift:master Nov 24, 2022
@openshift-ci-robot
Copy link
Contributor

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

Jira Issue OCPBUGS-4026 has been moved to the MODIFIED state.

In response to this:

Fixes:
https://issues.redhat.com/browse/OCPBUGS-4026

Analysis / Root cause:
This statement creates always a new bindableServices array when the bindable-kinds resource is found, but has no status.

 const bindableServices: BindableServiceGVK[] = bindableKindsRes?.status ?? [];

Since this is used for the useCallback dependencies this catalog providers updates the catalog again and again.

Solution Description:
Changed the useCallback dependencies to the bindableKinds and loaded so that the callback is only updated if one of these both changed. Checked that the status array is defined (with isArray) in the callback function.

Screen shots / Gifs for design review:
Before:

before.mp4

After:

after.mp4

Unit test coverage report:
Unchanged

Test setup:

  1. Install Service Binding Operator
  2. Create or update the BindableKinds resource "bindable-kinds"
apiVersion: binding.operators.coreos.com/v1alpha1
kind: BindableKinds
metadata:
 name: bindable-kinds
  1. Open the browser console log
  2. Open the console UI and navigate to the add page

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

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-cherrypick-robot

@jerolimov: new pull request created: #12304

In response to this:

/cherry-pick release-4.12

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.

@jerolimov jerolimov deleted the OCPBUGS-4026 branch August 7, 2023 13:15
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/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console jira/severity-moderate Referenced Jira bug's severity is moderate for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants