Skip to content
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

Output formatting #37

Closed
stevehipwell opened this issue Jan 22, 2021 · 12 comments
Closed

Output formatting #37

stevehipwell opened this issue Jan 22, 2021 · 12 comments
Labels
enhancement New feature or request p1 Priority #1

Comments

@stevehipwell
Copy link

The current output formatting for charts with multiple repos isn't particularly easy to grok due to the separator only being three characters --- and the blank line in the middle of the block appearing to be the separator. If the separator could be extended in length to at least the length of the header that would be great and it might be worth considering a line break after each block.

It would also make the multi repo output easier to scan and act on if there was a visual marker to show which chart is currently installed.

Finally I'm sure you're aware but the help command refers to outdated not whatup.

FYI I really appreciate that you've kept this plugin working as I feel an outdated command should be part of core Helm (it's a fundamental package manager feature).

@l0nax l0nax added enhancement New feature or request p1 Priority #1 labels Jan 27, 2021
@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

I've implemented the longer separator and fixed the typo.

And the highlighted installed version, in the table, will be implemented soon.

@stevehipwell
Copy link
Author

Thanks @l0nax that's great!

@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

I already tried to implement the functionality to show the user from which Chart repository the release has been installed.

But this is, out of the box, not possible.

The installed releases are returned as *release.Release and this struct does not have a field where it is possible to find out which Chart exactly has been installed.
The *chart.Chart struct does not provide any information about the repository.

I see only one way to implement this functionality:

  1. Create a hash of the release information (Chart, Manifest, and Hooks from *release.Release)
  2. Search for a repository with the same Chart version and App Version
  3. Generate the hash for all repositories serving this chart by using Config, and Labels from *release.Release
  4. Compare all generated hashes to find the repository

But this is really computing-intensive, i.e. execute helm template and measure the execution time. For the GitLab EE Chart it takes 6.791 seconds. This would take a lot of time if you have many charts installed that are served by many repositories, i.e., if you have the stable and bitnami Chart repository added to your repo list.

Those generated hashes can be cached, yes, but it would take a lot of time if the deployed Chart changes.

I will first work on the other issues you've opened, and then I will try to implement this feature – but it will not be enabled by default.

I'm open to other ideas to implement this functionality because it would improve usability.

@stevehipwell
Copy link
Author

I'd settle for a fuzzy match on version and appVersion where all possible charts are starred as a MVP; usually this would be good enough I think. Would this make the process easier?

@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

It could be that multiple charts do have the same Chart and App Version, which will then result in multiple Chart repositories marked as "installation source".

@stevehipwell
Copy link
Author

I think it would be a step in the right direction even if not a perfect solution.

@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

I've implemented it as described by you (#37 (comment)) and it looks like this:

Screenshot_20210127_190803

Currently, this feature is marked as beta and can be enabled by adding the --color flag to the command OR by exporting HELM_WHATUP_BETA_FEATURES=true which will cause that all beta features (currently only the coloring) will be enabled.

@stevehipwell
Copy link
Author

This looks great!!

@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

The changes have been merged onto develop.

@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

I will create a new release so you can test it.

@l0nax l0nax closed this as completed in 11d018f Jan 27, 2021
@l0nax
Copy link
Member

l0nax commented Jan 27, 2021

@stevehipwell Version v0.5.0 has been released. Can you please update the plugin and test if everything works fine for you?

@stevehipwell
Copy link
Author

Thanks @l0nax I'll give this a try in the morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p1 Priority #1
Projects
None yet
Development

No branches or pull requests

2 participants