Support for bumpVersion when updating helm-values #28861
Replies: 37 comments 29 replies
-
I refactored the return signature for |
Beta Was this translation helpful? Give feedback.
-
@rarkins Perfect, thank you for your help! I've implemented something in #8240. |
Beta Was this translation helpful? Give feedback.
-
🎉 This issue has been resolved in version 24.67.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Beta Was this translation helpful? Give feedback.
-
We need a new pr for this, as the previous caused a bug and had been reverted, see #8926 and #8919 |
Beta Was this translation helpful? Give feedback.
-
Any idea when this will be done? This would be a really useful feature for anyone hosting their own helm chart repository (like myself). Thanks! |
Beta Was this translation helpful? Give feedback.
-
I hope to get to it eventually, since I do need it myself as well ;). But of course I'd gladly yield the implementation to anyone interested - while there is clearly a bug left to squash, https://github.com/renovatebot/renovate/pull/8240/files may at least be a starting point. |
Beta Was this translation helpful? Give feedback.
-
I made workaround with this (bump patch version):
|
Beta Was this translation helpful? Give feedback.
-
Hello, it would be awesome if we get this working, we use flux together with renovate bot and this is the only missing piece for us. |
Beta Was this translation helpful? Give feedback.
-
I'm struggling to understand the status of this feature.... if i follow the tickets my understanding is it was committed, merged and released, but there was a bug so it was rolled back? What needs done to implement this - perhaps i can contribute? |
Beta Was this translation helpful? Give feedback.
-
Needs a new PR with a fix for #8919 |
Beta Was this translation helpful? Give feedback.
-
If anyone is interested here is my example pull request created by renovate bukowa/charts#49 There are also some nice things in https://github.com/renovatebot/helm-charts |
Beta Was this translation helpful? Give feedback.
-
Thanks @andywow ! I found it really useful ;) refactored it a bit
|
Beta Was this translation helpful? Give feedback.
-
@justinas-b does your snippet really work? |
Beta Was this translation helpful? Give feedback.
-
Yep, works like a charm, the exact configuration I referenced. I am using following:
|
Beta Was this translation helpful? Give feedback.
-
@justinas-b thank you for a quick reply!
And |
Beta Was this translation helpful? Give feedback.
-
Hmm, turns out I was not on the latest one ( |
Beta Was this translation helpful? Give feedback.
-
I'm going to try to revive the reverted PR, but no promises. JS isn't something I usually work with, so will take me some time. |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
🎉 This issue has been resolved in version 37.138.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Beta Was this translation helpful? Give feedback.
-
Hey! So I pulled the new release in and set "bumpVersion": "minor" in my renvate.json, hoping that it would just work and bump the version in Chart.yaml whenever it updates the values.yaml. But the behavior is the same as before, it only updates the values.yaml. From the discussion here and the PR it is not clear to me how this is supposed to work. Do I need to setup / configure something else to make this work? |
Beta Was this translation helpful? Give feedback.
-
@Crapworks please start a non-closed issue or discussion. I'm not sure if this was intended to update both or only values |
Beta Was this translation helpful? Give feedback.
-
Quick note for everyone wondering why this is not working since #26441 has been merged: #26441 was reverted with #26758 since it did not work as intended. Edit: Found the revert PR and updated comment with it. |
Beta Was this translation helpful? Give feedback.
-
I have some hope for #27602 - maybe we could use regex magic to trigger version bump. this also would include versionBump, if there is a change inside the Chart.yaml (e.g. appVersion has been changed) Note sure, but a vote can help on the discussion. |
Beta Was this translation helpful? Give feedback.
-
Updates2024-05-07: Updated the script to work with all types of updates. DescriptionWe have taken the workaround shown by @justinas-b and built on top of it. Main changes are:
ℹ️ This only bumps for major, minor and patch upgrades. digests, pins, rollbacks, replacements and pinDigest updates are deliberately ignored since in our use case, these need a manual decision about the version bump for the chart Setup
ScriptScript#!/usr/bin/env bash
set -euo pipefail
parent_dir="$1"
update_type="$2"
version=$(grep "^version:" "charts/${parent_dir}/Chart.yaml" | awk '{print $2}')
if [[ ! $version ]]; then
echo "No valid version was found"
exit 1
fi
major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)
patch=$(echo "$version" | cut -d. -f3)
if [[ "$update_type" =~ (major|replacement) ]]; then
major=$(( major + 1 ))
minor=0
patch=0
elif [[ "$update_type" =~ 'minor' ]]; then
minor=$(( minor + 1 ))
patch=0
else
patch=$(( patch + 1 ))
fi
echo "Bumping version for $parent_dir from $version to $major.$minor.$patch"
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "charts/${parent_dir}/Chart.yaml" renovate config{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"description": "Bump helm chart versions by a patch when updating values files. Digests, pins, rollbacks, replacements and pinDigest updates are deliberately ignored since in our use case, these need a manual decision about the version bump for the chart. This can be removed when https://github.com/renovatebot/renovate/issues/8231 is implemented and enabled.",
"matchManagers": ["helm-values"],
"postUpgradeTasks": {
"commands": [
"bash scripts/bump-chart-version.sh '{{{parentDir}}}' '{{{updateType}}}'"
],
"fileFilters": ["**/Chart.yaml"]
}
}
]
} |
Beta Was this translation helpful? Give feedback.
-
Hi @morremeyer will this fucntionality be added to renovate or we'll have to via the script version? |
Beta Was this translation helpful? Give feedback.
-
@Rajesh-Gurjar There is still the goal of supporting this directly in renovate, but it has to be implemented. For now, using the script in my comment works, but only on self-hosted instances |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
If I have multiple charts in single repository under charts folder, this script is working only on first chart and remaining charts were not updated with new version value in Chart.yaml file.. Do you know how to make it work for other charts as well? |
Beta Was this translation helpful? Give feedback.
-
I've converted this from Issue to Discussion as it's gotten a bit messy and off-topic for an issue. We will create a clean feature request issue in its place soon. |
Beta Was this translation helpful? Give feedback.
-
What would you like Renovate to be able to do?
When the container image tags in Helm value files are updated using the
helm-values
manager, it should also support bumping the chart version.Did you already have any implementation ideas?
I've been attempting this in https://github.com/chgl/renovate/tree/add-bumpversion-support-to-helm-values (Let me know if you'd like a WIP PR). But the main challenge I face is that the
helm-values
manager works onvalues.yaml
files, but thepackageFile
containing the version that should be bumped isChart.yaml
. I can work around this by opening and reading theChart.yaml
file and get as far as updating the file contents with a bumped version (https://github.com/chgl/renovate/blob/add-bumpversion-support-to-helm-values/lib/manager/helm-values/update.spec.ts#L38), but now I am not sure how to correctly write back the updated contents without majorly updatinggetUpdatedPackageFiles
(it currently incorrectly overwritesvalues.yaml
with the updated contents ofChart.yaml
).I'm definitely interested in working on this.
Beta Was this translation helpful? Give feedback.
All reactions