Handle non-critical installation errors in GUI/TUI progress spokes#6983
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a robust mechanism for handling task exceptions and user interaction during the installation process. It enables the backend "boss" process to effectively communicate critical errors to both graphical and text-based user interfaces, allowing users to respond to prompts (e.g., continue or abort) and ensuring that the installation flow can react appropriately to these decisions. This change improves the overall stability and user experience by preventing unhandled exceptions from silently failing the installation and providing clear feedback to the user. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to propagate exceptions from background installation tasks in the 'boss' process to the UI for user interaction. It adds new D-Bus signals and methods for error reporting and response, and a proxy error handler (_RemoteErrorUI) to be used in the non-UI boss process. The changes correctly hook into the GUI and TUI progress screens to display error dialogs.
My review has identified a high-severity issue in the _RemoteErrorUI implementation that could lead to incorrect error handling behavior. I've also pointed out an opportunity to reduce code duplication between the GUI and TUI components for better maintainability. Overall, this is a good foundation for the intended feature, pending the suggested corrections.
|
This PR is stale because it has been open 60 days with no activity. |
6e104e9 to
eb0a0ce
Compare
eb0a0ce to
e2f906d
Compare
e2f906d to
94053b2
Compare
94053b2 to
e7061a1
Compare
|
/kickstart-tests --testtype smoke |
|
The PR is missing unit tests, which is also apparent from codecov check. |
|
I wonder if we should remove the 'Category' from some names and make them more generic (like |
|
Other than the 2 comments (the tests are required I think) looks good to me. |
M4rtinK
left a comment
There was a problem hiding this comment.
Looks good to me in general, but have some question/suggestions that I think should be addressed, but I don't mind that happening in a followup PR.
| log.warning("Cannot restore contexts because restorecon was not installed.") | ||
|
|
||
|
|
||
| class _RemoteErrorUI: |
There was a problem hiding this comment.
Any reason this is named starting with an _ ? IF so, the reason should be noted in a code comment or at least in the commit message.
There was a problem hiding this comment.
So that it's not visible as an API outside of the module. Added comment.
There was a problem hiding this comment.
IIRC we used to handle this by scoping what gets exported from the module instead with __all__: https://github.com/rhinstaller/anaconda/blob/main/pyanaconda/modules/users/installation.py
__all__ = [
"ConfigureRootPasswordSSHLoginTask",
"CreateGroupsTask",
"CreateUsersTask",
"SetRootPasswordTask",
"SetSshKeysTask",
]
Or do you mean something else ?
I checked & we currently have only 2 other classes that start their name with _ so I wondered if we might have a better way already in use:
$ git grep "class _"
pyanaconda/anaconda_logging.py:58:class _AnacondaLogFixer:
pyanaconda/payload/manager.py:49:class _PayloadManager(Runnable, ProgressReporter):
| # start the task queue | ||
| queue.start() | ||
| finally: | ||
| errorHandler.ui = previous_ui |
There was a problem hiding this comment.
This looks kinda ugly - do I guess correctly that the idea is that we do currently only use the new inter-process error dialog during the installation phase, so we temporarily replace it when the task queue is running ?
Still does not seem like a nice solution & should be at least better documented if we keep it for now.
IMHO better would be to either use the IPC error dialog always or use a new variable in errorHandler ("ui_process_interface" ?) so we don't have to do this dance.
There was a problem hiding this comment.
Put an extended comment inline.
|
Also I assume we have plans how to wire this in to the Web UI as well, right ? The Web UI will have the same use case where the backend needs to ask the user & block processing in the meantime. |
It's already wired - and tests are passing rhinstaller/anaconda-webui#1325 |
e7061a1 to
81cfee9
Compare
81cfee9 to
9d1231b
Compare
|
/kickstart-tests --testtype smoke |
|
Still looks good to me. |
Added test_error_raised_and_respond_to_error to test_install_category.py, following the existing CategoryChanged pattern. Let's see codecov now. |
After RunInstallationTask moved to the Boss D-Bus module, non-critical errors were no longer handled properly because errorHandler.ui is unset in Boss. Add ErrorRaised/RespondToError and a _RemoteErrorUI proxy so Boss forwards dialog calls to the UI during the installation queue. Co-authored-by: Cursor <cursoragent@cursor.com>
Add showError to _RemoteErrorUI and a detail_type parameter on ErrorRaised so the UI can show yes/no or fatal dialogs. Treat showDetailedError without custom buttons as fatal; with buttons as yes/no. Share _on_error_raised between GUI and TUI via a mixin. Co-authored-by: Cursor <cursoragent@cursor.com>
Cover non-critical and fatal installation errors forwarded from Boss to the UI, plus InstallationProgressErrorMixin dialog handling. Co-authored-by: Cursor <cursoragent@cursor.com>
9d1231b to
17749a9
Compare
|
/kickstart-tests --testtype smoke |
This draft suggested by Claude could serve as a base for a solution.