Skip to content

Conversation

@servolkov
Copy link
Contributor

@servolkov servolkov commented Jan 20, 2026

  1. collecting the necessary namespaces for the BGP and MTV test suites
  2. moving namespace names to constants for reuse

Summary by CodeRabbit

Release Notes

  • Refactor

    • Consolidated hardcoded namespace references across testing infrastructure to use centralized constant definitions.
    • Unified marker collection logic for improved efficiency in component handling checks.
  • Chores

    • Added namespace constant definitions to support consistent namespace usage throughout the testing framework.

✏️ Tip: You can customize this high-level summary in your review settings.

1) collecting the necessary namespaces for the BGP and MTV test suites
2) moving namespace names to constants for reuse

Signed-off-by: Sergei Volkov <sevolkov@rethat.com>
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Walkthrough

This PR consolidates hardcoded namespace strings into shared constants in NamespacesNames and updates all references across the codebase. Additionally, it introduces marker-based conditional logic to collect namespaces for BGP and MTV components during test setup.

Changes

Cohort / File(s) Summary
Namespace Constants Definition
utilities/constants.py
Added three new public constants: OPENSHIFT_FRR_K8S ("openshift-frr-k8s"), OPENSHIFT_MTV ("openshift-mtv"), and CNV_TESTS_UTILITIES ("cnv-tests-utilities") to replace hardcoded strings.
Marker-driven Namespace Collection
conftest.py
Introduced all_markers variable to cache node markers and reuse across component checks. Added conditional logic for network component: extends namespaces with FRR and CNV utilities if "bgp" marker present; appends MTV namespace if "mtv" marker present.
Namespace Reference Updates
tests/conftest.py, tests/network/conftest.py
Replaced hardcoded strings with new constants: CNV_TESTS_UTILITIES in CNV namespace selection and NamespacesNames.OPENSHIFT_MTV in mtv_namespace_scope_session fixture.
BGP Implementation Refactoring
tests/network/libs/bgp.py
Replaced all direct uses of private _FRR_NS_NAME with NamespacesNames.OPENSHIFT_FRR_K8S across deployment creation, namespace cleanup, FRR configuration, BGP session state lookup, and error messaging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Rationale: Changes follow a consistent, homogeneous refactoring pattern—string literals replaced systematically with constants across multiple files. The new marker-based namespace collection logic in conftest.py is straightforward conditional extension logic. No complex logic density or multi-pattern reasoning required per file; repetitive nature reduces cognitive load.

Possibly related PRs

Suggested labels

can-be-merged, branch-main, size/M, sig-network

Suggested reviewers

  • vsibirsk
  • RoniKishner
  • dshchedr
  • rnetser
  • yossisegev
  • azhivovk
  • EdDev
  • openshift-virtualization-qe-bot
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and lacks required template sections including detailed explanation of changes, issue tracking, and reviewer notes. Fill the description template with: Short description, More details explaining the namespace changes, What this PR does section, Jira ticket reference, and Special notes for reviewer.
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: moving namespace names to constants and collecting necessary namespaces for network test suites in must-gather.

✏️ 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

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.

@openshift-virtualization-qe-bot-5

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified
  • Labels: Enabled categories: branch, can-be-merged, cherry-pick, has-conflicts, hold, needs-rebase, size, verified, wip

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status
  • /reprocess - Trigger complete PR workflow reprocessing (useful if webhook failed or configuration changed)
  • /regenerate-welcome - Regenerate this welcome message

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest build-container - Rebuild and test container image
  • /retest verify-bugs-are-open - verify-bugs-are-open (optional)
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 2 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • EdDev
  • dshchedr
  • myakove
  • rnetser
  • vsibirsk

Reviewers:

  • Anatw
  • EdDev
  • RoniKishner
  • azhivovk
  • dshchedr
  • geetikakay
  • rnetser
  • servolkov
  • vsibirsk
  • yossisegev
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.39%. Comparing base (db03ed9) to head (0c6f848).
⚠️ Report is 94 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3524   +/-   ##
=======================================
  Coverage   98.38%   98.39%           
=======================================
  Files          25       25           
  Lines        2166     2174    +8     
=======================================
+ Hits         2131     2139    +8     
  Misses         35       35           
Flag Coverage Δ
utilities 98.39% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@EdDev EdDev left a comment

Choose a reason for hiding this comment

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

Thanks!

/approve

@rnetser
Copy link
Collaborator

rnetser commented Jan 20, 2026

/approve
/lgtm

Copy link
Contributor

@Anatw Anatw left a comment

Choose a reason for hiding this comment

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

Thank you

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.