Skip to content

Insights View Fixes - #1937

Merged
LadislavVasina1 merged 1 commit into
SatelliteQE:masterfrom
LadislavVasina1:InsightsFixes
Jul 30, 2025
Merged

Insights View Fixes#1937
LadislavVasina1 merged 1 commit into
SatelliteQE:masterfrom
LadislavVasina1:InsightsFixes

Conversation

@LadislavVasina1

@LadislavVasina1 LadislavVasina1 commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

Update views/cloud_insights.py file to match the format we use elsewhere in Airgun + fix locators to make tests pass.

This pr fixes:
test_rhcloud_insights.py/test_rhcloud_insights_remediate_multiple_host
test_rhcloud_insights.py/test_rhcloud_insights_e2e

PRT Example

trigger: test-robottelo
pytest: tests/foreman/ui/test_rhcloud_insights.py -k "test_rhcloud_insights_e2e[rhel10-ipv4-hosted] or test_rhcloud_insights_remediate_multiple_hosts[rhel10-ipv4-hosted]"
airgun: 1937
image image

Summary by Sourcery

Refactor cloud insights views to PF5 widget classes and update their OUIAIDs and locators to restore test compatibility.

Bug Fixes:

  • Fix widget locators and component IDs to resolve failures in test_rhcloud_insights_remediate_multiple_hosts and test_rhcloud_insights_e2e

Enhancements:

  • Replace generic PF4 components with PF5Button, PF5OUIASwitch, PF5OUIADropdown, PF5OUIAPatternflyTable, PF5OUIAModal, and PF5Pagination in views/cloud_insights.py
  • Adjust OUIA component IDs and locator strings to align with PF5 patterns

@LadislavVasina1 LadislavVasina1 self-assigned this Jul 29, 2025
@LadislavVasina1 LadislavVasina1 added view Issues related to Views coverage No-CherryPick PR doesnt need CherryPick to previous branches Stream labels Jul 29, 2025
@sourcery-ai

sourcery-ai Bot commented Jul 29, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Refactors Cloud Insights view definitions to use PF5-specific widget classes and updated OUIA locators, aligning the file with Airgun’s PF5 conventions to restore test compatibility.

Class diagram for updated Cloud Insights view classes

classDiagram
    class BaseLoggedInView
    class SearchableViewMixinPF4
    class Modal
    class PF5OUIAModal
    class Button
    class PF5Button
    class Switch
    class PF5OUIASwitch
    class Dropdown
    class PF5OUIADropdown
    class PatternflyTable
    class PF5OUIAPatternflyTable
    class Checkbox
    class TextInput
    class Text
    class PF5Pagination
    class View

    class CloudTokenView {
        rhcloud_token: TextInput
        save_token: PF5Button
        is_displayed()
    }
    CloudTokenView --|> BaseLoggedInView

    class RemediationView {
        OUIA_ID = 'remediation-modal'
        remediate: PF5Button
        cancel: PF5Button
        table: PF5OUIAPatternflyTable
    }
    RemediationView --|> PF5OUIAModal

    class CloudInsightsView {
        title: Text
        insights_sync_switcher: PF5OUIASwitch
        remediate: PF5Button
        insights_dropdown: PF5OUIADropdown
        select_all: Checkbox
        table: PF5OUIAPatternflyTable
        select_all_hits: PF5Button
        clear_hits_selection: PF5Button
        pagination: PF5Pagination
        remediation_window: RemediationView
    }
    CloudInsightsView --|> BaseLoggedInView
    CloudInsightsView --|> SearchableViewMixinPF4
    CloudInsightsView --> RemediationView : nested

    PF5Button --|> Button
    PF5OUIAModal --|> Modal
    PF5OUIASwitch --|> Switch
    PF5OUIADropdown --|> Dropdown
    PF5OUIAPatternflyTable --|> PatternflyTable
Loading

File-Level Changes

Change Details Files
Migrate UI widgets to PF5-specific classes
  • Replace generic Button, Switch, Dropdown, Modal, and Table with PF5Button, PF5OUIASwitch, PF5OUIADropdown, PF5OUIAModal, and PF5OUIAPatternflyTable
  • Swap legacy PatternflyTable for PF5OUIAPatternflyTable
  • Adopt PF5 components for remediations modal and main insights view
airgun/views/cloud_insights.py
Update OUIA IDs and component locators
  • Change OUIA_ID in RemediationView to “remediation-modal”
  • Rename table component_id values to remediations-table and rh-cloud-recommendations-table
  • Adjust locators for switcher, dropdown, and save_token to PF5-compliant identifiers
airgun/views/cloud_insights.py
Introduce PF5 pagination support
  • Add PF5Pagination component to CloudInsightsView
airgun/views/cloud_insights.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

@LadislavVasina1

Copy link
Copy Markdown
Contributor Author
trigger: test-robottelo
pytest: tests/foreman/ui/test_rhcloud_insights.py -k "test_rhcloud_insights_e2e[rhel10-ipv4-hosted] or test_rhcloud_insights_remediate_multiple_hosts[rhel10-ipv4-hosted]"
airgun: 1937

@sourcery-ai sourcery-ai 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.

Hey @LadislavVasina1 - I've reviewed your changes - here's some feedback:

  • Make sure to update the imports at the top of cloud_insights.py to include all of the new PF5 component classes used in this diff (e.g., PF5Button, PF5OUIASwitch, PF5OUIADropdown, PF5OUIAPatternflyTable, PF5OUIAModal).
  • Verify that the new OUIA_ID and component_id values ('remediation-modal', 'remediations-table', 'rh-cloud-recommendations-table') match the actual attributes in the rendered UI to avoid locator mismatches.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Make sure to update the imports at the top of cloud_insights.py to include all of the new PF5 component classes used in this diff (e.g., PF5Button, PF5OUIASwitch, PF5OUIADropdown, PF5OUIAPatternflyTable, PF5OUIAModal).
- Verify that the new OUIA_ID and component_id values ('remediation-modal', 'remediations-table', 'rh-cloud-recommendations-table') match the actual attributes in the rendered UI to avoid locator mismatches.

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 LadislavVasina1 added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 29, 2025
@LadislavVasina1
LadislavVasina1 merged commit d470841 into SatelliteQE:master Jul 30, 2025
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 view Issues related to Views coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants