-
Notifications
You must be signed in to change notification settings - Fork 60
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
Governance: Automatically update the appVersion in Chart when released #547
Comments
I can take this if there is no urgency to complete this. I can work on it next week. |
@rajeshkio Yeah, this issue is not very urgent, you can start when you are convenient. |
I am confused. I do not see anything related to the helm chart in the current workflow; the helm chart has a different repo. So does the task include updating the Chart.yml in the helm chart repo? |
@rajeshkio Ohh, I didn't make it clear. Chart repo is here. The current workflow is as described in the issue, after each release, I manually update the My idea is that after each release, this PR can be automatically generated through a github action (yaml-update-action is good), and maintainers only need to click Example ( in release.yaml ): - name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Bump version in the related HelmChart Chart.yaml
uses: fjogeleit/yaml-update-action@main
with:
repository: KusionStack/charts
valueFile: 'charts/karpor/Chart.yaml'
propertyPath: '{"version":"${{ steps.get_version.outputs.VERSION }}", "appVersion":"${{ steps.get_version.outputs.VERSION }}"}'
value: ${{ steps.get_version.outputs.VERSION }}
branch: bump-karpor-to-${{ steps.get_version.outputs.VERSION }}
targetBranch: main
createPR: true
message: 'refactor: bump karpor version to ${{ steps.get_version.outputs.VERSION }}'
token: ${{ secrets.GITHUB_TOKEN }}
workDir: . |
Interesting. This would mean directly updating the version in the helm chart whenever there is a new image without considering if there are any changes in the helm chart repo. Also updating the appVersion in helm chart means we need to update the helm chart version as well, no? |
@rajeshkio Yeah, as long as release has a new image, we can automatically generate a PR that only includes version bump. And just like you said, |
@rajeshkio I think of a way, it can obtain and automatically bump chart version: - name: Get karpor version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Get new chart version
id: get-chart-version
run: |
helm repo add kusionstack https://kusionstack.github.io/charts
helm repo update
version=$(helm search repo kusionstack/karpor --versions | head -n 2 | tail -n 1 | awk '{print $2}')
echo "Current chart version is: $version"
major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)
patch=$(echo "$version" | cut -d. -f3)
new_chart_version="${major}.${minor}.$((patch + 1))"
echo "New chart version is: $new_chart_version"
echo "::set-output name=new_chart_version::$new_chart_version"
- name: Bump version in the related HelmChart Chart.yaml
uses: fjogeleit/yaml-update-action@main
with:
repository: KusionStack/charts
valueFile: 'charts/karpor/Chart.yaml'
propertyPath: '{"version":"${{ steps.get-chart-version.outputs.new_chart_version }}", "appVersion":"${{ steps.get_version.outputs.VERSION }}"}'
value: ${{ steps.get_version.outputs.VERSION }}
branch: bump-karpor-to-${{ steps.get_version.outputs.VERSION }}
targetBranch: main
createPR: true
message: 'refactor: bump karpor version to ${{ steps.get_version.outputs.VERSION }}'
token: ${{ secrets.GITHUB_TOKEN }}
workDir: . |
Bro, you have already done all the hard work. Now I just need to copy and update the release YAML |
@rajeshkio Yeah, but I did not do any tests in the above yaml... and its verification and debug is also important! |
Sure. I will try to complete it by the end of the week. |
@elliotxx What is remaining in this issue? |
@rajeshkio Sorry, brother. Some things at home some time ago have caused my energy to be a little scattered. This issue has some verification work that is not completed. If it is smooth, this week will be merged into. |
…new version (#607) ## What type of PR is this? /kind chore ## What this PR does / why we need it: When the Release workflow is triggered, a PR will be automatically created in the [charts repository](https://github.com/KusionStack/charts), and the change content in the PR is to upgrade the `chart version` and `app version`. Demo PR: KusionStack/charts#76 Screenshots: ![image](https://github.com/user-attachments/assets/11f69b98-f803-42ae-b9ad-5f0b0147b29d) ## Which issue(s) this PR fixes: Fix #547 --------- Co-authored-by: Rajesh Kumar <107089376+rajeshkio@users.noreply.github.com>
@rajeshkio Hi! After testing and verification, your PR has been merged. It was previously stuck in a permission issue, but after using PAT, it can now work normally. Automatically generated PR: I'm sorry to let you wait for so long... |
No problem. Let me know if there are any other issues I can work with. |
What would you like to be added?
Automatically update the appVersion in Chart when released.
Why is this needed?
The current release process is:
v0.4.5
appVersion
to the new version, such asv0.4.5
.We hope the 3 and 4 steps can be merged into the 2 step and automated together.
The text was updated successfully, but these errors were encountered: