Skip to content
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

Small reorganization in Y2Issues #1178

Merged
merged 3 commits into from
Jun 25, 2021
Merged

Small reorganization in Y2Issues #1178

merged 3 commits into from
Jun 25, 2021

Conversation

ancorgs
Copy link
Contributor

@ancorgs ancorgs commented Jun 23, 2021

Related pull requests

Problem

During the partial re-implementation of yast2-users, we found a couple of things to be improved in Y2Issues.

  1. The Y2Issues severity levels were :warn and :fatal. But other parts of YaST use slightly different conventions for similar concepts[1]:
  • In the module Report there are functions line, Message, Warning and Error.
  • In the <report> section of the AutoYaST profile, it's possible to define the behavior for the following categories: errors, warnings, messages, yesno_messages.
  1. The current implementation of Y2Issues.report was too focused in a single use case - showing errors found while processing the AutoYaST profile and offering the user the opportunity to abort installation.

Solution

  • Renamed :fatal to :error.
  • Extended Y2Issue.report with two new arguments that allow to specify what to do depending on the severity of the issues.

Testing

  • Adapted unit tests
  • Manually tested with y2users with different usages of the reporter. See screenshots.

reporter-ask

reporter-continue

Notes

[1] The installation proposals follow a different convention, but I don't think it's expected to use Y2Issues in that context. Just for completeness, let's list here the warning levels accepted for a proposal:

  • :notice
  • :warning (default)
  • :error
  • :blocker
  • :fatal

A :blocker will prevent the user from continuing the installation. If any proposal contains a blocker warning, the Accept button in the proposal dialog will be disabled - the user needs to fix that blocker before continuing.

:fatal is like :blocker but also stops building the proposal.

An :error does not prevent continuing of the installation, but shows a popup that an user has to confirm to continue with the installation.

@coveralls
Copy link

coveralls commented Jun 23, 2021

Coverage Status

Coverage increased (+0.05%) to 40.985% when pulling afd12fc on ancorgs:issues_error2 into 3197fb8 on yast:master.

@@ -37,45 +38,101 @@ class Reporter
def initialize(issues, report_settings: Yast::Report.Export)
textdomain "base"
@presenter = Presenter.new(issues)
@level = issues.fatal? ? :error : :warn
@level = issues.error? ? :error : :warn
@log, @show, @timeout = find_settings(report_settings, @level)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@imobachgs I was thinking about this. We are deciding which AutoYaST settings to use (<warnings> vs <errors>) based on the severity. But I was wondering whether it would make sense to use <yesno_messages> in the cases in which we ask the user whether to continue or not (when ask is used for the corresponding severity).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And talking about honoring the AutoYaST settings, what's the rationale to ignore the timeout and enforce it to zero in for the "error" level?

@yast-bot
Copy link
Contributor

✔️ Public Jenkins job #315 successfully finished
✔️ Created OBS submit request #902299

@yast-bot
Copy link
Contributor

✔️ Internal Jenkins job #153 successfully finished
✔️ Created IBS submit request #243830

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants