Skip to content

NETOBSERV-2376 fix conditions icons / colors#1445

Merged
openshift-merge-bot[bot] merged 4 commits intonetobserv:mainfrom
jpinsonneau:2376-followup
Apr 23, 2026
Merged

NETOBSERV-2376 fix conditions icons / colors#1445
openshift-merge-bot[bot] merged 4 commits intonetobserv:mainfrom
jpinsonneau:2376-followup

Conversation

@jpinsonneau
Copy link
Copy Markdown
Member

@jpinsonneau jpinsonneau commented Apr 21, 2026

Description

Followup on NETOBSERV-2376 to fix conditions icons and colors since we reverted the logic in operator.

Also see netobserv/netobserv-operator#2677 for onHold and kafka condition fixes

Dependencies

n/a

Checklist

  • Does the changes in PR need specific configuration or environment set up for testing?
    • if so please describe it in PR description.
  • I have added thorough unit tests for the change.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Summary by CodeRabbit

  • Improvements
    • Enhanced status condition display with more granular visual indicators (error, warning, progress, success, unused, unknown) for clearer status information.
    • Updated status icon styling and colors using modern design tokens for improved visual consistency.
    • Refined component and integration status reporting logic.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Warning

Rate limit exceeded

@jpinsonneau has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 31 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 20 minutes and 31 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4f76db7a-1a04-44d4-8a5d-d30f3e609a9a

📥 Commits

Reviewing files that changed from the base of the PR and between 601ce50 and ae34d78.

📒 Files selected for processing (2)
  • web/src/components/forms/resource-status.tsx
  • web/src/components/status/flowcollector-status-icon.tsx
📝 Walkthrough

Walkthrough

This PR modernizes FlowCollector status rendering by introducing a centralized conditionTone() classifier to replace per-row icon branching, adds a FlowCollectorStatus type for safe status extraction, and updates PatternFly CSS class selectors from v5 to v6 in tests and CSS variable tokens in components.

Changes

Cohort / File(s) Summary
Status Type & Condition Rendering
web/src/components/forms/resource-status.tsx
Introduced FlowCollectorStatus type and flowCollectorStatus() helper. Replaced per-row branching with centralized conditionTone() classifier mapping conditions to tone values (error, warning, progress, success, unused, unknown). Handles ConfigurationIssue and Waiting* conditions with component/integration state derivation. Updated PatternFly CSS variables from --pf-v5-global--* to --pf-t--* tokens.
Status Icon Component
web/src/components/status/flowcollector-status-icon.tsx
Updated icon color CSS variables from PatternFly v5 (--pf-v5-global--{success|warning|danger|info}-color--100) to newer tokens (--pf-t--global--icon--color--status--*--default). Added fixed tooltip id attribute (flowcollector-status-tooltip).
Cypress Test Selectors
web/cypress/integration-tests/overview_page.cy.ts, web/cypress/views/netflow-page.ts
Updated PatternFly CSS class selectors from v5 (.pf-v5-c-data-list__check, .pf-v5-c-menu) to v6 (.pf-v6-c-data-list__check, .pf-v6-c-menu) in panel selection and refresh menu waits.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #1388: Modifies web/src/components/forms/resource-status.tsx with related FlowCollector status type and condition rendering updates.
  • PR #1378: Updates web/cypress/views/netflow-page.ts with the same dropdown menu selector change for PatternFly v6 compatibility.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is incomplete. It lacks a detailed explanation of the changes, does not mention testing approach, and the configuration checklist item is unchecked without justification. Expand the description to explain the condition icons/colors fix in detail, clarify why unit tests are not added (if intentional), and complete the configuration/testing sections of the checklist.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: fixing conditions icons and colors as referenced in NETOBSERV-2376.
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.

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

✨ 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 and usage tips.

@jpinsonneau jpinsonneau requested a review from kapjain-rh April 21, 2026 13:08
@jpinsonneau jpinsonneau added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 21, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/src/components/forms/resource-status.tsx (1)

157-160: Avoid any for FlowCollector status access.

This helper depends on specific components / integrations fields; typing that shape will catch misspellings and stale mappings.

Proposed typed shape
+type FlowCollectorStatus = {
+  components?: {
+    agent?: ComponentStatus;
+    processor?: ComponentStatus;
+    plugin?: ComponentStatus;
+  };
+  integrations?: {
+    monitoring?: ComponentStatus;
+    loki?: ComponentStatus;
+  };
+};
+
 function waitingComponentState(existing: K8sResourceKind | null, suffix: string): string | undefined {
-  const st = existing?.status as any;
+  const st = existing?.status as FlowCollectorStatus | undefined;
   if (!st) return undefined;

As per coding guidelines, web/src/**/*.{ts,tsx}: Check React hooks dependencies, component re-render optimization, and TypeScript type safety.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/forms/resource-status.tsx` around lines 157 - 160, The
function waitingComponentState currently casts existing?.status to any which
hides shape errors; define a dedicated type (e.g., FlowCollectorStatus) that
describes the expected properties (components and integrations and their inner
shapes) and use it instead of any when reading existing.status in
waitingComponentState (and any other accessors of K8sResourceKind.status);
update the function signature/locals to cast to FlowCollectorStatus | undefined,
ensure you reference the exact property names components and integrations to
catch misspellings, and adjust any callers or imports to use the new type from
the appropriate module.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/components/forms/resource-status.tsx`:
- Around line 190-201: The Waiting* branch is not recognizing the operator's
"ComponentUnused" reason so unused Waiting conditions render as unknown; update
the conditional that checks reason ('if (status === 'Unknown' && reason ===
'Unused')') to also accept the operator form (e.g. change to check reason ===
'Unused' || reason === 'ComponentUnused' or use a suffix match like
reason.endsWith('Unused')) so that Waiting* conditions with reason
"ComponentUnused" map to 'unused' in the component that contains
type.startsWith('Waiting'), suffix, status, reason, waitingComponentState and
WAITING_NO_STATUS_FIELD.

---

Nitpick comments:
In `@web/src/components/forms/resource-status.tsx`:
- Around line 157-160: The function waitingComponentState currently casts
existing?.status to any which hides shape errors; define a dedicated type (e.g.,
FlowCollectorStatus) that describes the expected properties (components and
integrations and their inner shapes) and use it instead of any when reading
existing.status in waitingComponentState (and any other accessors of
K8sResourceKind.status); update the function signature/locals to cast to
FlowCollectorStatus | undefined, ensure you reference the exact property names
components and integrations to catch misspellings, and adjust any callers or
imports to use the new type from the appropriate module.
🪄 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

Run ID: 4ad4dfc5-eafd-483c-bb8b-a677faaa0bc9

📥 Commits

Reviewing files that changed from the base of the PR and between 8cfc3b1 and eb1166d.

📒 Files selected for processing (1)
  • web/src/components/forms/resource-status.tsx

Comment thread web/src/components/forms/resource-status.tsx
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:14d63ba

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=14d63ba make set-plugin-image

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 21, 2026
@jpinsonneau jpinsonneau added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 21, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:4fa5cd3

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=4fa5cd3 make set-plugin-image

@jpinsonneau
Copy link
Copy Markdown
Member Author

/cherry-pick main-pf5

@openshift-cherrypick-robot
Copy link
Copy Markdown

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

Details

In response to this:

/cherry-pick main-pf5

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.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.76%. Comparing base (addea95) to head (ae34d78).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1445   +/-   ##
=======================================
  Coverage   51.76%   51.76%           
=======================================
  Files         233      233           
  Lines       13194    13194           
  Branches     1559     1559           
=======================================
  Hits         6830     6830           
  Misses       5750     5750           
  Partials      614      614           
Flag Coverage Δ
uitests 56.61% <100.00%> (ø)
unittests 40.79% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/components/status/flowcollector-status-icon.tsx 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 22, 2026
@jpinsonneau jpinsonneau added ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. and removed ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. labels Apr 22, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:0d8458d

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=0d8458d make set-plugin-image

Comment on lines +39 to +47
return <ConnectedIcon color="var(--pf-v6-global--success-color--100)" />;
case 'degraded':
return <ExclamationTriangleIcon color="var(--pf-v5-global--warning-color--100)" />;
return <ExclamationTriangleIcon color="var(--pf-v6-global--warning-color--100)" />;
case 'pending':
return <ExclamationTriangleIcon color="var(--pf-v5-global--warning-color--100)" />;
return <ExclamationTriangleIcon color="var(--pf-v6-global--warning-color--100)" />;
case 'error':
return <ExclamationCircleIcon color="var(--pf-v5-global--danger-color--100)" />;
return <ExclamationCircleIcon color="var(--pf-v6-global--danger-color--100)" />;
case 'onHold':
return <PauseCircleIcon color="var(--pf-v5-global--info-color--100)" />;
return <PauseCircleIcon color="var(--pf-v6-global--info-color--100)" />;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These colors doesn't exists in PF6

I need to change the references

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 22, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/components/forms/resource-status.tsx (1)

284-295: ⚠️ Potential issue | 🟡 Minor

Avoid mutating existing.status.conditions during render.

.sort() mutates the array returned from fcStatus.conditions; copy it first so rendering this table does not reorder the resource object in place.

Proposed fix
-  const conditions = (fcStatus?.conditions || []).sort((a, b) => {
+  const conditions = [...(fcStatus?.conditions || [])].sort((a, b) => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/forms/resource-status.tsx` around lines 284 - 295, The
current render mutates fcStatus.conditions because .sort() is called directly on
it; create a shallow copy before sorting (e.g., copy the array from
fcStatus?.conditions) and then call .sort() on that copy so the original
existing.status.conditions is not mutated; update the variable where conditions
is defined (the expression that builds conditions using fcStatus?.conditions and
sortConditions) to first clone the array (e.g., via spread or slice) and then
apply the sort.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/components/forms/resource-status.tsx`:
- Around line 227-230: The current early return in resource-status.tsx marks any
status === 'True' as 'success' which misclassifies cases like status === 'True'
with reason containing 'Degraded' (e.g., "Ready,Degraded"); change the ordering
to check for degraded first: if status === 'True' and reason includes 'Degraded'
(or equals 'Degraded') return 'degraded' (or 'warning' per your existing
conventions) before the generic status === 'True' success branch; update the
conditional in the function that uses variables status and reason so it aligns
with web/src/components/forms/utils.ts behavior.

In `@web/src/utils/__tests__/theme-hook.spec.ts`:
- Around line 22-26: The test duplicates the v6 case but the hook (useTheme in
web/src/utils/theme-hook.ts) still supports pf-v5-theme-dark; update the spec so
one test covers pf-v6-theme-dark and the other covers pf-v5-theme-dark: change
the second test that currently adds 'pf-v6-theme-dark' to instead add
'pf-v5-theme-dark', call renderHook(() => useTheme()) and assert result.current
is true, ensuring both themes are verified; alternatively, if v5 support is
intentionally removed, delete the v5 handling from useTheme instead (keep
references to useTheme and the two tests in theme-hook.spec.ts consistent).

---

Outside diff comments:
In `@web/src/components/forms/resource-status.tsx`:
- Around line 284-295: The current render mutates fcStatus.conditions because
.sort() is called directly on it; create a shallow copy before sorting (e.g.,
copy the array from fcStatus?.conditions) and then call .sort() on that copy so
the original existing.status.conditions is not mutated; update the variable
where conditions is defined (the expression that builds conditions using
fcStatus?.conditions and sortConditions) to first clone the array (e.g., via
spread or slice) and then apply the sort.
🪄 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

Run ID: ee3992ff-fc47-4444-af17-7eeec52a5c4c

📥 Commits

Reviewing files that changed from the base of the PR and between eb1166d and 5dc02f9.

📒 Files selected for processing (5)
  • web/cypress/integration-tests/overview_page.cy.ts
  • web/cypress/views/netflow-page.ts
  • web/src/components/forms/resource-status.tsx
  • web/src/components/status/flowcollector-status-icon.tsx
  • web/src/utils/__tests__/theme-hook.spec.ts
✅ Files skipped from review due to trivial changes (1)
  • web/src/components/status/flowcollector-status-icon.tsx

Comment thread web/src/components/forms/resource-status.tsx
Comment on lines 22 to 26
it('should return true when pf-v6-theme-dark class is present', () => {
document.documentElement.classList.add('pf-v6-theme-dark');
const { result } = renderHook(() => useTheme());
expect(result.current).toBe(true);
});
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.

⚠️ Potential issue | 🟡 Minor

Restore the pf-v5-theme-dark coverage.

This test now duplicates Lines 16-20, while useTheme still supports pf-v5-theme-dark in web/src/utils/theme-hook.ts. Keep one v6 test and make this case cover v5, or remove v5 support from the hook if it is no longer intended.

Proposed fix
-  it('should return true when pf-v6-theme-dark class is present', () => {
-    document.documentElement.classList.add('pf-v6-theme-dark');
+  it('should return true when pf-v5-theme-dark class is present', () => {
+    document.documentElement.classList.add('pf-v5-theme-dark');
     const { result } = renderHook(() => useTheme());
     expect(result.current).toBe(true);
   });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
it('should return true when pf-v6-theme-dark class is present', () => {
document.documentElement.classList.add('pf-v6-theme-dark');
const { result } = renderHook(() => useTheme());
expect(result.current).toBe(true);
});
it('should return true when pf-v5-theme-dark class is present', () => {
document.documentElement.classList.add('pf-v5-theme-dark');
const { result } = renderHook(() => useTheme());
expect(result.current).toBe(true);
});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/utils/__tests__/theme-hook.spec.ts` around lines 22 - 26, The test
duplicates the v6 case but the hook (useTheme in web/src/utils/theme-hook.ts)
still supports pf-v5-theme-dark; update the spec so one test covers
pf-v6-theme-dark and the other covers pf-v5-theme-dark: change the second test
that currently adds 'pf-v6-theme-dark' to instead add 'pf-v5-theme-dark', call
renderHook(() => useTheme()) and assert result.current is true, ensuring both
themes are verified; alternatively, if v5 support is intentionally removed,
delete the v5 handling from useTheme instead (keep references to useTheme and
the two tests in theme-hook.spec.ts consistent).

@jpinsonneau jpinsonneau force-pushed the 2376-followup branch 2 times, most recently from a68b049 to 9707082 Compare April 22, 2026 14:39
@jpinsonneau jpinsonneau added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 22, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:60790c7

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=60790c7 make set-plugin-image

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 22, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/components/forms/resource-status.tsx (1)

285-296: ⚠️ Potential issue | 🟡 Minor

Avoid mutating fcStatus.conditions during render.

.sort() mutates the array returned from existing.status. Copy it first so rendering does not reorder prop/cache-owned data.

Proposed change
-  const conditions = (fcStatus?.conditions || []).sort((a, b) => {
+  const conditions = [...(fcStatus?.conditions ?? [])].sort((a, b) => {

As per coding guidelines, web/src/**/*.{ts,tsx}: Check React hooks dependencies, component re-render optimization, and TypeScript type safety.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/forms/resource-status.tsx` around lines 285 - 296, The
current render mutates fcStatus.conditions by calling .sort() directly; change
the code to sort a shallow copy instead (e.g., make a copy of
fcStatus?.conditions via spread or slice before sorting) so that the original
prop/cache-owned array is not mutated; update the expression that defines
conditions (which currently uses fcStatus?.conditions and sortConditions) to
create and sort a copied array and keep the existing sort comparator logic
unchanged.
🧹 Nitpick comments (2)
web/cypress/views/netflow-page.ts (1)

57-60: Wait on the refresh option, not a global PatternFly menu.

.pf-v6-c-menu can match any visible menu. Waiting on OFF_KEY directly makes this flow less flaky.

Proposed change
-                cy.get('.pf-v6-c-menu').should('be.visible')
-                cy.get('[data-test="OFF_KEY"]')
+                cy.byTestID('OFF_KEY')
                     .should('be.visible')
                     .click()

As per coding guidelines, web/cypress/**/*.ts: Verify E2E test stability, proper waits, and selector resilience.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/views/netflow-page.ts` around lines 57 - 60, Replace the broad
wait on the global PatternFly menu with a direct wait on the specific refresh
option: remove or stop relying on cy.get('.pf-v6-c-menu').should('be.visible')
and instead target the unique selector cy.get('[data-test="OFF_KEY"]') — assert
.should('be.visible') on that element and then .click() it; update the code
around the selectors where .pf-v6-c-menu and [data-test="OFF_KEY"] are used so
the test waits on the specific option rather than the global menu to reduce
flakiness.
web/cypress/integration-tests/overview_page.cy.ts (1)

129-129: Avoid PatternFly class selectors for the panel checkbox.

The checkbox id is already stable; the .pf-v6-* class makes this test brittle across PatternFly updates. Scope the id to the modal instead.

Proposed change
-        cy.get('.pf-v6-c-data-list__check > `#top_avg_packet_rates`').click();
+        cy.get(overviewSelectors.panelsModal)
+            .find('#top_avg_packet_rates')
+            .should('exist')
+            .click();

As per coding guidelines, web/cypress/**/*.ts: Verify E2E test stability, proper waits, and selector resilience.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/cypress/integration-tests/overview_page.cy.ts` at line 129, The selector
uses a brittle PatternFly class; replace ".pf-v6-c-data-list__check >
`#top_avg_packet_rates`" with a stable scoped lookup that targets the
modal/container first (e.g. the modal's id or data-testid) and then finds the
checkbox by its stable id "#top_avg_packet_rates"; also ensure the container is
visible before interacting (e.g. assert the modal is visible then
find("#top_avg_packet_rates").click()) so the test is resilient to PF class
changes and timing issues.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@web/src/components/forms/resource-status.tsx`:
- Around line 206-210: The block handling type === 'ConfigurationIssue' treats
non-True states as 'unknown' causing a normal False condition to render
unhealthy; update the conditional to explicitly return 'success' (or the
component's healthy token) when status === 'False' so that
ConfigurationIssue=False is rendered healthy—modify the type ===
'ConfigurationIssue' branch (using the existing status and reason variables and
replacing the fallback return 'unknown') to return 'success' for status ===
'False', keep the existing checks for status === 'True' && reason === 'Error' ->
'error' and status === 'True' && reason === 'Warnings' -> 'warning'.

---

Outside diff comments:
In `@web/src/components/forms/resource-status.tsx`:
- Around line 285-296: The current render mutates fcStatus.conditions by calling
.sort() directly; change the code to sort a shallow copy instead (e.g., make a
copy of fcStatus?.conditions via spread or slice before sorting) so that the
original prop/cache-owned array is not mutated; update the expression that
defines conditions (which currently uses fcStatus?.conditions and
sortConditions) to create and sort a copied array and keep the existing sort
comparator logic unchanged.

---

Nitpick comments:
In `@web/cypress/integration-tests/overview_page.cy.ts`:
- Line 129: The selector uses a brittle PatternFly class; replace
".pf-v6-c-data-list__check > `#top_avg_packet_rates`" with a stable scoped lookup
that targets the modal/container first (e.g. the modal's id or data-testid) and
then finds the checkbox by its stable id "#top_avg_packet_rates"; also ensure
the container is visible before interacting (e.g. assert the modal is visible
then find("#top_avg_packet_rates").click()) so the test is resilient to PF class
changes and timing issues.

In `@web/cypress/views/netflow-page.ts`:
- Around line 57-60: Replace the broad wait on the global PatternFly menu with a
direct wait on the specific refresh option: remove or stop relying on
cy.get('.pf-v6-c-menu').should('be.visible') and instead target the unique
selector cy.get('[data-test="OFF_KEY"]') — assert .should('be.visible') on that
element and then .click() it; update the code around the selectors where
.pf-v6-c-menu and [data-test="OFF_KEY"] are used so the test waits on the
specific option rather than the global menu to reduce flakiness.
🪄 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

Run ID: f6ae8696-adbe-4419-99bc-8b9a336d2287

📥 Commits

Reviewing files that changed from the base of the PR and between 5dc02f9 and 601ce50.

📒 Files selected for processing (4)
  • web/cypress/integration-tests/overview_page.cy.ts
  • web/cypress/views/netflow-page.ts
  • web/src/components/forms/resource-status.tsx
  • web/src/components/status/flowcollector-status-icon.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/src/components/status/flowcollector-status-icon.tsx

Comment on lines +206 to +210
if (type === 'ConfigurationIssue') {
if (status === 'True' && reason === 'Error') return 'error';
if (status === 'True' && reason === 'Warnings') return 'warning';
return 'unknown';
}
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.

⚠️ Potential issue | 🟠 Major

Render ConfigurationIssue=False as healthy.

ConfigurationIssue is a negative condition from the operator: True means an issue exists. With the current fallback, the normal False state renders as unknown instead of success.

Proposed change
   if (type === 'ConfigurationIssue') {
     if (status === 'True' && reason === 'Error') return 'error';
     if (status === 'True' && reason === 'Warnings') return 'warning';
+    if (status === 'False') return 'success';
     return 'unknown';
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/forms/resource-status.tsx` around lines 206 - 210, The
block handling type === 'ConfigurationIssue' treats non-True states as 'unknown'
causing a normal False condition to render unhealthy; update the conditional to
explicitly return 'success' (or the component's healthy token) when status ===
'False' so that ConfigurationIssue=False is rendered healthy—modify the type ===
'ConfigurationIssue' branch (using the existing status and reason variables and
replacing the fallback return 'unknown') to return 'success' for status ===
'False', keep the existing checks for status === 'True' && reason === 'Error' ->
'error' and status === 'True' && reason === 'Warnings' -> 'warning'.

@kapjain-rh
Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 22, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:8193b05

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=8193b05 make set-plugin-image

@jpinsonneau
Copy link
Copy Markdown
Member Author

Rebased without changes

@github-actions github-actions Bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 23, 2026
@kapjain-rh
Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Apr 23, 2026
@github-actions
Copy link
Copy Markdown

New image:

quay.io/netobserv/network-observability-console-plugin:fff4049

It will expire in two weeks.

To deploy this build, run from the operator repo, assuming the operator is running:

USER=netobserv VERSION=fff4049 make set-plugin-image

@kapjain-rh
Copy link
Copy Markdown
Member

/lgtm
/label qe-approved

@openshift-ci openshift-ci Bot added qe-approved QE has approved this pull request lgtm labels Apr 23, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 23, 2026

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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-merge-bot openshift-merge-bot Bot merged commit 8f299f9 into netobserv:main Apr 23, 2026
16 of 17 checks passed
@openshift-cherrypick-robot
Copy link
Copy Markdown

@jpinsonneau: new pull request created: #1454

Details

In response to this:

/cherry-pick main-pf5

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.

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

Labels

approved lgtm ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. qe-approved QE has approved this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants