Format installation errors for GitHub Actions in headless mode #3239
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
If metadata pull request validation (see KSP-CKAN/xKAN-meta_testing#61) fails at the installation stage, errors are printed but aren't recognized as errors by the GitHub workflow framework, so they're not highlighted or pinned to the affected file:
Cause
Error messages are just passed to
IUser.RaiseMessage
, despite reporting error conditions, which in turn just outputs viaSystem.Console.WriteLine
. GitHub actions require special formatting to recognize error messages.Changes
RaiseError
, the one that's most likely to be helpful if pinned to a fileHeadless
mode,RaiseError
prints vialog.ErrorFormat
, and also replaces all line break sequences with%0A
so multi-line messages can be handled properlyDependencyNotSatisfiedKraken.Message
since it's nicer than the message we had previouslyAs far as I could tell we do not have a warning-level message in this code currently, which is good because
IUser
doesn't have a designated way to handle them.