Skip to content

[Backport] NETOBSERV-2693 Open Flowcollector status page from OLM page - #1670

Open
jpinsonneau wants to merge 2 commits into
netobserv:mainfrom
jpinsonneau:2693-main
Open

[Backport] NETOBSERV-2693 Open Flowcollector status page from OLM page#1670
jpinsonneau wants to merge 2 commits into
netobserv:mainfrom
jpinsonneau:2693-main

Conversation

@jpinsonneau

@jpinsonneau jpinsonneau commented Jul 30, 2026

Copy link
Copy Markdown
Member

Backport of #1570

Summary by CodeRabbit

  • New Features

    • Added FlowCollector deletion support with confirmation dialogs, progress indicators, and deletion status messaging.
    • Added clearer handling for missing FlowCollector resources, including a link to create one.
    • Improved FlowCollector navigation across setup, editing, YAML, and status views.
    • Added loading and error states for FlowCollector lifecycle operations.
  • Bug Fixes

    • Corrected FlowCollector retrieval error messaging.
    • Prevented errors when Kubernetes model data is temporarily unavailable.

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jotak 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

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@jpinsonneau, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c43dfcf1-b5e6-4d93-b004-336994bb7973

📥 Commits

Reviewing files that changed from the base of the PR and between d5394ca and 054f39d.

📒 Files selected for processing (7)
  • web/locales/en/plugin__netobserv-plugin.json
  • web/src/components/forms/flowCollector-status.tsx
  • web/src/components/forms/resource-watcher.tsx
  • web/src/components/forms/utils.ts
  • web/src/components/status/__tests__/flowcollector-status.spec.tsx
  • web/src/utils/__tests__/url.spec.ts
  • web/src/utils/url.ts
📝 Walkthrough

Walkthrough

FlowCollector routing now supports setup, edit, YAML, cluster, and status paths. Status handling recognizes deletion and not-found states. ResourceWatcher confirms deletion through API polling, while the status page and delete modal provide deletion, loading, missing-resource, and asynchronous action handling.

Changes

FlowCollector lifecycle

Layer / File(s) Summary
FlowCollector route resolution
web/src/utils/url.ts, web/webpack.config.ts, web/src/components/forms/flowCollector.tsx
Adds centralized FlowCollector paths and URL-based resource-name resolution, registers additional Console routes, and navigates successful form submissions to the status page.
Status and deletion state contracts
web/src/components/forms/utils.ts, web/src/components/status/flowcollector-status-indicator.tsx, web/src/components/status/__tests__/*, web/locales/en/plugin__netobserv-plugin.json, web/src/utils/k8s-models-hook.ts
Adds deleting and not-found status handling, supports externally supplied indicator status, updates translations and tests, and makes model lookup safe when models are unavailable.
Deletion confirmation and status UI
web/src/components/forms/resource-watcher.tsx, web/src/components/forms/resource-delete-modal.tsx, web/src/components/forms/flowCollector-status.tsx
Tracks deletion snapshots, polls until resources disappear, supports asynchronous delete actions, and renders deletion, loading, missing-resource, and disabled-action states.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required template sections and checklist details; it only links to the upstream PR. Fill in the Description, Dependencies, and Checklist sections, and include testing/configuration notes plus the QE requirement choice.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and matches the main change: backporting the FlowCollector status page open from the OLM page.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
web/src/components/status/__tests__/flowcollector-status.spec.tsx (1)

101-108: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a case for object-shaped k8s errors.

The suite only covers strings and Errors. The shape Console actually rejects with (a plain object carrying json.code/json.reason) is untested, and currently unhandled by isK8sNotFoundError. See the related comment in web/src/components/forms/utils.ts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/status/__tests__/flowcollector-status.spec.tsx` around
lines 101 - 108, Update isK8sNotFoundError and its tests to support plain
Kubernetes error objects containing json.code/json.reason, recognizing the
not-found code or reason while preserving existing string, Error, null, and
unrelated-error behavior. Add a test in the isK8sNotFoundError suite using the
Console rejection shape.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/forms/flowCollector-status.tsx`:
- Around line 196-217: Normalize ctx.loadError to a human-readable string before
passing it as the error interpolation value in the hasLoadError branch of
flowCollectorMissing. Preserve the existing translated message and ensure
object-shaped errors do not render as “[object Object]”.

In `@web/src/components/forms/resource-watcher.tsx`:
- Around line 306-339: Update both catch blocks in the resource watcher promise
chains to normalize rejected values before calling setErrors, using the error
message, nested JSON message, or String fallback in that order. Replace the
direct e.message usage while preserving rethrow behavior and existing error
handling.
- Around line 168-199: Update the delete-absence polling effect around
pollUntilGone and k8sGet to enforce a maximum attempt, deadline, or backoff
rather than rescheduling indefinitely. When the object remains present or k8sGet
returns a non-404 error after the limit, stop polling and transition the
existing form state to a surfaced delete-failure error; retain
setDeletingSnapshot(null) for confirmed 404 responses and clean up timers on
effect teardown.

In `@web/src/components/forms/utils.ts`:
- Around line 10-16: Normalize Kubernetes errors through one shared helper. In
web/src/components/forms/utils.ts#L10-L16, add and export k8sErrorMessage,
detect code/json.code 404, response.status 404, and json.reason "NotFound"
before matching message text, and update isK8sNotFoundError to use it. In
web/src/components/forms/resource-watcher.tsx#L306-L339, use k8sErrorMessage(e)
in both setErrors calls; in
web/src/components/forms/flowCollector-status.tsx#L196-L217, pass
k8sErrorMessage(ctx.loadError) to the error interpolation. In
web/src/components/status/__tests__/flowcollector-status.spec.tsx#L101-L108, add
object-rejection cases verifying 404/NotFound is true and 403 is false.

In `@web/src/utils/url.ts`:
- Around line 63-64: Update isFlowCollectorCreatePath to recognize both the
existing "~new" segment and the "setup" segment as create routes, preserving the
current behavior for other paths. Add regression coverage verifying both route
forms are identified as create paths.

---

Nitpick comments:
In `@web/src/components/status/__tests__/flowcollector-status.spec.tsx`:
- Around line 101-108: Update isK8sNotFoundError and its tests to support plain
Kubernetes error objects containing json.code/json.reason, recognizing the
not-found code or reason while preserving existing string, Error, null, and
unrelated-error behavior. Add a test in the isK8sNotFoundError suite using the
Console rejection shape.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cd666a9-215e-4e4b-b584-7b4796a121f4

📥 Commits

Reviewing files that changed from the base of the PR and between 993d0b2 and d5394ca.

📒 Files selected for processing (11)
  • web/locales/en/plugin__netobserv-plugin.json
  • web/src/components/forms/flowCollector-status.tsx
  • web/src/components/forms/flowCollector.tsx
  • web/src/components/forms/resource-delete-modal.tsx
  • web/src/components/forms/resource-watcher.tsx
  • web/src/components/forms/utils.ts
  • web/src/components/status/__tests__/flowcollector-status.spec.tsx
  • web/src/components/status/flowcollector-status-indicator.tsx
  • web/src/utils/k8s-models-hook.ts
  • web/src/utils/url.ts
  • web/webpack.config.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • netobserv/netobserv-operator (manual)
  • netobserv/flowlogs-pipeline (manual)

Comment thread web/src/components/forms/flowCollector-status.tsx
Comment thread web/src/components/forms/resource-watcher.tsx Outdated
Comment thread web/src/components/forms/resource-watcher.tsx
Comment thread web/src/components/forms/utils.ts
Comment thread web/src/utils/url.ts Outdated
@jpinsonneau

Copy link
Copy Markdown
Member Author

Addressed rabbit feedback 054f39d

Sadly that was not suggested in pf5 branch. We should consider enabling code rabbit when a human create a PR against any branch

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

@jpinsonneau: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-tests 054f39d link false /test integration-tests

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant