-
Notifications
You must be signed in to change notification settings - Fork 2.3k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Support for bumpVersion when updating helm-values #8231
Comments
I refactored the return signature for |
🎉 This issue has been resolved in version 24.67.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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! |
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. |
I made workaround with this (bump patch version):
|
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. |
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? |
Needs a new PR with a fix for #8919 |
add workaround from renovatebot/renovate#8231 to bump version in Chart.yaml, when image tag gets updated
@justinas-b is it still working with latest versions? For some reason parentDir is not being resolved for me (thus command fails with module.exports = {
extends: ['config:base'],
allowPostUpgradeCommandTemplating: true,
allowedPostUpgradeCommands: ['^.*'],
regexManagers: [
{
fileMatch: ['(^|/)Chart\\.yaml$'],
matchStrings: [
'#\\s?renovate: image=(?<depName>.*?)\\s?appVersion:\\s?\\"?(?<currentValue>[\\w+\\.\\-]*)',
],
datasourceTemplate: 'docker',
},
],
packageRules: [
{
matchManagers: ['helm-requirements', 'helm-values', 'regex'],
postUpgradeTasks: {
commands: [
`version=$(grep '^version:' {{{parentDir}}}/Chart.yaml | awk '{print $2}')
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
patch=$(echo $version | cut -d. -f3)
minor=$(expr $minor + 1)
echo "Replacing $version with $major.$minor.$patch"
sed -i "s/^version:.*/version: $\{major\}.$\{minor\}.$\{patch\}/g" {{{parentDir}}}/Chart.yaml
cat {{{parentDir}}}/Chart.yaml
`,
],
},
fileFilters: ['**/Chart.yaml'],
executionMode: 'branch',
},
],
}; |
I am currently on |
Hmm, turns out I was not on the latest one ( |
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. |
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 📦🚀 |
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? |
@Crapworks please start a non-closed issue or discussion. I'm not sure if this was intended to update both or only values |
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. |
We 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"
is_major="$2"
is_minor="$3"
is_patch="$4"
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)
# Bump major version
if [[ "$is_major" = 'true' ]]; then
major=$(( major + 1 ))
minor=0
patch=0
fi
# Bump minor version
if [[ "$is_minor" = 'true' ]]; then
minor=$(( minor + 1 ))
patch=0
fi
# Bump patch version
if [[ "$is_patch" = 'true' ]]; then
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}}}' '{{{isMajor}}}' '{{{isMinor}}}' '{{{isPatch}}}'"
],
"fileFilters": ["**/Chart.yaml"],
"executionMode": "branch"
}
}
]
} |
Hi @morremeyer will this fucntionality be added to renovate or we'll have to via the script version? |
@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 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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? |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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.
The text was updated successfully, but these errors were encountered: