-
Notifications
You must be signed in to change notification settings - Fork 118
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
Apply as many changes as possible with error summary at end #532
Conversation
if err != nil { | ||
return err | ||
} |
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.
Should the timeout errors also include the unsuccessfulChanges?
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.
I think they should!
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.
I am still thinking if we should do this and what would be the best way to present the errors.
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.
Some thoughts:
- Should there be a flag which enables disables this behaviour? What should be it's default value?
- How does this look with multiple failures? I think we might need better formatting than
[error1, error2, error3]
maybe more like:
- error1
- error2
- error3
Hmm, maybe, but I am not sure why someone would want to turn it off.
It's just like you have mentioned 😁 please do take a look at the gist that I have shared, it contains an example manifest and the output that we would get while deploying it. |
One case I can think of is pipelines. They would probably want to error out the moment something goes south rather than wait for other resources to be created.
Oooh noice! Missed that. I noticed there was a ']' added to a test and misunderstood 🤔 |
I don't know how that would be useful, but maybe it would be useful in some scenarios that I am not able to think at the moment, so I am keeping this discussion open for now, we can discuss more later.
Yeah, I am still trying to figure out how to best use |
3f6c521
to
7cfe3b9
Compare
|
Yeah, that's something @100mik had suggested as well. I had kept this discussion open till now, I will add a flag to disable the behaviour.
Right now, we error out for
I was thinking that individual resource timeouts can be treated as resource errors in this case, as one resource getting timed out doesn’t mean that others (which don't depend on it) will also get timed out. |
05a67c8
to
ee45a27
Compare
47192dc
to
c5b2777
Compare
waitingChanges.Track(appliedChanges) | ||
|
||
if waitingChanges.IsEmpty() { | ||
if len(unsuccessfulChanges) == 1 { |
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.
NewSemiStructuredError
doesn't work really well when there is only one error inside []
because there might be errors containing something like map[string]string
and there is no good way to differentiate between an error and such field.
I should probably add this as a comment.
The changes themselves LGTM 🤔 Re: Error structuring
|
Suggestion: I think it would be good if you can add little more description like: how the new output will look like? You can add some example output. |
That's correct.
That doesn't happen in NewSemistructuredError. |
I think the test cases and the gist that I have provided should be a good indication of the output, but do let me know if I should add more examples. |
So I am guessing multiple errors will be unformatted 🤔 That said I do not think it is a major blocker but more of a nice to have thing imo 🚀 |
c5b2777
to
aeadf6f
Compare
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.
LGTM. Just thinking about the output. For the example given in the gist wouldn't it be better to show 2 Resource Succeded
before showing errors or final summary at the end on number of resources succeeded and failed.
Hmm, definitely a good thought. The reason I didn't include more details around successful changes at the end is because we already include enough information in the logs ( |
I think I am satisfied with how the UI changes look as well, I cannot think of how we can make a list of errors look better right away. But these cosmetic improvements can always go as a separate PR if we have better ideas. |
Also, @praveenrewar looks like this branch needs a rebase. I will take one final look at this once it is done! |
aeadf6f
to
b2deed6
Compare
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.
A few nitty thoughts!
Over all the implementation looks good 🚀
a4389a9
to
937b6fa
Compare
937b6fa
to
082da4c
Compare
- Changes that depend on failing changes shouldn't be applied - exit-on-apply-error flag can be used to exit as soon as an error is encountered while applying changes - exit-on-wait-error flag can be used to exit as soon as an error is encountered while waiting for changes (default true)
082da4c
to
98398e3
Compare
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.
LGTM!
What this PR does / why we need it:
Currently kapp errors out as soon as it detects an error while apply a resource or waiting for a resource, but we would want to apply as many changes as possible and return all the errors at end. If a change doesn't depend on a failed change then it should get applied.
exit-early-on-apply-error
flag can be used to exit as soon as an error is encountered while applying changes (default true)exit-early-on-wait-error
flag can be used to exit as soon as an error is encountered while waiting for changes (default true)Sample gist for testing: https://gist.github.com/praveenrewar/2746318c5a273d13ed26497f34755638
TODO:
Which issue(s) this PR fixes:
Fixes #426
Does this PR introduce a user-facing change?
Additional Notes for your reviewer:
Review Checklist:
a link to that PR
change
Additional documentation e.g., Proposal, usage docs, etc.: