Skip to content

Automation to support MultiCV bulk update#20755

Merged
vijaysawant merged 2 commits intoSatelliteQE:masterfrom
jnagare-redhat:multi_cv_bulk_update
Feb 11, 2026
Merged

Automation to support MultiCV bulk update#20755
vijaysawant merged 2 commits intoSatelliteQE:masterfrom
jnagare-redhat:multi_cv_bulk_update

Conversation

@jnagare-redhat
Copy link
Contributor

@jnagare-redhat jnagare-redhat commented Feb 10, 2026

Problem Statement

Due to addition of new MutiCV feature, existing flow to bulk update Manage content->Content view environments was breaking

Solution

Added automation to support MultiCV bulk update Manage content->Content view environments

Related Issues

Its part of card : https://issues.redhat.com/browse/SAT-631
Airgun PR :SatelliteQE/airgun#2308

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k test_all_hosts_bulk_cve_reassign
airgun: 2308

Summary by Sourcery

Tests:

  • Extend all-hosts bulk CVE reassignment test to verify lifecycle environment values before and after MultiCV updates and to always reset the Lifecycle environment column visibility.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 10, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the bulk CVE reassignment UI test for hosts to be resilient to MultiCV changes by explicitly managing the Lifecycle environment column, validating pre/post states, using the new manage_cve API, and ensuring table column cleanup via a finally block.

File-Level Changes

Change Details Files
Make the bulk CVE reassignment test robust to table layout changes and new MultiCV parameters while ensuring UI state cleanup.
  • Wrap the test body in a try/finally block so that the Lifecycle environment column is always hidden at the end of the test
  • Ensure the Lifecycle environment column is enabled before assertions by checking displayed headers and toggling the column if missing
  • Add pre-update assertions that all rows show the original lifecycle environment before running the bulk CVE reassignment
  • Call the updated manage_cve helper using explicit lce_name and cv_name keyword arguments to support the MultiCV flow
  • Add post-update assertions that all rows show the new lifecycle environment after the bulk update
tests/foreman/ui/test_host.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@jnagare-redhat jnagare-redhat added No-CherryPick PR doesnt need CherryPick to previous branches pre-commit.ci autofix labels Feb 10, 2026
@jnagare-redhat jnagare-redhat added the Stream Introduced in or relating directly to Satellite Stream/Master label Feb 10, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • The new try/finally cleanup always hides the Lifecycle environment column at the end of the test, even if it was originally visible; consider tracking the initial column visibility and restoring it to its original state instead of unconditionally setting it to False.
  • The change from manage_cve(lce=..., cv=...) to manage_cve(lce_name=..., cv_name=...) suggests a method signature update; if this is intended to be compatible with older airgun versions, consider keeping or shimming the old parameter names to avoid breaking existing callers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new try/finally cleanup always hides the `Lifecycle environment` column at the end of the test, even if it was originally visible; consider tracking the initial column visibility and restoring it to its original state instead of unconditionally setting it to `False`.
- The change from `manage_cve(lce=..., cv=...)` to `manage_cve(lce_name=..., cv_name=...)` suggests a method signature update; if this is intended to be compatible with older airgun versions, consider keeping or shimming the old parameter names to avoid breaking existing callers.

## Individual Comments

### Comment 1
<location> `tests/foreman/ui/test_host.py:2088-2091` </location>
<code_context>
+            post_table = session.all_hosts.read_table()
+            for row in post_table:
+                assert row['Lifecycle environment'] == lce2.name
+        finally:
             session.all_hosts.manage_table_columns(
                 {
-                    'Lifecycle environment': True,
+                    'Lifecycle environment': False,
                 }
             )
</code_context>

<issue_to_address>
**issue (testing):** Restore the original column visibility rather than always disabling the `Lifecycle environment` column

The new `finally` block always hides the `Lifecycle environment` column, even if it was visible beforehand, which can make tests order-dependent and affect later UI tests. Instead, capture the column’s initial visibility before the `try` and restore that exact state in `finally` (e.g., read `headers`, compute a boolean, and pass it to `manage_table_columns` during cleanup).
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@LadislavVasina1
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k test_all_hosts_bulk_cve_reassign
airgun: 2308

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 14225
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_host.py -k test_all_hosts_bulk_cve_reassign --external-logging
Test Result : =========== 1 passed, 92 deselected, 9 warnings in 966.39s (0:16:06) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 10, 2026
Copy link
Contributor

@vijaysawant vijaysawant left a comment

Choose a reason for hiding this comment

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

requested small nitpick change, rest of things looks good.

Co-authored-by: Vijaykumar Sawant <visawant@redhat.com>
@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 11, 2026
@jnagare-redhat
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k test_all_hosts_bulk_cve_reassign
airgun: 2308

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 14267
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_host.py -k test_all_hosts_bulk_cve_reassign --external-logging
Test Result : ========== 1 passed, 92 deselected, 9 warnings in 1007.40s (0:16:47) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Feb 11, 2026
@vijaysawant vijaysawant merged commit 62b2b54 into SatelliteQE:master Feb 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants