Skip to content

check informers for only version >= 2.0 - #2870

Merged
openshift-merge-bot[bot] merged 2 commits into
netobserv:mainfrom
memodi:inf-check
Aug 4, 2026
Merged

check informers for only version >= 2.0#2870
openshift-merge-bot[bot] merged 2 commits into
netobserv:mainfrom
memodi:inf-check

Conversation

@memodi

@memodi memodi commented Aug 3, 2026

Copy link
Copy Markdown
Member

Description

check informers for only version >= 2.0

$ ginkgo run -v  --focus=59746 .
[1785779591] Backend Suite - 1/7491 specs Running Suite: Backend Suite - /Users/memodi/workspaces/repos/netobserv/netobserv-operator/integration-tests/backend
==========================================================================================================
Random Seed: 1785779591

Will run 1 specs
Detected OCP version: v5.0
[sig-netobserv] Network_Observability Author:aramesha-NonPreRelease-Critical-59746-NetObserv upgrade testing [Serial]
/Users/memodi/workspaces/repos/netobserv/netobserv-operator/integration-tests/backend/test_flowcollector.go:628
• PASSED [456.608 seconds]
•==========================================================================================================
Backend Suite - 1/1 specs • SUCCESS! [501.101 seconds]

Ran 1 tests
Passed: 1, Failed: 0, Skipped: 0
==========================================================================================================

PASSED TESTS (1):
----------------------------------------------------------------------------------------------------------
1. [sig-netobserv] Network_Observability Author:aramesha-NonPreRelease-Critical-59746-NetObserv upgrade testing [Serial] [456.608 seconds]

 SUCCESS! 8m21.101169049s PASS

Ginkgo ran 1 suite in 9m22.369018513s
Test Suite Passed

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

  • Bug Fixes
    • Improved deployment readiness checks for newer operator versions.
    • Older versions are now handled appropriately without unnecessary checks.
    • Missing or unavailable version information is logged and skipped gracefully.
    • Enhanced reliability when locating and validating operator version details.
    • Improved handling of multiple or invalid version matches during deployment verification.

@github-actions github-actions Bot added the integration-tests Changes that are only for integration-tests. label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 33148ff1-3558-4c4c-a6eb-0e79293cc8b5

📥 Commits

Reviewing files that changed from the base of the PR and between 5b11fe1 and 1655117.

📒 Files selected for processing (1)
  • integration-tests/backend/operator.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • integration-tests/backend/operator.go

📝 Walkthrough

Walkthrough

The integration tests discover the operator CSV version and use semantic-version comparison to conditionally check informer deployment readiness. CSV lookup errors and versions below 2.0 skip the check.

Changes

CSV-gated informer readiness

Layer / File(s) Summary
CSV version discovery
integration-tests/backend/operator.go
The backend lists namespace-scoped ClusterServiceVersions, selects the active NetObserv CSV, and returns spec.version or an error.
Version-gated readiness check
integration-tests/backend/flowcollector.go
The readiness flow checks informer deployment readiness only for CSV versions 2.0 and newer. It logs and skips lookup failures and older versions. It reuses the existing err variable.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: limiting informer checks to CSV version 2.0 and later.
Description check ✅ Passed The description includes the required sections, testing evidence, dependencies, and QE selection, but leaves non-critical checklist items unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@integration-tests/backend/flowcollector.go`:
- Around line 214-221: Update the CSV-version handling in
WaitForFlowcollectorReady around getCSVVersion so API errors or malformed values
fail closed by running waitUntilDeploymentReady for flowlogs-pipeline-informers.
Validate csvVersion with the existing semver parsing conventions, including
already-prefixed versions, and only skip the informer check when the parsed
version is valid and below v2.0.0.

In `@integration-tests/backend/operator.go`:
- Around line 358-365: Select the active OLM CSV in getCSVVersion instead of
returning the first name-prefix match: use current/installed indicators such as
Subscription association, status.currentCSV, replacement metadata, and
status.phase to identify the active candidate. Return its spec.version, and fail
explicitly when no candidate or multiple candidates remain ambiguous so
WaitForFlowcollectorReady cannot use an outdated version.
- Around line 353-355: Update getCSVVersion so the
dynamicClient.Resource(csvGVR).Namespace(operatorNamespace).List call uses a
short-lived context with a deadline, ensuring the API request cannot block
indefinitely; clean up the context after the call and preserve the existing
error return behavior.
🪄 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: ef814a59-0e09-44d7-84ce-7783f1fa0162

📥 Commits

Reviewing files that changed from the base of the PR and between 300b998 and 5b11fe1.

📒 Files selected for processing (2)
  • integration-tests/backend/flowcollector.go
  • integration-tests/backend/operator.go

Comment thread integration-tests/backend/flowcollector.go
Comment thread integration-tests/backend/operator.go Outdated
Comment thread integration-tests/backend/operator.go
@memodi
memodi requested review from Amoghrd and kapjain-rh August 3, 2026 19:57
@Amoghrd

Amoghrd commented Aug 3, 2026

Copy link
Copy Markdown
Member

/lgtm

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (300b998) to head (1655117).

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #2870   +/-   ##
============================
============================
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@memodi

memodi commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

/approve

@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: memodi

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 added the approved label Aug 4, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 5fd5473 into netobserv:main Aug 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved integration-tests Changes that are only for integration-tests. lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants