updatecli / updatecli

A Declarative Dependency Management tool
https://www.updatecli.io
Apache License 2.0
539 stars 62 forks source link

Feature Request: configurable appVersion source with helm autodiscovery #1555

Open gionn opened 1 year ago

gionn commented 1 year ago

Is your feature request related to a problem?

updating appVersion inside Chart.yaml works great when the chart values has a common structure (e.g. $.image.tag) but for more ~ugly~ complex charts which contains multiple tag references we may need an alternative way to configure which is the value to use

Solution you'd like

Have a simple way to mark a specific values field to be the source for updating the chart appVersion, e.g.

componentImage:
  tag: 1.2.3 # appVersion

Alternatives you've considered

Without relying on helm autodiscovery, I can simply have a pipeline like:

name: Chart appVersion sync

sources:
  valuesComponentImageTag:
    name: Component tag
    kind: yaml
    spec:
      file: helm/my-chart/values.yaml
      key: $.componentImage.tag

targets:
  chartAppVersion:
    name: my-chart appVersion
    kind: yaml
    spec:
      file: helm/my-chart/Chart.yaml
      key: $.appVersion

but of course this don't scale well :)

Anything else?

No response

olblak commented 10 months ago

I am not sure how we could achieve that with the helm autodiscovery. I mean having one rule that works for all the usecases.

With the declarative approach we can set appversion: true as documented on https://www.updatecli.io/docs/plugins/resource/helm_chart/

If set to true it will also bump the chart appversion with the source information

gionn commented 10 months ago

a more generic solution could be to have an additional file inside the helm chart directory (e.g. updatecli.yaml in same folder of Chart.yaml) to override specific default behaviours of the autodiscovery crawler - like the yaml path inside values to use for updating appVersion.

olblak commented 10 months ago

I like you suggestion which makes me realize that we could specify annotations in Chart.yaml with something like https://helm.sh/docs/chart_best_practices/labels/

Annotation could be io.updatecli.source like

annotations:
    io.updatecli.source: |
        name: Get latest Jenkins version
        kind: jenkins