Skip to content

Handle non-critical installation errors in GUI/TUI progress spokes#6983

Merged
KKoukiou merged 3 commits into
rhinstaller:mainfrom
rvykydal:fix-passing-task-exceptions-from-boss-to-ui
Jun 15, 2026
Merged

Handle non-critical installation errors in GUI/TUI progress spokes#6983
KKoukiou merged 3 commits into
rhinstaller:mainfrom
rvykydal:fix-passing-task-exceptions-from-boss-to-ui

Conversation

@rvykydal

Copy link
Copy Markdown
Contributor

This draft suggested by Claude could serve as a base for a solution.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • D-Bus Error Signaling: Introduced a new D-Bus signal, ErrorRaised, within the CategoryReportTaskInterface to enable the backend 'boss' process to notify the UI about errors requiring user interaction.
  • Remote Error UI Proxy: Implemented a _RemoteErrorUI class in the boss process that acts as a proxy for the errorHandler.ui, translating standard UI dialog calls into D-Bus signals for remote handling.
  • UI Error Handling Integration: Updated both the GUI and TUI installation_progress spokes to listen for the ErrorRaised D-Bus signal, display appropriate error dialogs to the user, and send the user's response back to the boss process via a new AnswerError D-Bus method.
  • Blocking Mechanism for User Response: Utilized threading.Event to implement a blocking mechanism, allowing the boss process to pause execution after emitting an error signal until the UI provides a response, ensuring synchronous user interaction.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist 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.

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.

Comment thread pyanaconda/modules/boss/installation.py Outdated
Comment thread pyanaconda/ui/tui/spokes/installation_progress.py Outdated
@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 60 days with no activity.
Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions Bot added the stale label May 18, 2026
@rvykydal rvykydal closed this May 27, 2026
@KKoukiou KKoukiou reopened this Jun 2, 2026
@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from 6e104e9 to eb0a0ce Compare June 2, 2026 11:45
@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 2, 2026 11:45 — with GitHub Actions Inactive
@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from eb0a0ce to e2f906d Compare June 2, 2026 11:57
@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 2, 2026 11:57 — with GitHub Actions Inactive
@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from e2f906d to 94053b2 Compare June 2, 2026 13:10
@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 2, 2026 13:10 — with GitHub Actions Inactive
@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from 94053b2 to e7061a1 Compare June 2, 2026 13:21
@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 2, 2026 13:21 — with GitHub Actions Inactive
@KKoukiou

KKoukiou commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

/kickstart-tests --testtype smoke

@KKoukiou KKoukiou changed the title WIP/draft Fix passing task exceptions from boss to UI Handle non-critical installation errors in GUI/TUI progress spokes Jun 2, 2026
@github-actions github-actions Bot removed the stale label Jun 3, 2026
@KKoukiou KKoukiou marked this pull request as ready for review June 3, 2026 10:39
@KKoukiou KKoukiou requested review from M4rtinK and bruno-fs June 3, 2026 11:43
@rvykydal

Copy link
Copy Markdown
Contributor Author

The PR is missing unit tests, which is also apparent from codecov check.

@rvykydal

Copy link
Copy Markdown
Contributor Author

I wonder if we should remove the 'Category' from some names and make them more generic (like CategoryReportTaskInterface -> ReportTaskInterface) with the change.

@rvykydal

Copy link
Copy Markdown
Contributor Author

Other than the 2 comments (the tests are required I think) looks good to me.

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

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:

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.

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.

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.

So that it's not visible as an API outside of the module. Added 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.

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

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.

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.

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.

Put an extended comment inline.

Comment thread pyanaconda/ui/lib/installation_progress_error.py Outdated
Comment thread pyanaconda/modules/boss/installation.py Outdated
@M4rtinK

M4rtinK commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

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.

@KKoukiou

Copy link
Copy Markdown
Contributor

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

@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from e7061a1 to 81cfee9 Compare June 11, 2026 12:57
@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 11, 2026 12:57 — with GitHub Actions Inactive
@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from 81cfee9 to 9d1231b Compare June 11, 2026 13:15
@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 11, 2026 13:16 — with GitHub Actions Inactive
@KKoukiou

Copy link
Copy Markdown
Contributor

/kickstart-tests --testtype smoke

@rvykydal

Copy link
Copy Markdown
Contributor Author

Still looks good to me.
Regarding the codecov check, not 100% sure if the report is relevant but IIRC we are testing the interfaces somehow (might be wrong). I think someone looking at existing tests could get the answer.

@KKoukiou

Copy link
Copy Markdown
Contributor

Still looks good to me. Regarding the codecov check, not 100% sure if the report is relevant but IIRC we are testing the interfaces somehow (might be wrong). I think someone looking at existing tests could get the answer.

Added test_error_raised_and_respond_to_error to test_install_category.py, following the existing CategoryChanged pattern. Let's see codecov now.

KKoukiou and others added 3 commits June 12, 2026 15:11
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>
@KKoukiou KKoukiou force-pushed the fix-passing-task-exceptions-from-boss-to-ui branch from 9d1231b to 17749a9 Compare June 12, 2026 13:11
@KKoukiou

Copy link
Copy Markdown
Contributor

/kickstart-tests --testtype smoke

@KKoukiou KKoukiou temporarily deployed to gh-cockpituous June 12, 2026 13:11 — with GitHub Actions Inactive
@KKoukiou KKoukiou merged commit 1eda88b into rhinstaller:main Jun 15, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants