-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drop the gui bus upload of resources #53
Conversation
Warning Rate limit exceeded@JarbasAl has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 8 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes in this pull request involve the reorganization and enhancement of documentation in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- README.md (0 hunks)
- ovos_gui/constants.py (1 hunks)
- ovos_gui/gui_file_server.py (0 hunks)
- ovos_gui/namespace.py (7 hunks)
- ovos_gui/page.py (2 hunks)
- test/unittests/test_namespace.py (1 hunks)
Files not reviewed due to no reviewable changes (2)
- README.md
- ovos_gui/gui_file_server.py
Additional context used
Ruff
ovos_gui/namespace.py
955-955: f-string without any placeholders
Remove extraneous
f
prefix(F541)
Additional comments not posted (14)
ovos_gui/constants.py (2)
1-1
: LGTM!The import statement is correctly formatted and the imported function is used to define the
GUI_CACHE_PATH
constant.
3-3
: LGTM!The
GUI_CACHE_PATH
constant is correctly defined using theget_xdg_cache_save_path
function. The constant is named using theUPPER_CASE
convention, which is a best practice for constants in Python. The constant is used to define the cache directory path for theovos_gui
application.ovos_gui/page.py (4)
5-5
: LGTM!The import statement is correctly added.
48-50
: LGTM!The
_gui_cache
property is correctly defined and uses the appropriate variables to construct the cache path.
52-54
: LGTM!The
res_namespace
property correctly determines the namespace based on thepage_id
attribute.
56-76
: LGTM!The refactored
get_uri
method improves clarity and maintainability by:
- Removing the
server_url
parameter and associated logic.- Utilizing the
res_namespace
property to determine the appropriate path construction.- Using the
_gui_cache
property for consistent cache path structure.- Including a logging statement for debugging purposes.
- Maintaining the original error handling behavior.
test/unittests/test_namespace.py (1)
Line range hint
470-479
: LGTM! The test aligns with the PR objective.The changes in the test function
test_upload_system_resources
reflect the shift from uploading to caching system resources, which aligns with the PR objective of eliminating the GUI bus upload mechanism.The test logic and assertions remain valid for verifying the caching behavior of the
_cache_system_resources
method.ovos_gui/namespace.py (7)
Line range hint
48-58
: LGTM!The import statements are well-organized and the newly added imports seem relevant to the module.
449-452
: LGTM!The initialization of the GUI file server based on the configuration looks good. Using the
GUI_CACHE_PATH
as the root directory for serving files is a sensible approach.
704-707
: LGTM!Adding the check for active namespaces before processing the 'load_pages' request is a good defensive programming practice. The error logging will help in identifying and fixing issues related to unexpected states.
878-878
: LGTM!Including the
framework
key in themycroft.gui.port
message data is a good addition. It provides useful information about the GUI framework being used, which can be leveraged for framework-specific handling or optimizations.
927-930
: LGTM!Adding the check for active namespaces before processing the 'back' signal is a good defensive programming practice. The error logging will help in identifying and fixing issues related to unexpected states.
949-958
: LGTM!The renaming of the
_upload_system_resources
method to_cache_system_resources
accurately reflects the updated functionality of caching the system GUI resources. Removing existing resources before updating is a good practice to ensure a clean and consistent state. The resource copying logic looks straightforward, and the debug logging adds visibility into the caching process.Tools
Ruff
955-955: f-string without any placeholders
Remove extraneous
f
prefix(F541)
953-953
: LGTM!The f-string is used correctly to construct the output path for caching system resources. The interpolation of the
GUI_CACHE_PATH
variable looks good, and the resulting path seems appropriate.
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
8d49159
to
9f2427e
Compare
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
companion to OpenVoiceOS/ovos-gui#53 and OpenVoiceOS/ovos-bus-client#120 this should be merged first as it does not require the others to work and does not break anything in the wild
This is configurable, I would prefer a deprecation warning before removing the functionality completely (maybe in 1.0.0?) since it is a breaking change. |
its marked as breaking and we follow semver, so should not affect anything, besides this is not working properly so whats is there to keep compat with? the bus upload was introduced to make it work in docker, and it isnt working properly there, it is a failed attempt that never worked right, this change is meant to solve that there (still being tested) |
and yes, this is going to be 1.0.0 because of semver automations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (3)
README.md (2)
40-40
: Approved changes, but consider adding more context.The removal of file server and GUI file collection options aligns with the PR objectives to address CPU spikes and OOM errors. The added note about QT5 clients is helpful.
Consider adding a brief explanation about why these options were removed and how it affects the system's performance and stability. This would provide valuable context for users and maintainers.
Line range hint
1-58
: Consider adding important implementation details.The README currently doesn't mention two crucial points from the PR description:
- The bus client needs to be updated in all containers for this change to work properly.
- The
~/.cache/ovos_gui
directory needs to be a shared volume.Consider adding a section to the README that outlines these important implementation details. This will help users and maintainers understand the full scope of changes required when implementing this update.
ovos_gui/namespace.py (1)
297-299
: Optimize List Comprehension Usage in Page Names CheckIn the
load_pages
method, the expression[p.name for p in self.pages]
is recalculated in each iteration of the loop, which is inefficient.To improve performance, calculate the list of existing page names once before the loop:
existing_page_names = [p.name for p in self.pages] for page in pages: if page.name not in existing_page_names: new_pages.append(page)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- README.md (1 hunks)
- ovos_gui/gui_file_server.py (0 hunks)
- ovos_gui/namespace.py (10 hunks)
💤 Files with no reviewable changes (1)
- ovos_gui/gui_file_server.py
🧰 Additional context used
🪛 Ruff
ovos_gui/namespace.py
910-910: f-string without any placeholders
Remove extraneous
f
prefix(F541)
🔇 Additional comments (1)
README.md (1)
Line range hint
1-58
: Overall changes approved with suggestions for improvement.The modifications to the README accurately reflect the removal of the GUI bus upload mechanism, which aligns with the PR objectives to address CPU spikes and OOM errors. The remaining configuration instructions are clear and concise.
To further improve the documentation:
- Consider adding a brief explanation of why certain options were removed and how it benefits system performance.
- Include information about updating bus clients in all containers and the need for a shared volume for
~/.cache/ovos_gui
.These additions would provide a more comprehensive guide for users implementing these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (4)
README.md (4)
42-53
: LGTM: Valuable plugin information addedThe new section on plugins provides useful information about platform-specific GUI functionality. This addition improves the documentation and aligns with the PR's objective of clarifying system components.
Consider formatting the URLs as proper markdown links for better readability:
- [OVOS GUI Plugin Shell Companion](https://github.com/OpenVoiceOS/ovos-gui-plugin-shell-companion) - [OVOS GUI Plugin Mobile](https://github.com/OpenVoiceOS/ovos-gui-plugin-mobile) - [OVOS GUI Plugin Plasmoid](https://github.com/OpenVoiceOS/ovos-gui-plugin-plasmoid) - [OVOS GUI Plugin Bigscreen](https://github.com/OpenVoiceOS/ovos-gui-plugin-bigscreen)🧰 Tools
🪛 Markdownlint
49-49: null
Bare URL used(MD034, no-bare-urls)
50-50: null
Bare URL used(MD034, no-bare-urls)
51-51: null
Bare URL used(MD034, no-bare-urls)
52-52: null
Bare URL used(MD034, no-bare-urls)
55-58
: LGTM: Important limitations section addedThe new "Limitations" section provides crucial information about GUI resource files and their accessibility. This addition directly addresses the PR objectives by clarifying system limitations and the new approach to resource management.
There's a small typo in the word "expectd" on line 57. Please correct it to "expected":
-gui resources files are populated under `~/.cache/mycrot/ovos-gui` by skills and other OVOS components and are expectd to be accessible by GUI client applications +gui resources files are populated under `~/.cache/mycrot/ovos-gui` by skills and other OVOS components and are expected to be accessible by GUI client applications
59-61
: LGTM: Valuable information on GUI client expectations and future plansThis section provides important details about GUI client expectations and includes a TODO note about future improvements. This information aligns well with the PR objectives by explaining the new approach to resource management.
Consider a minor language improvement in line 59:
-This means GUI clients are expected to be running under the same machine or implement their own access to the resource files (resolving page names to uris is the client app responsibility) +This means GUI clients are expected to be running on the same machine or implement their own access to the resource files (resolving page names to uris is the client app responsibility)The preposition "on" is more commonly used when referring to software running on a machine.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~59-~59: The preposition “on” seems more likely in this position.
Context: ... GUI clients are expected to be running under the same machine or implement their own...(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
63-64
: LGTM: Important information for container usage addedThis section provides crucial information for users working with containers, which aligns well with the PR objectives and helps clarify the new resource management approach.
Consider these minor grammatical improvements:
-In case of containers a shared volume should be mounted between ovos-gui, skills and gui client apps +In the case of containers, a shared volume should be mounted between ovos-gui, skills and gui client appsThese changes improve readability and adhere to common English grammar conventions.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~63-~63: You might be missing the article “the” here.
Context: ...s-gui` to be handled by client apps In case of containers a shared volume should be...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[typographical] ~63-~63: Consider adding a comma here.
Context: ...o be handled by client apps In case of containers a shared volume should be mounted betwe...(IN_CASE_OF_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- README.md (2 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~59-~59: The preposition “on” seems more likely in this position.
Context: ... GUI clients are expected to be running under the same machine or implement their own...(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~63-~63: You might be missing the article “the” here.
Context: ...s-gui` to be handled by client apps In case of containers a shared volume should be...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[typographical] ~63-~63: Consider adding a comma here.
Context: ...o be handled by client apps In case of containers a shared volume should be mounted betwe...(IN_CASE_OF_COMMA)
🪛 Markdownlint
README.md
49-49: null
Bare URL used(MD034, no-bare-urls)
50-50: null
Bare URL used(MD034, no-bare-urls)
51-51: null
Bare URL used(MD034, no-bare-urls)
52-52: null
Bare URL used(MD034, no-bare-urls)
🔇 Additional comments (2)
README.md (2)
29-29
: LGTM: Informative comment addedThe added comment provides valuable information about the current state of GUI clients. This aligns well with the PR's objective of improving clarity and addressing system limitations.
Line range hint
1-64
: Overall changes align well with PR objectivesThe modifications to the README.md file effectively support the PR's main objectives:
- The removal of file server configuration options aligns with the goal of eliminating the problematic GUI bus upload mechanism.
- The new sections on limitations and container usage provide clear guidance on the new approach to resource management.
- The added information about plugins and GUI client expectations improves overall documentation and clarity.
These changes contribute to addressing the issues of CPU spikes and OOM errors by providing a clearer understanding of the system's new architecture and limitations.
🧰 Tools
🪛 LanguageTool
[uncategorized] ~59-~59: The preposition “on” seems more likely in this position.
Context: ... GUI clients are expected to be running under the same machine or implement their own...(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~63-~63: You might be missing the article “the” here.
Context: ...s-gui` to be handled by client apps In case of containers a shared volume should be...(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[typographical] ~63-~63: Consider adding a comma here.
Context: ...o be handled by client apps In case of containers a shared volume should be mounted betwe...(IN_CASE_OF_COMMA)
🪛 Markdownlint
49-49: null
Bare URL used(MD034, no-bare-urls)
50-50: null
Bare URL used(MD034, no-bare-urls)
51-51: null
Bare URL used(MD034, no-bare-urls)
52-52: null
Bare URL used(MD034, no-bare-urls)
|
||
This means GUI clients are expected to be running under the same machine or implement their own access to the resource files (resolving page names to uris is the client app responsibility) | ||
|
||
> TODO: new repository with the removed GUI file server, serve files from `~/.cache/mycrot/ovos-gui` to be handled by client apps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NeonDaniel not sure if you had a specific use case in mind, but please see this note
* fix:allow workshop 3.0.0 * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53 * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix:allow workshop 3.0.0 * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix:allow workshop 3.0.0 * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix: gui resources path * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix:allow workshop 3.0.0 * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix: gui resources path * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
* fix:allow workshop 3.0.0 * fix: allow latest ovos-gui changes companion to OpenVoiceOS/ovos-bus-client#120 and OpenVoiceOS/ovos-gui#53
get rid of CPU spikes, OOM errors, it was a bad approach we tried!
companion to OpenVoiceOS/ovos-bus-client#120
Summary by CodeRabbit
Summary by CodeRabbit
Documentation
New Features
GUI_CACHE_PATH
for managing cached GUI resources.Improvements
get_uri
method by removing unnecessary parameters and focusing on new resource resolution strategies.Namespace
andGuiPage
to reflect recent changes in handling page identifiers.Bug Fixes
Chores
GuiPage
class.