Repository navigation
fix(cmd): Fix all the outputs - #6550
Conversation
adamreese
left a comment
There was a problem hiding this comment.
Thanks for this. It has bugged me for some time.
| } | ||
|
|
||
| if strings.EqualFold(rel.Info.Description, "Dry run complete") { | ||
| if fullInfo { |
There was a problem hiding this comment.
What kinds of information should be in fullInfo verses regular info. If a value is added how would I make the decision?
There was a problem hiding this comment.
I personally know what it is, but I think the best way around this is a comment. I'm thinking something like
Anything printed in this block should be additional information about the release that is not necessarily needed for normal output (like the full manifest or all of the computed values). Basic information such as the name, revision, and release date should always be printed
| func PrintRelease(out io.Writer, rel *release.Release) { | ||
| // PrintRelease prints info about a release. If fullInfo is true, it will print | ||
| // the user supplied values and the computed values used to render the chart | ||
| func PrintRelease(out io.Writer, rel *release.Release, fullInfo bool) error { |
There was a problem hiding this comment.
Breaking out the fullInfo logic into its own function would allow you to refactor out the boolean flag
There was a problem hiding this comment.
The reason it is in here is for ordering purposes. I tried to think of a way that would preserve the current output formatting order with a separate function, but if we want to maintain the input the same, it needs to be in the middle. Basically, I could have this function take a function parameter that can insert things (like func PrintRelease(out io.Writer, rel *release.Release, extras ExtraFunc...)). But as this is specifically for printing a whole release, I feel like it makes sense here. Any ideas how I could make it cleaner?
There was a problem hiding this comment.
We can also break the current output ordering, which would probably be fine given how this is already breaking other things. That would also solve this issue
| } | ||
| fmt.Fprintf(out, "NAMESPACE: %s\n", rel.Namespace) | ||
| fmt.Fprintf(out, "STATUS: %s\n", rel.Info.Status.String()) | ||
| fmt.Fprintf(out, "REVISION: %d\n", rel.Version) |
|
|
||
| type statusPrinter struct { | ||
| release *release.Release | ||
| debug bool |
There was a problem hiding this comment.
Yep, it is passed into the print command for fullInfo
70b9e0c to
61bc202
Compare
There were two different methods and varying ways to output the status of a release. This standardizes all of the outputs, but requires a breaking change. Output will not perfectly match previous v3 output, and we had to break the printing function in the `action` package, but now things are much more standardized. Fixes helm#6238 Signed-off-by: Taylor Thomas <[email protected]>
61bc202 to
3799d00
Compare
|
@adamreese and I talked and decided to do a bit heavier of a refactor here. I'll get to that at the beginning of next week |
Signed-off-by: Taylor Thomas <[email protected]>
00bb90a to
768d27b
Compare
|
Ok, I finished an additional refactor. Several breaking changes of note:
I also added a cobra/pflag implementation for the output format in PLEASE NOTE: The large amounts of files changed in this were just updating the "golden" test files to match the new output |
bacongobbler
left a comment
There was a problem hiding this comment.
LGTM! I like the change to the time output formatting as well. Much more human-readable.
Signed-off-by: Taylor Thomas <[email protected]>
d7de594 to
3d64c6b
Compare
adamreese
left a comment
There was a problem hiding this comment.
🎵 Time is on my side, yes it is 🎵
There were two different methods and varying ways to output the status of a release.
This standardizes all of the outputs, but requires a breaking change. Output will
not perfectly match previous v3 output, and we had to break the printing function
in the
actionpackage, but now things are much more standardized.Fixes #6238