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

fix: HelmChart always bumps Chart Version #1541

Merged
merged 13 commits into from
Sep 7, 2023
Merged

Conversation

olblak
Copy link
Member

@olblak olblak commented Aug 29, 2023

Fix #693

\When used with a scm, the helmchart resource now monitors the Chart.yaml from the branch mentioned by the scm resource. It tries to be smart by either using the computed version from the base branch, or it uses without modification the one mentioned in the new temporary branch if the later one is newer.

Test Scenario
Pipeline 1:
*  `1.0.0` (from base branch) -> apply patch update -> `1.0.1`
* no temporary branch yet so creating a new one with version to `1.0.1`

Pipeline 2: 
*  `1.0.0` (from base branch) -> apply patch update -> `1.0.1`
* tmp branch already set to ``1.0.1` so nothing else to do

Pipeline 3: 
*  `1.0.0` (from base branch) -> apply minor update -> `1.1.0`
* tmp branch set to ``1.0.1` which is older than `1.1.0` 
* Updating temporary branch to `1.1.0`

Pipeline 4: 
*  `1.0.0` (from base branch) -> apply patch update -> `1.0.1`
* tmp branch set to ``1.1.0` which is newer than `1.0.1` nothing else to do 

Test

To test this pull request, you can run the following commands:

cd <to_package_directory>
go test

Additional Information

Tradeoff

Potential improvement

  • While working on this pullrequest, I realise the plugin would only update Chart.yaml and don't try to handle Chart.yml which I think is an accepted file extension.

Signed-off-by: Olblak <me@olblak.com>
This commit refactors the helm chart plugin to use the version from the
origin branch when used with a scm

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added resource-helm enhancement New feature or request labels Aug 30, 2023
@olblak olblak self-assigned this Aug 30, 2023
olblak and others added 11 commits August 30, 2023 20:20
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
* Update appVersion before updating chart version
* Only force updating Chart version update scm is specified otherwise
  only bump the version when the chart changed either appVersion or its
  content

Signed-off-by: Olblak <me@olblak.com>
Signed-off-by: Olblak <me@olblak.com>
* Rename workingChartMetadata to currentChartMetadata for better
  visibility

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak merged commit d12d454 into updatecli:main Sep 7, 2023
6 checks passed
@olblak olblak added bug Something isn't working and removed enhancement New feature or request labels Sep 7, 2023
@olblak olblak added this to the 0.59.0 milestone Sep 12, 2023
@olblak olblak deleted the issue/693 branch October 17, 2023 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resource-helm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HelmChart always bumps Chart Version when it detectes a change
1 participant