Extend flatpak view and entity with remote details page - #1924
Conversation
Reviewer's GuideAdds 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 modalsclassDiagram
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
Class diagram for FlatpakRemotesEntity methodsclassDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
d2311a3 to
411eace
Compare
There was a problem hiding this comment.
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_displayedimplementation 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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
sambible
left a comment
There was a problem hiding this comment.
Nothing major to add here, looks good. I'd commit those name tweaks the bot suggested.
LGTM
| ) | ||
|
|
||
|
|
||
| class FlatpakRemoteDetailsView(BaseLoggedInView, SearchableViewMixinPF4): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Agree, we should not block on this. I will create an issue for this.
|
PRT Passed in SatelliteQE/robottelo#18985 |
LadislavVasina1
left a comment
There was a problem hiding this comment.
Small change requested, otherwise great addition @vsedmik, GJ!
f1a920f to
025081f
Compare
|
Squashed and rebased. |
025081f to
42a5a5a
Compare
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:
Enhancements: