-
Notifications
You must be signed in to change notification settings - Fork 20
preinstall: Return warnings as errors if RunChecks is already going to return an error #404
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
base: master
Are you sure you want to change the base?
preinstall: Return warnings as errors if RunChecks is already going to return an error #404
Conversation
2972449 to
60c84b7
Compare
8e59a9a to
947fbbd
Compare
…o return an error If RunChecks returns one or more errors, any warnings that have been collected and which would normally be returned via the CheckResults structure will be discarded. In the case where RunChecks is already going to return one or more errors, it should also return any warnings that occurred as errors as well.
947fbbd to
56f8c83
Compare
pedronis
left a comment
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.
@chrisccoulson I'm not entirely sure I understand this change, some warnings are because the user has permitted something but if they are turned again into errors it would seem like the user/caller didn't permit things they did
Yes, that's a good point - it does introduce a little bit of confusion. I've been trying to keep warnings distinct from errors and to not blur the lines between them so much that snapd feels like it needs to do anything with warnings. This is why the returned warnings do not get converted to The problem is that when we return one or more errors, we don't return a I don't mind dropping it if it causes too much confusion, but if we genuinely aren't able to create a valid PCR profile configuration, I'd like to be able to expose the warnings in some way. |
I think it does causes confusion and I would drop this change unless there would be a way to get from the error that they are actually only warnings and snapd could filter them out? but then again if we allow that then it's unclear whether it's bad to drop them as we do now |
|
Surfacing warnings as errors seems useful if we provide the user [UI] with the opportunity to make configuration changes that will remove warnings, at install time using recovery actions. If we do, then it makes sense to treat it similar to errors. One option will be to have non-fatal error-kinds at a level that the installer can distinguish. In this case rather remove warnings from CheckResult altogether, for consistent experience. |
|
I'll skip this one for now - I've rebased the next PR (#405) on master |
If
RunChecksreturns one or more errors, any warnings that have beencollected and which would normally be returned via the
CheckResultsstructure will be discarded. In the case where
RunChecksis alreadygoing to return one or more errors, it should also return any warnings
that occurred as errors as well.