Skip to content

OCPBUGS-82111: contain hookProvider errors so a plugin cannot white-screen Console - #17433

Open
Pratik-Redhat-Tech wants to merge 1 commit into
openshift:mainfrom
Pratik-Redhat-Tech:ocpbugs-82111-hookprovider-error-boundary
Open

Pratik-Redhat-Tech wants to merge 1 commit into
openshift:mainfrom
Pratik-Redhat-Tech:ocpbugs-82111-hookprovider-error-boundary

Conversation

@Pratik-Redhat-Tech

@Pratik-Redhat-Tech Pratik-Redhat-Tech commented Oct 27, 2026 •

Copy link
Copy Markdown

Analysis / Root cause:

A throwing console.flag/hookProvider handler unmounts the entire OpenShift Console (spinner disappears, white screen). FeatureFlagExtensionLoader sits outside the page ErrorBoundary. console.flag handlers already catch throws in useFeatureFlagExtensions. hookProvider handlers are React hooks, so they cannot use try/catch (Rules of Hooks); they must be isolated with an error boundary.

This matches the investigation on OCPBUGS-82111: an ACM feature-flag hook threw TypeError (e is undefined when reading .name) after an empty components response, and React unmounted the root. The same path exists on 4.20, 4.22, and main.

Solution description:

Wrap each FeatureFlagExtensionHookResolver in the shared ErrorBoundary. One plugin hook failure is logged and contained; other plugins and the rest of the Console stay mounted. Default fallback is empty (these resolvers already render null).

Test setup:

Standard console frontend unit tests:

  • yarn test

Test cases:

  • Load Console with a console.flag/hookProvider that throws during render (empty/undefined plugin data). The page must remain mounted; only that hook is isolated.
  • Load Console with healthy hook providers (no throw). Feature flags still apply as before.
  • Confirm console.flag (non-hook) handlers still catch errors as they do today.

Browser conformance:

[X] Chrome
[X] Firefox
[X] Safari (or Epiphany on Linux)

Additional info:

Does not replace fixing ACM/MCE data handling. This is the Console-side containment gap called out on OCPBUGS-82111.

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • Feature flag extensions are now isolated from one another when an extension encounters an error, helping prevent one failure from disrupting other extensions.

…creen Console

console.flag handlers already catch throws. console.flag/hookProvider
handlers are React hooks, so they cannot use try/catch. Wrap each
resolver in ErrorBoundary; FeatureFlagExtensionLoader sits outside the
page boundary and a throw currently unmounts the whole app.

Signed-off-by: Pratik Langde <plangde@redhat.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 27, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@Pratik-Redhat-Tech: This pull request references Jira Issue OCPBUGS-82111, which is invalid:

  • expected the bug to target the "5.1.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

Analysis / Root cause:

A throwing console.flag/hookProvider handler unmounts the entire OpenShift Console (spinner disappears, white screen). FeatureFlagExtensionLoader sits outside the page ErrorBoundary. console.flag handlers already catch throws in useFeatureFlagExtensions. hookProvider handlers are React hooks, so they cannot use try/catch (Rules of Hooks); they must be isolated with an error boundary.

This matches the investigation on OCPBUGS-82111: an ACM feature-flag hook threw TypeError (e is undefined when reading .name) after an empty components response, and React unmounted the root. The same path exists on 4.20, 4.22, and main.

Solution description:

Wrap each FeatureFlagExtensionHookResolver in the shared ErrorBoundary. One plugin hook failure is logged and contained; other plugins and the rest of the Console stay mounted. Default fallback is empty (these resolvers already render null).

Test setup:

Standard console frontend unit tests:

  • yarn test

Test cases:

  • Load Console with a console.flag/hookProvider that throws during render (empty/undefined plugin data). The page must remain mounted; only that hook is isolated.
  • Load Console with healthy hook providers (no throw). Feature flags still apply as before.
  • Confirm console.flag (non-hook) handlers still catch errors as they do today.

Browser conformance:

[X] Chrome
[X] Firefox
[X] Safari (or Epiphany on Linux)

Additional info:

Does not replace fixing ACM/MCE data handling. This is the Console-side containment gap called out on OCPBUGS-82111.

Made with Cursor

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 966f8b5b-52c4-49a7-8529-6dcfb8cc822e
Commits

Reviewing files that changed from the base of the PR and between f427d32 and 47a1e9b.

Files selected for processing: 1
  • frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The feature flag extension loader now wraps each hook resolver in an ErrorBoundary keyed by provider UID. The resolver no longer receives the key directly.

Changes

Feature flag hook error containment

Layer / File(s) Summary
Wrap hook resolvers in error boundaries
frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx
The loader imports ErrorBoundary and wraps each provider’s hook resolver in a boundary keyed by UID. The key is removed from the resolver. Comments describe the boundary’s error-containment role.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: logonoff

Merge Risk: Minimal · up to 47a1e

The change provides the intended per-provider hook error containment without an identified regression.

Pre-merge checks: Passed 15
Check name Status Explanation
Title check Passed The title names the Jira key OCPBUGS-82111 and states the fix: errors from a plugin's console.flag/hookProvider are contained so they cannot white-screen the Console. The raw summary confirms the chan…
Description check Passed The description covers the required sections of the template: Analysis / Root cause, Solution description, Test setup, Test cases, Browser conformance, and Additional info. The root cause explains why…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names Passed PASS: The pull request changes one TypeScript component only. The diff adds an ErrorBoundary around each resolver and adds no Ginkgo or other test titles. Therefore, it introduces no unstable or overl…
Test Structure And Quality Passed The pull request changes only frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. It adds an ErrorBoundary around each hook resolver and adds no Ginkgo test code or …
Microshift Test Compatibility Passed The pull request changes only one TypeScript frontend file. It adds an ErrorBoundary around FeatureFlagExtensionHookResolver and adds no Ginkgo e2e tests, OpenShift API references, namespaces, or Micr…
Single Node Openshift (Sno) Test Compatibility Passed PASS: The pull request changes only FeatureFlagExtensionLoader.tsx, a TypeScript/React component. It adds ErrorBoundary wrappers around existing hook resolvers and adds no Ginkgo e2e tests or othe…
Topology-Aware Scheduling Compatibility Passed PASS. The pull request changes only frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. It adds an ErrorBoundary around feature-flag hook resolvers and introduces no…
Ote Binary Stdout Contract Passed PASS: The pull request changes only frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. The diff adds an ErrorBoundary around each React hook resolver and does not a…
Ipv6 And Disconnected Network Test Compatibility Passed The pull request changes only the TypeScript component frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. It adds an ErrorBoundary around each hook resolver. It add…
No-Weak-Crypto Passed The pull request only adds an existing ErrorBoundary import and wraps each hook resolver. The diff introduces no cryptographic algorithm, crypto implementation, or secret/token comparison.
Container-Privileges Passed PASS: The pull request changes only FeatureFlagExtensionLoader.tsx, a React/TypeScript source file. The diff contains no container or Kubernetes manifest and introduces none of the checked privilege…
No-Sensitive-Data-In-Logs Passed PASS. The pull request adds an existing ErrorBoundary around each hook provider. It does not add logging or log sensitive fields. The boundary's generic console.error was already present before th…
Full details: Title check

Explanation

The title names the Jira key OCPBUGS-82111 and states the fix: errors from a plugin's console.flag/hookProvider are contained so they cannot white-screen the Console. The raw summary confirms the change wraps each FeatureFlagExtensionHookResolver in an ErrorBoundary, which matches the title's intent. The title is specific, short, and follows the required Jira prefix convention.

Full details: Description check

Explanation

The description covers the required sections of the template: Analysis / Root cause, Solution description, Test setup, Test cases, Browser conformance, and Additional info. The root cause explains why hook providers cannot use try/catch and why an ErrorBoundary is needed. The solution states the wrapping in ErrorBoundary and the empty fallback. Test cases are listed for throwing hooks, healthy hooks, and non-hook console.flag handlers. Screenshots and Reviewers and assignees are not filled in. Screenshots are optional for this non-visual fix, but the reviewers/assignees section is absent, so a reviewer tag or assignment is still needed.

Resolution

Optionally add the reviewers/assignees section content (an OCP console engineer tag) and a note on screenshots as not applicable. Also consider stating the specific test files or new unit tests added for the ErrorBoundary wrapping.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Full details: Stable And Deterministic Test Names

Explanation

PASS: The pull request changes one TypeScript component only. The diff adds an ErrorBoundary around each resolver and adds no Ginkgo or other test titles. Therefore, it introduces no unstable or overly specific test name.

Full details: Test Structure And Quality

Explanation

The pull request changes only frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. It adds an ErrorBoundary around each hook resolver and adds no Ginkgo test code or It() block. The specified Ginkgo test quality checks are therefore not applicable.

Full details: Microshift Test Compatibility

Explanation

The pull request changes only one TypeScript frontend file. It adds an ErrorBoundary around FeatureFlagExtensionHookResolver and adds no Ginkgo e2e tests, OpenShift API references, namespaces, or MicroShift-specific assumptions.

Full details: Single Node Openshift (Sno) Test Compatibility

Explanation

PASS: The pull request changes only FeatureFlagExtensionLoader.tsx, a TypeScript/React component. It adds ErrorBoundary wrappers around existing hook resolvers and adds no Ginkgo e2e tests or other tests that make multi-node or HA assumptions. SNO compatibility checks are therefore not applicable.

Full details: Topology-Aware Scheduling Compatibility

Explanation

PASS. The pull request changes only frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. It adds an ErrorBoundary around feature-flag hook resolvers and introduces no deployment manifests, operator/controller code, replica settings, affinity, topology spread, node selectors, tolerations, or PDBs. The topology-aware scheduling check is therefore not applicable.

Full details: Ote Binary Stdout Contract

Explanation

PASS: The pull request changes only frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. The diff adds an ErrorBoundary around each React hook resolver and does not add or modify an OTE binary entry point, suite setup, or any stdout write. The OTE Binary Stdout Contract is therefore not violated.

Full details: Ipv6 And Disconnected Network Test Compatibility

Explanation

The pull request changes only the TypeScript component frontend/packages/console-app/src/components/flags/FeatureFlagExtensionLoader.tsx. It adds an ErrorBoundary around each hook resolver. It adds no Ginkgo e2e tests, IPv4 assumptions, or external connectivity requirements.

Full details: Container-Privileges

Explanation

PASS: The pull request changes only FeatureFlagExtensionLoader.tsx, a React/TypeScript source file. The diff contains no container or Kubernetes manifest and introduces none of the checked privilege settings: privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, or root execution.

Full details: No-Sensitive-Data-In-Logs

Explanation

PASS. The pull request adds an existing ErrorBoundary around each hook provider. It does not add logging or log sensitive fields. The boundary's generic console.error was already present before this pull request, and the changed file contains no password, token, API key, PII, session ID, hostname, or customer-data logging.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from jhadvig and rhamilto October 27, 2026 06:21
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Oct 27, 2026
@openshift-ci

openshift-ci Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Pratik-Redhat-Tech
Once this PR has been reviewed and has the lgtm label, please assign spadgett for approval. For more information see the Code Review Process.

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

Details 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 openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 27, 2026
@openshift-ci

openshift-ci Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Hi @Pratik-Redhat-Tech. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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-sigs/prow repository.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants