-
Notifications
You must be signed in to change notification settings - Fork 1.7k
First draft for adding actionable error items Framework #4045
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
First draft for adding actionable error items Framework #4045
Conversation
Codecov Report
|
9f97b3b to
b3f6e86
Compare
b3f6e86 to
33459b0
Compare
|
Mining our own output seems brittle and would complicate possible moves to a skaffold-core library with separate UI skins (e.g., a Cloud Run specific front-end that hides any knowledge of Kubernetes). And we should be thinking of the iDEs as a separate skin (IMHO). I'm concerned as the recommendations here aren't going to be suitable for IDE usage. The example Maybe these need to be codes like In my ideal world, all of the printfs in |
I agree that ideally our error structure should be type-safe way, like in Java. That could make identifying errors and their context more robust, instead of matching on strings. However, this is not just our output - it is also underlying tools' output, where we do have to do some kind of string matching typically.
I like this point, but skaffold has to cater for CLI only usage too where this would make sense. Would we make these suggestions conditional on a flag and then IDEs can say "we'll take care of suggestions in our own UI" based on events?
I agree that we could think about this more as an MVC pattern, where skaffold's Model would be shared with itself and the IDEs, and they can put separate Views on it. At the extreme we would reuse the Event API for sending all events, and skaffold could log them, IDEs can decide what they want to do with them - we would have for every possible interesting event a proto message. However, this sounds like a lot of redesign first and then have the implementation. I think starting with this lightweight approach objectively will improve the experience for Skaffold users. |
nkubala
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.
@briandealwis brings up some great points that I think we need to consider in the future. I'm hesitant to merge this now, but let's go ahead and do it so we can have a starting point to iterate on.
In this PR,
regexMatchto describe root cause and actionable error message.config.SkaffoldOptionspassed on the CLI to suggest better actionable message.opts.Skaffoldwe could derive, theCurrentConfigandRunContextif required.Builder.NoArgs. ( Notes,ExactArgsis used forskaffold config set/unsetandskaffold schema gethence not hooking it up there)User facing changes (remove if N/A)
yes. The "logrus.Fatatf(err)
is now changed tocolor.Red.Fprintln`As we add error messages, the sample output will be change as follows:
Old :
New:
Some things considered as follow up actions
errMaplives in code. Shd we make it pluggable so its not dependent on release.