Skip to content

All Hosts legacy UI navigation fix - #1935

Merged
pnovotny merged 1 commit into
SatelliteQE:masterfrom
pnovotny:all-hosts-legacy-ui-nav-fix
Jul 29, 2025
Merged

All Hosts legacy UI navigation fix#1935
pnovotny merged 1 commit into
SatelliteQE:masterfrom
pnovotny:all-hosts-legacy-ui-nav-fix

Conversation

@pnovotny

@pnovotny pnovotny commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

hosts: navigating to 'All' goes to the legacy UI page by default

To ensure proper test functionality, navigating to 'All' hosts goes to the now-legacy UI Hosts page.

Once all functionality of the new Hosts page is covered in the new HostsView view, this workaround can be removed.

PRT example:

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k 'test_all_hosts_manage_columns or test_positive_host_details_read_templates'

Summary by Sourcery

Implement a temporary HostsView and navigation workflow so that selecting 'All Hosts' routes through the new page and defaults back to the legacy UI until full functionality is migrated.

Enhancements:

  • Introduce a stub HostsView for the new All Hosts page with a dropdown action for legacy UI fallback
  • Add a new 'NewUIAll' navigation step to reach the HostsView via the main menu
  • Modify the existing 'All' navigation step to first navigate to HostsView and then select the legacy UI option

To ensure proper test functionality, navigating to 'All' hosts
goes to the now-legacy UI Hosts page.

Once all functionality is covered in the new Hosts page view,
this workaround can be removed.
@pnovotny pnovotny added No-CherryPick PR doesnt need CherryPick to previous branches Stream labels Jul 25, 2025
@pnovotny pnovotny self-assigned this Jul 25, 2025
@pnovotny
pnovotny requested a review from a team July 25, 2025 16:21
@sourcery-ai

sourcery-ai Bot commented Jul 25, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR implements a transitional workaround by introducing a minimal new HostsView and adjusting navigation steps to ensure that selecting “All Hosts” routes through the new view before landing on the legacy UI page. It adds a dedicated navigator step for the new UI path and updates the legacy navigation to use the new step as a prerequisite.

Sequence diagram for navigation to All Hosts via new and legacy UI

sequenceDiagram
    actor Tester
    participant Navigator as navigator (ShowAllHosts)
    participant NewUI as ShowAllHosts_NewUIAll
    participant HostsView
    participant LegacyUI
    Tester->>Navigator: select 'All Hosts'
    Navigator->>NewUI: prerequisite step (NewUIAll)
    NewUI->>HostsView: display new HostsView
    Navigator->>HostsView: actions.item_select('Legacy UI')
    HostsView->>LegacyUI: transition to legacy UI page
Loading

Class diagram for new and updated navigation steps for Hosts

classDiagram
    class HostsView {
        +title
        +actions
        +is_displayed
    }
    class ShowAllHosts {
        +VIEW
        +prerequisite
        +step(*args, **kwargs)
    }
    class ShowAllHosts_NewUIAll {
        +VIEW
        +step(*args, **kwargs)
    }
    ShowAllHosts --|> NavigateStep
    ShowAllHosts_NewUIAll --|> NavigateStep
    HostsView --|> BaseLoggedInView
    ShowAllHosts : prerequisite = NavigateToSibling('NewUIAll')
    ShowAllHosts : VIEW = HostsView
    ShowAllHosts_NewUIAll : VIEW = HostsView
Loading

File-Level Changes

Change Details Files
Add minimal HostsView for new UI navigation
  • Define HostsView class with title and actions dropdown
  • Implement is_displayed property using browser.wait_for_element
airgun/views/host_new.py
Register new navigator step for new UI “All Hosts”
  • Register ShowAllHosts under navigator for HostEntity 'NewUIAll'
  • Set VIEW to HostsView and implement step to select 'Hosts' → 'All Hosts'
airgun/entities/host_new.py
Update legacy navigation to route via new UI step
  • Add prerequisite NavigateToSibling('NewUIAll')
  • Change step to use actions.item_select('Legacy UI')
  • Extend docstring to explain temporary workaround
airgun/entities/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

@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 @pnovotny - I've reviewed your changes - here's some feedback:

  • There are two ShowAllHosts classes registered under different steps; consider renaming one to avoid confusion and make their purposes clearer.
  • HostsView.is_displayed only checks for the H1 title—adding validation for key page elements (e.g., the hosts table or filters) would make the view detection more robust.
  • Instead of sequencing through NavigateToSibling for legacy vs. new UI, consider consolidating the toggle logic into a single navigation step or leveraging a feature flag to reduce coupling.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- There are two ShowAllHosts classes registered under different steps; consider renaming one to avoid confusion and make their purposes clearer.
- HostsView.is_displayed only checks for the H1 title—adding validation for key page elements (e.g., the hosts table or filters) would make the view detection more robust.
- Instead of sequencing through NavigateToSibling for legacy vs. new UI, consider consolidating the toggle logic into a single navigation step or leveraging a feature flag to reduce coupling.

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.

@pnovotny
pnovotny requested a review from a team July 25, 2025 16:22
@pnovotny

Copy link
Copy Markdown
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k 'test_all_hosts_manage_columns or test_positive_host_details_read_templates'

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jul 25, 2025

@LadislavVasina1 LadislavVasina1 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.

@pnovotny ACK, looks good. Thank you very much for dealing with that!

@pnovotny
pnovotny enabled auto-merge (squash) July 28, 2025 11:17

@damoore044 damoore044 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.

thank you for this fix, helps a lot!

@pnovotny
pnovotny merged commit 8835ab5 into SatelliteQE:master Jul 29, 2025
11 checks passed
@pnovotny
pnovotny deleted the all-hosts-legacy-ui-nav-fix branch July 29, 2025 16:22
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants