Skip to content

CONSOLE-5027: Refactor public/ Directory Components to useK8sWatchResource(s) - #15954

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
cajieh:migrate-firehose-to-hooks
Mar 23, 2026
Merged

CONSOLE-5027: Refactor public/ Directory Components to useK8sWatchResource(s)#15954
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
cajieh:migrate-firehose-to-hooks

Conversation

@cajieh

@cajieh cajieh commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

This change migrates components dependent on the Firehose component to useK8sWatchResource(s). The removal of the Firehose component and the cleanup of associated types will be covered in follow-on work.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jan 28, 2026
@openshift-ci-robot

openshift-ci-robot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

@cajieh: This pull request references CONSOLE-5027 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

NOT READY FOR REVIEW

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.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 28, 2026
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 28, 2026
@coderabbitai

coderabbitai Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Replaces Firehose-based data provisioning with hook-based Kubernetes watchers (useK8sWatchResource / useK8sWatchResources) across the console frontend. Components now pass {data, loaded, loadError} objects, update prop types, and remove Firehose/flags HOCs; several components gain or adjust exports/signatures accordingly.

Cohort / File(s) Summary
Global locales
frontend/packages/console-app/locales/en/console-app.json, frontend/packages/operator-lifecycle-manager-v1/locales/en/olm-v1.json, frontend/public/locales/en/public.json
Added/removed small translation keys; minor locale edits.
Core hook migrations (terminal/container/edit-yaml/etc.)
frontend/packages/console-app/src/components/nodes/NodeTerminal.tsx, frontend/public/components/container.tsx, frontend/public/components/create-yaml.tsx, frontend/public/components/edit-yaml.tsx, frontend/public/components/instantiate-template.tsx
Replaced Firehose wrappers with useK8sWatchResource/useK8sWatchResources; components now receive obj with data, loaded, loadError; added loading/error branches.
RBAC & bindings
frontend/public/components/RBAC/bindings.tsx
Moved from Firehose to watch hooks; changed row/obj shape handling (use row.obj, optional chaining); BindingLoadingWrapper props and related types updated.
Cluster / Monitoring / Storage components
frontend/public/components/cluster-settings/cluster-settings.tsx, frontend/public/components/monitoring/.../alertmanager-*.tsx, frontend/public/components/storage-class-form.tsx, frontend/public/components/utils/storage-class-dropdown.tsx
Switched data sourcing to k8s-watch hooks; updated props/types to WatchK8sResultsObject and passed loaded/loadError through.
Command-line & notifier
frontend/public/components/command-line-tools.tsx, frontend/public/components/console-notifier.tsx
Removed connectToFlags/Firehose HOCs; added useFlag/useK8sWatchResource hooks; updated public prop shapes (CommandLineToolsProps) and component signatures.
Factory / list page / horizontal nav
frontend/public/components/factory/.../details.tsx, frontend/public/components/factory/list-page.tsx, frontend/public/components/utils/horizontal-nav.tsx
Introduced watchedResources props and useK8sWatchResources; adjusted ListPageWrapper/MultiListPage APIs and AsyncComponent create flag in horizontal-nav.
CronJobs & templates
frontend/public/components/cron-job.tsx, frontend/public/components/instantiate-template.tsx
Exposed CronJobPodsComponent/CronJobJobsComponent as FC exports; replaced Firehose with hook-based resource watching and flattened results.
Forms & receivers
frontend/public/components/monitoring/receiver-forms/alert-manager-receiver-forms.tsx, frontend/public/components/storage-class-form.tsx, frontend/public/components/namespace-bar.tsx, frontend/public/components/utils/list-dropdown.tsx
Hook-based data fetching replacing Firehose; props/types updated (namespace/resources typed as WatchK8sResultsObject); new internal prop types added where applicable.
Utilities & dropdowns
frontend/public/components/utils/list-dropdown.tsx, frontend/public/components/utils/storage-class-dropdown.tsx
Internal prop/type changes to accept watchedResources; compute loaded/loadError from watch results; removed Firehose wiring.
Binding actions & other small fixes
frontend/packages/console-app/src/actions/hooks/useBindingActions.ts, frontend/packages/operator-lifecycle-manager-v1/src/components/cluster-extension/ServiceAccountDropdown.tsx
Smaller internal robustness fixes (nullish destructuring, optional chaining) and i18n key namespace change for placeholder.
Tests
frontend/packages/helm-plugin/.../HelmReleaseResources.spec.tsx, frontend/public/components/__tests__/*.spec.tsx, frontend/public/components/factory/__tests__/*
Updated mocks and assertions to use k8s-watch-hook mocks (useK8sWatchResource(s)) instead of Firehose mocks; adjusted expectations accordingly.
Other
assorted files under frontend/public/components/... and frontend/packages/... (many diffs)
Widespread removal of Firehose imports, additions of k8s-watch-hook imports, propagation of loaded/loadError and minor render-guard updates across many components.

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: refactoring public/ directory components to use useK8sWatchResource(s) instead of Firehose, with a valid Jira ticket reference (CONSOLE-5027).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@openshift-ci
openshift-ci Bot requested review from Leo6Leo and jgbernalp January 28, 2026 15:53
@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/monitoring Related to monitoring approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 28, 2026
@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch from ed33b09 to 7b7d0f8 Compare February 3, 2026 14:40
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 3, 2026
@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch from 7b7d0f8 to 5f6e3ed Compare February 4, 2026 10:52
@openshift-ci-robot

openshift-ci-robot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

@cajieh: This pull request references CONSOLE-5027 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

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.

@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch 4 times, most recently from 7dca8dc to b879d3d Compare February 4, 2026 22:42
const resources = flags[FLAGS.CONSOLE_YAML_SAMPLE]
? [
{
const watchResources = flags[FLAGS.CONSOLE_YAML_SAMPLE]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for EditYAML we can actually simplify this even further by using useFlag and moving this into the main EditYAML component. Then we do not need EditYAML_ and WithFlagProps and all that other stuff

@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch from b879d3d to 7db7e98 Compare February 6, 2026 18:28
isList: false,
prop: 'obj',
};
const objResource = useMemo<FirehoseResource>(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deferring to the Firehose Type migration effort.

@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch from 7db7e98 to 8d8177e Compare February 9, 2026 14:37
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2026
@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch from 8d8177e to 935611e Compare February 9, 2026 15:05
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2026
@cajieh
cajieh force-pushed the migrate-firehose-to-hooks branch 2 times, most recently from 9abced3 to c81bc77 Compare February 9, 2026 18:36
@cajieh cajieh changed the title [WIP] CONSOLE-5027: Refactor public/ Directory Components to useK8sWatchResource(s) CONSOLE-5027: Refactor public/ Directory Components to useK8sWatchResource(s) Feb 9, 2026
@openshift-ci openshift-ci Bot added kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Feb 9, 2026
@cajieh

cajieh commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

3 similar comments
@cajieh

cajieh commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

@cajieh

cajieh commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

@cajieh

cajieh commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

@cajieh

cajieh commented Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

/test frontend

@cajieh

cajieh commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

@cajieh

cajieh commented Mar 20, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@cajieh

cajieh commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

@cajieh

cajieh commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

/restest

@cajieh

cajieh commented Mar 21, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@cajieh

cajieh commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

/test e2e-gcp-console

@cajieh

cajieh commented Mar 22, 2026

Copy link
Copy Markdown
Contributor Author

/test all

],
[resourcePageExtensions, kindObj],
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i'm confused by this addition because i removed this in #16043

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, a rebase artifact! 😅 Reverted!
Just trying a brute-force approach to resolve these persistent E2E failures.
Will review the changes thoroughly once the tests are passing.


const pluginPages = useMemo(
() => [
/** @deprecated -- if there is a bug here, encourage `console.tab/horizontalNav` usage instead */

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TODO: Remove it.

],
[resourcePageExtensions, kindObj],
);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, a rebase artifact! 😅 Reverted!
Just trying a brute-force approach to resolve these persistent E2E failures.
Will review the changes thoroughly once the tests are passing.

@cajieh

cajieh commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

Hmm, the last run failed with a different error than the previous ones; however, it appears to be related to an infra issue. As we discussed, I will skip these specific tests for now, open a Jira ticket to track the flakes, and re-test.
cc: @jhadvig @logonoff

@jhadvig

jhadvig commented Mar 23, 2026

Copy link
Copy Markdown
Member

overriding due to flakiness, skipping deprecated-operator-warnings.cy.ts and operator-install-global.cy.ts

/override ci/prow/e2e-gcp-console
/lgtm
/verify later @yapei

@openshift-ci

openshift-ci Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

@jhadvig: Overrode contexts on behalf of jhadvig: ci/prow/e2e-gcp-console

Details

In response to this:

overriding due to flakiness.
Also we are skipping deprecated-operator-warnings.cy.ts and operator-install-global.cy.ts

/override ci/prow/e2e-gcp-console
/lgtm
/verify later @yapei

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.

@jhadvig

jhadvig commented Mar 23, 2026

Copy link
Copy Markdown
Member

/lgtm
/verified later @yapei

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jhadvig: This PR has been marked to be verified later by @yapei.

Details

In response to this:

/lgtm
/verified later @yapei

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.

@openshift-ci

openshift-ci Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh, jhadvig, jseseCCS, krishagarwal278

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

The pull request process is described 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 commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

@cajieh: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/helm Related to helm-plugin component/monitoring Related to monitoring component/olm Related to OLM docs-approved Signifies that Docs has signed off on this PR jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. plugin-api-approved Indicates a PR with plugin API changes has been approved by an API reviewer px-approved Signifies that Product Support has signed off on this PR verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.