Skip to content

feat(helm/release-chart): update version for umbrella chart children#329

Merged
neilime merged 1 commit intomainfrom
feat/helm-release-umbrella-version
Mar 10, 2025
Merged

feat(helm/release-chart): update version for umbrella chart children#329
neilime merged 1 commit intomainfrom
feat/helm-release-umbrella-version

Conversation

@neilime
Copy link
Copy Markdown
Member

@neilime neilime commented Jul 31, 2024

As a DevOps Engineer
I want to update the version for the child charts in our umbrella Helm release
So that the latest features and bug fixes are included in the deployment process

Resources:

package main

import (
	"bytes"
	"fmt"
	"encoding/json"
	"path/filepath"
	"helm.sh/helm/v4/pkg/chart/v2/loader"
	"helm.sh/helm/v4/pkg/provenance"
	chart "helm.sh/helm/v4/pkg/chart/v2"
)

func HashReq(req, lock []*chart.Dependency) (string, error) {
	data, err := json.Marshal([2][]*chart.Dependency{req, lock})
	if err != nil {
		return "", err
	}
	s, err := provenance.Digest(bytes.NewBuffer(data))
	return "sha256:" + s, err
}

func main() {
	fmt.Println("Hello")

	chartDir, err := filepath.Abs("./charts/umbrella-application")
	if err != nil {
		panic(err)
	}

	c, err := loader.LoadDir(chartDir)
	if err != nil {
		panic(err)
	}

	fmt.Println(c.Metadata.Name)

	lock := c.Lock
	req := c.Metadata.Dependencies

	data, err := json.Marshal([2][]*chart.Dependency{req, lock.Dependencies})

	if err != nil {
		panic(err)
	}

	fmt.Println(string(data))

	
	sum, err := HashReq(req, lock.Dependencies);

	if err != nil {
		panic(err)
	}

	fmt.Println(sum)
}

Acceptance Criteria:

  • Update the version for all child charts in the umbrella Helm release
  • Ensure backward compatibility with existing deployments
  • Validate the changes through CI/CD pipelines
  • Document the version updates for future reference

Impact:

  • Improved reliability and feature set of the deployed applications
  • Streamlined deployment process with the latest updates

@neilime neilime self-assigned this Jul 31, 2024
@neilime neilime linked an issue Jul 31, 2024 that may be closed by this pull request
@neilime neilime requested a review from fredleger July 31, 2024 08:03
@neilime
Copy link
Copy Markdown
Member Author

neilime commented Jul 31, 2024

@fredleger it is complicated to upgrade the umbrella chart children versions.

Because if we change the version of a child, we must change the root Chart dependencies version so we must run helm dependency update (https://github.com/hoverkraft-tech/ci-github-container/actions/runs/10176351460/job/28145583710?pr=329#step:4:291)

It's not good to me because we don't have control on what we update.

What's your opinion?

@fredleger
Copy link
Copy Markdown
Contributor

That's true I didn't anticipate this point. My bad.

About the control I'm not sure, if this is a real dependency like mysql the version is locked by the semver used.

If it's one of our child deps then we know what we are updating.

Maybe I'm missing something in the picture here. Let me know.

Another way maybe to find a way to do only partial updates of lock file but I'm not sure it's even possible.

@neilime
Copy link
Copy Markdown
Member Author

neilime commented Jul 31, 2024

  • It seems impossible to update a specific dependency
  • Relying on semver version is dangerous as it depends which kind of version is used (By example, Helm recommends the use of version ranges - https://helm.sh/docs/chart_best_practices/dependencies/#versions)
  • The only way to me is to update the Chart.lock manually, but I dont know how (we need to reverse engineer helm) and I dont think it is a good solution

@neilime neilime force-pushed the feat/helm-release-umbrella-version branch from 786e002 to 38115ba Compare July 31, 2024 11:24
Copy link
Copy Markdown
Contributor

@fredleger fredleger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think limiting it to dependencies starting with file protocol is clever and give good control over it

@neilime
Copy link
Copy Markdown
Member Author

neilime commented Jul 31, 2024

I think limiting it to dependencies starting with file protocol is clever and give good control over it

How can we do it?

@fredleger fredleger self-assigned this Sep 13, 2024
@neilime
Copy link
Copy Markdown
Member Author

neilime commented Sep 13, 2024

@fredleger should check it

@neilime neilime force-pushed the feat/helm-release-umbrella-version branch 2 times, most recently from 5b17097 to 2ae6e0e Compare October 11, 2024 09:28
@hoverkraft-tech hoverkraft-tech deleted a comment from github-actions bot Dec 11, 2024
@fredleger
Copy link
Copy Markdown
Contributor

@neilime i will try to work on it soon

@neilime neilime force-pushed the feat/helm-release-umbrella-version branch 2 times, most recently from 1603e42 to 1dc2b52 Compare January 27, 2025 13:22
@neilime neilime force-pushed the feat/helm-release-umbrella-version branch 2 times, most recently from 4d9a1ac to 35d3b2a Compare February 25, 2025 08:05
@neilime neilime force-pushed the feat/helm-release-umbrella-version branch from 35d3b2a to 89835ce Compare March 4, 2025 05:55
@fredleger
Copy link
Copy Markdown
Contributor

Nous sommes un peu bloqués sur ce point. On pourrait tenter de faire remonter le point upstream dans helm en expliquant notre besoin initial ?

@neilime neilime force-pushed the feat/helm-release-umbrella-version branch 7 times, most recently from 50e9e5f to a2d3c24 Compare March 7, 2025 12:03
@neilime neilime force-pushed the feat/helm-release-umbrella-version branch 13 times, most recently from 2567b4c to 3f6b9d2 Compare March 8, 2025 20:36
@neilime neilime changed the title feat(helm/release-chart): update version for umbrella chart children feat(helm/release-chart)!: update version for umbrella chart children Mar 8, 2025
@neilime neilime force-pushed the feat/helm-release-umbrella-version branch from 3f6b9d2 to e4f11e4 Compare March 8, 2025 20:41
@neilime neilime changed the title feat(helm/release-chart)!: update version for umbrella chart children feat(helm/release-chart): update version for umbrella chart children Mar 8, 2025
@neilime neilime force-pushed the feat/helm-release-umbrella-version branch 4 times, most recently from b5c8d19 to 3d1705d Compare March 9, 2025 20:08
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
@neilime neilime force-pushed the feat/helm-release-umbrella-version branch from 3d1705d to fba3e97 Compare March 10, 2025 10:38
@neilime neilime merged commit 5a55a9c into main Mar 10, 2025
41 checks passed
@neilime neilime deleted the feat/helm-release-umbrella-version branch March 10, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supports umbrella charts

2 participants