-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
helm: add arkade chart bump
to bump chart versions
#1024
Conversation
Thanks for the PR and the detailed test output. I'm thinking a bit more about workflow. What if only one of the charts has changes pending from the upgrade command? I.e. the Makefile in openfaas/faas-netes has a make upgrade-charts target, and possibly only one or two charts will need a bump due to changes in image versions. Maybe simulate that? https://github.com/openfaas/faas-netes Back off a version of "image" in two charts, then run the make upgrade-charts followed by thinking about how we could only bump the adjacent images? And what if someone ran make upgrade charts twice, we wouldn't want to bump the version twice etc. Other charts have a single values.yaml like - https://github.com/inlets/inlets-operator/blob/master/chart/inlets-operator/values.yaml#L44 Alex |
To simplify things, we could assume the workflow of: make upgrade-charts make bump-charts The first uses the existing command, the second uses the new one. The maintainer won't run the second command twice in a row, otherwise they'll get a double bump. The first command is still re-runnable. We could skip --recursive in this PR, and if we want to add it later, make sure it's in both commands so they are consistent. |
Is the intention with the new workflow to only bump charts when the image in the chart gets updated? Or do we want to bump the chart version regardless of what action |
Sorry that I was unclear. Can you walk through the example I shared?
Suggest one or more ways that you can determine if a values.yaml has changed, and then only bump its adjacent Chart.yaml if that's the case.
So the same would be repeated i.e.
|
If we only want to bump the version in Chart.yaml if we have changes in the adjacent values.yaml, I guess we can modify |
One more approach we can take is to combine the upgrade and bump process under one command and make it interactive. For example, after all the images are upgraded, we could prompt the user and ask whether they want to bump the chart as well. This way you can run the new command several times to try and upgrade images without bumping the version twice. The drawback here is that its not CI friendly and you need to know analyze which images got updated. |
Hi @aryan9600 I like your suggestion to use git. Could we go go-execute to execute "git status" and then just scan if there's a values.yaml affected from the output? Go bindings to git may require CGO, which I'd like to avoid. Let me know if you think that's feasible? For instance:
Alex |
We could also use go-git if we wanted to do things in a more programatic manner. But then again, if you don't want to introduce several packages for one feature, we could go the go-execute route. |
Do you want to go ahead and try go-execute please? |
The functionality looks good now, I'd like the user experience to be consistent and to default to doing the obvious thing:
So, here's how the bump may work:
Please always bump the patch version by default, if maintainers want to bump major or release version, they can do that manually. One other thought to bear in mind is that if any file in the folder of values.yaml has changed, then a bump is needed. I.e. you added an environment variable to a template YAML file. |
@aryan9600 hey are you still working on this? |
Add a new command `arkade chart bump --dir ./chart` to bump the minor of a Helm chart version. To bump multiple charts at once, specify the parent directory with the `--recursive` flag. By default, the changes are written to stdout. Specifying the `--write` flag writes the changes to the respective file. Signed-off-by: Sanskar Jaiswal <[email protected]> njndjnd
Add flag `--check-for-value-updates` to `arkade chart bump` which skips bumping the chart version if the values file does not have any changes according to the Git. Signed-off-by: Sanskar Jaiswal <[email protected]>
Signed-off-by: Sanskar Jaiswal <[email protected]>
Description
Add a new command
arkade chart bump --dir ./chart
to bump the minor of a Helm chart version. By default, the changes are written to stdout. Specifying the--write
flag writes the changes to the respective file.Specifying the flag
--check-for-value-updates
skips bumping the chart version if the adjacent values file does not have any changes according to the Git.Motivation and Context
design/approved
by a maintainer (required)Closes Workflow improvement - increment Chart.yaml version when updating values.yaml #1023
How Has This Been Tested?
Built the CLI manually and tested various scenarios:
Types of changes
Documentation
./arkade get --format markdown
./arkade install --help
Checklist:
git commit -s