Skip to content

Extend flatpak view and entity with remote details page - #1924

Merged
vijaysawant merged 1 commit into
SatelliteQE:masterfrom
vsedmik:fp-remote-details
Aug 12, 2025
Merged

Extend flatpak view and entity with remote details page#1924
vijaysawant merged 1 commit into
SatelliteQE:masterfrom
vsedmik:fp-remote-details

Conversation

@vsedmik

@vsedmik vsedmik commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

This PR just extends the Flatpak view and entity with the brand new Flatpak remote details page.

Requires:
Katello/katello#11424
Katello/katello#11452
Katello/katello#11461

Summary by Sourcery

Extend Flatpak module with a dedicated remote details page, full CRUD and mirror capabilities, and improved view and navigation reliability.

New Features:

  • Add Flatpak remote details page view and associated create, edit, delete, and mirror modals
  • Implement create, edit, delete, read details, and mirror operations in FlatpakRemotesEntity
  • Add 'Create new' button and repository search input to FlatpakRemotesView
  • Introduce retry_navigation decorator on the Flatpak remotes navigation step

Enhancements:

  • Refine view readiness detection by enhancing is_displayed logic and adding explicit timeouts for stability

@vsedmik vsedmik self-assigned this Jul 11, 2025
@vsedmik vsedmik added No-CherryPick PR doesnt need CherryPick to previous branches Stream labels Jul 11, 2025
@sourcery-ai

sourcery-ai Bot commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a dedicated Flatpak remote details page and CRUD modals, enriches the Flatpak Remotes view, and updates entity methods to leverage new workflows with retries and extended timeouts.

Class diagram for Flatpak Remotes views and modals

classDiagram
    class FlatpakRemotesView {
        +create_btn
        +table
        +is_displayed()
    }
    class FlatpakRemoteDetailsView {
        +title
        +url
        +subtitle
        +decription
        +table
        +pagination
        +is_displayed()
    }
    class CreateFlatpakRemoteModal {
        +title
        +name
        +url
        +username
        +password
        +create_btn
        +cancel_btn
        +is_displayed()
    }
    class EditFlatpakRemoteModal {
        +title
        +name
        +url
        +username
        +password
        +update_btn
        +cancel_btn
        +is_displayed()
    }
    class MirrorFlatpakRemoteModal {
        +title
        +searchbar
        +mirror_btn
        +cancel_btn
        +is_displayed()
    }
    class FlatpakRemoteDeleteModal {
        +title
        +delete_btn
        +cancel_btl
        +is_displayed()
    }
    FlatpakRemotesView <|-- FlatpakRemoteDetailsView
    FlatpakRemotesView <|-- CreateFlatpakRemoteModal
    FlatpakRemotesView <|-- EditFlatpakRemoteModal
    FlatpakRemotesView <|-- MirrorFlatpakRemoteModal
    FlatpakRemotesView <|-- FlatpakRemoteDeleteModal
Loading

Class diagram for FlatpakRemotesEntity methods

classDiagram
    class FlatpakRemotesEntity {
        +search(value)
        +read(widget_names)
        +read_table()
        +read_remote_details(name, repo_search)
        +create(values)
        +edit(entity_name, values)
        +delete(entity_name)
        +scan(entity_name)
        +mirror(remote, repo, product)
    }
    FlatpakRemotesEntity <|-- ShowAllFlatpakRemotes : navigator
    ShowAllFlatpakRemotes : +step()
    ShowAllFlatpakRemotes : VIEW = FlatpakRemotesView
Loading

File-Level Changes

Change Details Files
Extended FlatpakRemotesView with new UI elements and refined display logic
  • Imported PF5Button and SearchInput for creation workflows
  • Added create_btn and adjusted the 'Name' column locator
  • Updated is_displayed to also validate title, loading state, and results presence
airgun/views/flatpak.py
Added dedicated Flatpak remote details view and CRUD modals
  • Introduced FlatpakRemoteDetailsView with table and pagination support
  • Created Create/Edit/Mirror/Delete modal classes with form fields and action buttons
  • Implemented is_displayed checks for each new view and modal
airgun/views/flatpak.py
Enhanced FlatpakRemotesEntity with new workflows and extended timeouts
  • Applied 20s timeout to all view.wait_displayed calls
  • Refactored scan into read_remote_details and added optional repository filtering
  • Implemented create, edit, delete, and mirror methods using new views and modals
  • Added retry_navigation decorator to the ShowAllFlatpakRemotes navigator step
airgun/entities/flatpak.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

@vsedmik
vsedmik force-pushed the fp-remote-details branch 4 times, most recently from d2311a3 to 411eace Compare August 4, 2025 14:17
@vsedmik
vsedmik marked this pull request as ready for review August 4, 2025 18:32

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

  • Consider extracting the repeated timeout values (e.g. '20s') and common wait/display logic into constants or helper methods to reduce duplication.
  • There are a couple of typos in attribute names (e.g. 'decription' instead of 'description' and 'cancel_btl' instead of 'cancel_btn') that could lead to runtime errors.
  • The is_displayed implementation is duplicated across multiple modal and view classes—consider abstracting that check into a shared mixin or base class.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the repeated timeout values (e.g. '20s') and common wait/display logic into constants or helper methods to reduce duplication.
- There are a couple of typos in attribute names (e.g. 'decription' instead of 'description' and 'cancel_btl' instead of 'cancel_btn') that could lead to runtime errors.
- The `is_displayed` implementation is duplicated across multiple modal and view classes—consider abstracting that check into a shared mixin or base class.

## Individual Comments

### Comment 1
<location> `airgun/views/flatpak.py:58` </location>
<code_context>
+    title = OUIATitle('flatpak-remote-title')
+    url = OUIAText('url-text-value')
+    subtitle = OUIATitle('flatpak-remote-subtitle')
+    decription = OUIAText('flatpak-remote-description')
+
+    table = PF5OUIATable(
</code_context>

<issue_to_address>
Typo in attribute name 'decription'.

Please rename 'decription' to 'description' for consistency.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    decription = OUIAText('flatpak-remote-description')
=======
    description = OUIAText('flatpak-remote-description')
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `airgun/views/flatpak.py:144` </location>
<code_context>
+    title = Text("//span[normalize-space(.)='Delete Flatpak remote?']")
+
+    delete_btn = PF5Button('Delete')
+    cancel_btl = PF5Button('Cancel')
+
+    @property
</code_context>

<issue_to_address>
Typo in attribute name 'cancel_btl'.

Consider renaming 'cancel_btl' to 'cancel_btn' for consistency with existing naming conventions.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    delete_btn = PF5Button('Delete')
    cancel_btl = PF5Button('Cancel')
=======
    delete_btn = PF5Button('Delete')
    cancel_btn = PF5Button('Cancel')
>>>>>>> REPLACE

</suggested_fix>

### Comment 3
<location> `airgun/entities/flatpak.py:148` </location>
<code_context>
+        view.table.row(name=repo)['Mirror'].widget.click()
+        view = MirrorFlatpakRemoteModal(self.browser)
+        view.wait_displayed(timeout='20s')
+        view.searchbar.fill(product.name)
+        self.browser.plugin.ensure_page_safe()
+        view.mirror_btn.click()
</code_context>

<issue_to_address>
Assumes 'product' has a 'name' attribute.

If 'product' is not an object with a 'name' attribute (e.g., a string), this will cause an AttributeError. Please validate or document the expected type for 'product'.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
        view.table.row(name=repo)['Mirror'].widget.click()
        view = MirrorFlatpakRemoteModal(self.browser)
        view.wait_displayed(timeout='20s')
        view.searchbar.fill(product.name)
        self.browser.plugin.ensure_page_safe()
        view.mirror_btn.click()
=======
        view.table.row(name=repo)['Mirror'].widget.click()
        view = MirrorFlatpakRemoteModal(self.browser)
        view.wait_displayed(timeout='20s')
        # Expecting 'product' to be an object with a 'name' attribute (str).
        if not hasattr(product, 'name'):
            raise TypeError(f"'product' must have a 'name' attribute, got {type(product).__name__}")
        view.searchbar.fill(product.name)
        self.browser.plugin.ensure_page_safe()
        view.mirror_btn.click()
>>>>>>> REPLACE

</suggested_fix>

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.

Comment thread airgun/views/flatpak.py Outdated
Comment thread airgun/views/flatpak.py Outdated
Comment thread airgun/entities/flatpak.py Outdated
Comment thread airgun/entities/flatpak.py Outdated

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

Nothing major to add here, looks good. I'd commit those name tweaks the bot suggested.

LGTM

Comment thread airgun/views/flatpak.py
)


class FlatpakRemoteDetailsView(BaseLoggedInView, SearchableViewMixinPF4):

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.

We don't need to do this here, but we should very much look into making a new PF5 Searchable View Mixin, or at least creating a dummy one so that we don't have to continue to have PF4 branded classes imported into our new views.

Non blocking here, though, since this doesn't exist currently.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree we should implement PF5 Searchable View Mixin, somewhat I expected it to happen during the PF5 refactor and I didn't want block myself on this.

Anyway, it should be a different themed PR, I think. We would need to update a bunch of other views with the new PF5SVM in it.

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.

Agree, we should not block on this. I will create an issue for this.

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.

Comment thread airgun/views/flatpak.py Outdated
Comment thread airgun/views/flatpak.py Outdated
@LadislavVasina1
LadislavVasina1 self-requested a review August 5, 2025 07:31
@LadislavVasina1 LadislavVasina1 added the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 5, 2025
@LadislavVasina1

Copy link
Copy Markdown
Contributor

PRT Passed in SatelliteQE/robottelo#18985

Comment thread airgun/views/flatpak.py Outdated
Comment thread airgun/views/flatpak.py Outdated

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

Small change requested, otherwise great addition @vsedmik, GJ!

@vsedmik vsedmik removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 5, 2025
@vsedmik
vsedmik force-pushed the fp-remote-details branch from f1a920f to 025081f Compare August 6, 2025 12:22
@vsedmik

vsedmik commented Aug 6, 2025

Copy link
Copy Markdown
Contributor Author

Squashed and rebased.

@vsedmik
vsedmik force-pushed the fp-remote-details branch from 025081f to 42a5a5a Compare August 6, 2025 20:48
@vsedmik vsedmik added the PRT-Passed Indicates that latest PRT run is passed for the PR label Aug 7, 2025
@vijaysawant
vijaysawant merged commit 3e9beb5 into SatelliteQE:master Aug 12, 2025
9 checks passed
@vsedmik
vsedmik deleted the fp-remote-details branch August 12, 2025 12:25
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