Closed shimon-armis closed 3 months ago
@hhahn-tw Can you please review this one? :)
@hhahn-tw @petedannemann Can you guys maybe take a look?
@jkoelker Can you maybe review this PR?
LGTM, just a reccomendation to use
errors.Join
to concat the errors, if not, you can also usefmt.Errorf
with multiple%w
to achieve the same thing and not drop the error context by rendering it as a string.
errors.Join() is only supported from go 1.20 (this repo is running v1.18).
Also, fmt.Errorf() doesn't support multiple %w
(as explained here. Here's the error I got in the PR check:
Error: cmd/topicctl/subcmd/apply.go:182:12: fmt.Errorf call has more than one error-wrapping directive %w
make: *** [Makefile:20: vet] Error 1
@hhahn-tw Can you please merge this one?
@hhahn-tw ?
Thanks once more for your contribution!
Description
Up until now, the
apply
command implemented a fail-fast strategy. This means that an attempt to configure a batch of topics (by passing a path to a folder contains a list of topics configurations files) will be terminated upon the first failure (w/o even trying to apply the configuration for the next-in-line topics). This commit introduces the fail-safe support: It allows the user to run theapply
command in a fail-safe manner, which means that instead of failing upon the first failure, we'll simply continue to the next topic configuration, while aggregating all the errors along the way. Eventually, if there were any errors, all of them will be shown.