feat: add Artifacthub annotation 'artifacthub.io/changes' #881

Merged
pat-s merged 2 commits from volker.raschek/helm-chart:feat/support-artifacthub-annotation-changes into main 2025-06-16 14:20:40 +00:00
Member

The following PR add the annotation 'artifacthub.io/changes'. For each semantic
commit will be the annotation extended. Further information can be found in the
documentation of
Artifacthub.io.

The CI has been adapted. The binary jq as well as yq in >= v4.0 is required.
Otherwise will not be concatenated the YAML file correctly via the yq expression,
because the loadstr() expression is not available in lower versions.

Additionally the relation between the semantic commit and the Artifacthub.io
change log type should be clarified. The current relationshiop can be adapted if
needed.

Furthermore, yq will be installed as part of the CI steps. It would be great if
yq is also available as deb package in >=v4.0. This would reduce the boiler
plate to install yq and maintain the version via renovate.

Regarding the renovate expression. In my environment works this expression, but
I don't know if it also works in this gitea/renovate instance.

The following PR add the annotation 'artifacthub.io/changes'. For each semantic commit will be the annotation extended. Further information can be found in the documentation of [Artifacthub.io](https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations). The CI has been adapted. The binary jq as well as yq in >= v4.0 is required. Otherwise will not be concatenated the YAML file correctly via the yq expression, because the `loadstr()` expression is not available in lower versions. Additionally the relation between the semantic commit and the Artifacthub.io change log type should be clarified. The current relationshiop can be adapted if needed. Furthermore, yq will be installed as part of the CI steps. It would be great if yq is also available as deb package in >=v4.0. This would reduce the boiler plate to install yq and maintain the version via renovate. Regarding the renovate expression. In my environment works this expression, but I don't know if it also works in this gitea/renovate instance.
volker.raschek added 1 commit 2025-06-04 20:33:43 +00:00
feat: add Artifacthub annotation 'artifacthub.io/changes'
All checks were successful
commitlint / check-and-test (pull_request) Successful in 6s
check-and-test / check-and-test (pull_request) Successful in 50s
2ecde05582
The following PR add the annotation 'artifacthub.io/changes'. For each semantic commit will be the annotation extended. Further information can be found in the documentation of [Artifacthub.io](https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations). The CI has been adapted. The binary jq as well as yq in >= v4.0 is required. Otherwise will not be concatenated the YAML file correctly via the yq expression, because the `loadstr()` expression is not available in lower versions. Additionally the relation between the semantic commit and the Artifacthub.io change log type should be clarified. The current relationshiop can be adapted if needed. Furthermore, yq will be installed as part of the CI steps. It would be great if yq is also available as deb package in >=v4.0. This would reduce the boiler plate to install yq and maintain the version via renovate. Regarding the renovate expression. In my environment works this expression, but I don't know if it also works in this gitea/renovate instance.
volker.raschek requested review from justusbunsi 2025-06-04 20:33:43 +00:00
volker.raschek requested review from pat-s 2025-06-04 20:33:43 +00:00
Author
Member

Hi @justusbunsi, @ChristopherHX and @pat-s,
please take a review and inform me about required changes. I let the PR on WIP until I have verified the release workflow on my own instance.

Volker

Hi @justusbunsi, @ChristopherHX and @pat-s, please take a review and inform me about required changes. I let the PR on WIP until I have verified the release workflow on my own instance. Volker
volker.raschek requested review from ChristopherHX 2025-06-04 20:37:26 +00:00
pat-s requested changes 2025-06-04 20:46:44 +00:00
Dismissed
pat-s left a comment
Collaborator

Thanks! I am using artifacthub.io myself. What I don't like about the automatic parsing is that everything must go into Chart.yaml. This really creates a mess, especially with all those PR entries.

If we do this, the changelog entries should IMO be added at the end of the file, not at the top. As a user I expect to see the Chart info first, then everything else.

WRT to the script:

  • does it account for removals of changelog entries from previous releases?

Workflow: You can also add a new one using an Alpine container and install yq in there.

Thanks! I am using artifacthub.io myself. What I don't like about the automatic parsing is that everything must go into `Chart.yaml`. This really creates a mess, especially with all those PR entries. If we do this, the changelog entries should IMO be added at the end of the file, not at the top. As a user I expect to see the Chart info first, then everything else. WRT to the script: - does it account for removals of changelog entries from previous releases? Workflow: You can also add a new one using an Alpine container and install `yq` in there.
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 2ecde05582 to 540350dbfa 2025-06-05 06:10:47 +00:00 Compare
Author
Member

Good morning,

What I don't like about the automatic parsing is that everything must go into Chart.yaml. This really creates a mess, especially with all those PR entries.

you're absolutely right, but the changes in the Chart.yaml was my fault. The intention is, that .annotations."artifacthub.io/changes" will be generated and added only durning the release. The version will be set via helm and the chart will than be packaged. The annotation including the changelog is than part of the helm chart tarball, but not part of the Chart.yaml of the repository.

For this reason, the user will never see the annotations in Chart.yaml. I probably failed to commit the change in Chart.yaml during the test run.

does it account for removals of changelog entries from previous releases?

I think the question has become superfluous after I explained the workflow :-)

You can also add a new one using an Alpine container and install yq in there.

I will look at library/alpine to install and use yq in it.

Good morning, > What I don't like about the automatic parsing is that everything must go into Chart.yaml. This really creates a mess, especially with all those PR entries. you're absolutely right, but the changes in the `Chart.yaml` was my fault. The intention is, that `.annotations."artifacthub.io/changes"` will be generated and added only durning the release. The version will be set via helm and the chart will than be packaged. The annotation including the changelog is than part of the helm chart tarball, but not part of the `Chart.yaml` of the repository. For this reason, the user will never see the annotations in `Chart.yaml`. I probably failed to commit the change in `Chart.yaml` during the test run. > does it account for removals of changelog entries from previous releases? I think the question has become superfluous after I explained the workflow :-) > You can also add a new one using an Alpine container and install yq in there. I will look at `library/alpine` to install and use `yq` in it.
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 540350dbfa to 81a0dc54e9 2025-06-06 19:14:11 +00:00 Compare
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 81a0dc54e9 to 16d82e3c9c 2025-06-06 19:14:40 +00:00 Compare
Author
Member

Hi @pat-s,
i've tested the CI pipeline on my own instance. Some workflows as well as some steps of the release workflow has been disabled, because I don't have the secrets. Nevertheless, the annotations has been added as expected. I've let the CI print the Chart.yaml file on stdout: https://git.cryptic.systems/volker.raschek/helm-gitea/actions/runs/55#jobstep-9-1

Please review my PR now 😄

Further feedback is welcome. FYI @justusbunsi

Hi @pat-s, i've tested the CI pipeline on my own instance. Some workflows as well as some steps of the release workflow has been disabled, because I don't have the secrets. Nevertheless, the annotations has been added as expected. I've let the CI print the `Chart.yaml` file on stdout: https://git.cryptic.systems/volker.raschek/helm-gitea/actions/runs/55#jobstep-9-1 Please review my PR now 😄 Further feedback is welcome. FYI @justusbunsi
volker.raschek changed title from WIP: feat: add Artifacthub annotation 'artifacthub.io/changes' to feat: add Artifacthub annotation 'artifacthub.io/changes' 2025-06-06 19:17:53 +00:00
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 16d82e3c9c to 162a3c7e8d 2025-06-06 19:19:06 +00:00 Compare
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 162a3c7e8d to 8bf44b06a6 2025-06-06 19:20:35 +00:00 Compare
pat-s reviewed 2025-06-07 07:53:37 +00:00
pat-s left a comment
Collaborator

Thanks!

Somewhat sad that artifacthub didn't implement conv commits and instead now there is a new logic needed parsing conv commit tags into their labeling structure.

Overall LGTM, you wanna check if my suggestion helps.

Thanks! Somewhat sad that artifacthub didn't implement conv commits and instead now there is a new logic needed parsing conv commit tags into their labeling structure. Overall LGTM, you wanna check if my suggestion helps.
@@ -23,3 +18,1 @@
tar -xzf helm-v${{ env.HELM_VERSION }}-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/
rm -rf linux-amd64 helm-v${{ env.HELM_VERSION }}-linux-amd64.tar.gz
# determine operating system
Collaborator

What about dpkg --print-architecture?

What about `dpkg --print-architecture`?
Author
Member

Good question, I can definitely change that. I mean, we won't be switching away from ubuntu that quickly.

Good question, I can definitely change that. I mean, we won't be switching away from ubuntu that quickly.
volker.raschek marked this conversation as resolved
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 8bf44b06a6 to 8f42541b3e 2025-06-07 10:04:45 +00:00 Compare
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from 8f42541b3e to 4eed5ca3df 2025-06-07 10:18:21 +00:00 Compare
pat-s reviewed 2025-06-10 17:34:49 +00:00
pat-s left a comment
Collaborator

When using dpkg --print-architecture let's use it in a way to save lines :)

PS: Please try to avoid force pushes in PRs, unless really necessary.

When using `dpkg --print-architecture` let's use it in a way to save lines :) PS: Please try to avoid force pushes in PRs, unless really necessary.
@@ -18,0 +13,4 @@
with:
fetch-depth: 0
- name: Determine Architecture and Operating System to support x86_64 and ARM based CI nodes
Collaborator

This whole block can be omitted by using dpkg --print-architecture. You can create the content of an env var dynamically with it.

This whole block can be omitted by using `dpkg --print-architecture`. You can create the content of an env var dynamically with it.
Author
Member

the following option is required for add-annoations.sh:

with:  fetch-depth: 0 

Regarding the block Determine Architecture and Operating System to support x86_64 and ARM based CI nodes: Yes, it's true that we can define the content of an env var dynamically like example below:

- name: Determine Architecture and Operating System to support x86_64 and ARM based CI nodes  run: |  echo "ARCH=$(dpkg --print-architecture)" >> $GITHUB_ENV  echo "INFO: Set environment variable ARCH=${ARCH}" 

This would lead to an issue, that echo "INFO: Set environment variable ARCH=${ARCH}" will never print the stored value of ARCH, because the GITHUB_ENV is not than evaluated. I would prefer for debugging to log the value of ARCH and OS, but when you would prefer to reduce the CI commands I can remove the echo command as well to avoid the mentioned issue.

the following option is required for `add-annoations.sh`: ```yaml with: fetch-depth: 0 ``` Regarding the block `Determine Architecture and Operating System to support x86_64 and ARM based CI nodes`: Yes, it's true that we can define the content of an env var dynamically like example below: ```yaml - name: Determine Architecture and Operating System to support x86_64 and ARM based CI nodes run: | echo "ARCH=$(dpkg --print-architecture)" >> $GITHUB_ENV echo "INFO: Set environment variable ARCH=${ARCH}" ``` This would lead to an issue, that `echo "INFO: Set environment variable ARCH=${ARCH}"` will never print the stored value of `ARCH`, because the `GITHUB_ENV` is not than evaluated. I would prefer for debugging to log the value of `ARCH` and `OS`, but when you would prefer to reduce the CI commands I can remove the echo command as well to avoid the mentioned issue.
Collaborator

the following option is required for add-annoations.sh:

Didn't comment on that :)


What is the benefit of a dedicated step setting and printing the architecture?
arch and dpkg --print-architecture are standard practice, they don't need debugging or high verbosity. Their return is clear :)

> the following option is required for add-annoations.sh: Didn't comment on that :) --- What is the benefit of a dedicated step setting and printing the architecture? `arch` and `dpkg --print-architecture` are standard practice, they don't need debugging or high verbosity. Their return is clear :)
Collaborator

@volker.raschek The next release is currently blocked by this (in case you wanna get it in and not wait for the next one). LMK if you wanna finish here in the next days or if we should continue with the release.

@volker.raschek The next release is currently blocked by this (in case you wanna get it in and not wait for the next one). LMK if you wanna finish here in the next days or if we should continue with the release.
Author
Member

This may sound rather stupid and is due to my current work, but there are actually programs that return a different value at runtime. I don't want to accuse dpkg of this at all, but I have had experiences with other programs in the context of CI that have almost driven me to despair.

I have therefore got into the habit of relying as little as possible on the independent approach of programs in the CI. Especially when I am dependent on preparing an environment properly.

Since this seems superfluous for the project in the first place, I agree with you. I have therefore provided another commit that replaces OS and ARCH with a static value linux as well as dpkg commands, even if I can't endorse the latter.

This may sound rather stupid and is due to my current work, but there are actually programs that return a different value at runtime. I don't want to accuse `dpkg` of this at all, but I have had experiences with other programs in the context of CI that have almost driven me to despair. I have therefore got into the habit of relying as little as possible on the independent approach of programs in the CI. Especially when I am dependent on preparing an environment properly. Since this seems superfluous for the project in the first place, I agree with you. I have therefore provided another commit that replaces OS and ARCH with a static value `linux` as well as `dpkg` commands, even if I can't endorse the latter.
volker.raschek marked this conversation as resolved
volker.raschek added 1 commit 2025-06-16 07:35:30 +00:00
fix(ci): replace OS and ARCH
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 48s
da0eda0ffc
The following patch replaces ${OS} and ${ARCH} with a static value `linux` and the command `dpkg --print-architecture`.
volker.raschek force-pushed feat/support-artifacthub-annotation-changes from da0eda0ffc to 2b1979b43c 2025-06-16 07:51:08 +00:00 Compare
Author
Member

I've rebased the PR, because the helm version has been updated and leads to a merge conflict.

- HELM_VERSION: "3.17.3" + HELM_VERSION: "3.18.2" 
I've rebased the PR, because the helm version has been updated and leads to a merge conflict. ```diff - HELM_VERSION: "3.17.3" + HELM_VERSION: "3.18.2" ```
Collaborator

I've rebased the PR, because the helm version has been updated and leads to a merge conflict.

Still a merge + normal push would have sufficed 😃
Just for my own curiosity: why did you go with a force-push to solve the conflict?

(I am seeing force-pushes more often lately and still trying to understand where the pattern comes from and why users are doing it so often.).

> I've rebased the PR, because the helm version has been updated and leads to a merge conflict. Still a merge + normal push would have sufficed 😃️ Just for my own curiosity: why did you go with a force-push to solve the conflict? (I am seeing force-pushes more often lately and still trying to understand where the pattern comes from and why users are doing it so often.).
pat-s approved these changes 2025-06-16 14:20:14 +00:00
pat-s left a comment
Collaborator

LGTM!

LGTM!
pat-s merged commit ec7a659535 into main 2025-06-16 14:20:40 +00:00
volker.raschek deleted branch feat/support-artifacthub-annotation-changes 2025-06-16 14:24:34 +00:00
Author
Member

(I am seeing force-pushes more often lately and still trying to understand where the pattern comes from and why users are doing it so often.).

In this specific example, the CI ran through, but with the note that there is a conflict with the latest changes in origin/main.

Again, I can only speak from my experience with git. As a rule, you want to ensure that there is only one fork for a feature that is being developed in a branch. If you merge these, you merge the branch instead of doing a rebase. This enables you to revert a complete feature back based on the merge commit.

However, if a merge has been made from origin/main to the feature branch in the meantime, a history similar to a "fan" is created. People often try to avoid this because it contains unnecessary merge commits and bloats the git object store, especially for large mono projects.

> (I am seeing force-pushes more often lately and still trying to understand where the pattern comes from and why users are doing it so often.). In this specific example, the CI ran through, but with the note that there is a conflict with the latest changes in `origin/main`. Again, I can only speak from my experience with git. As a rule, you want to ensure that there is only one fork for a feature that is being developed in a branch. If you merge these, you merge the branch instead of doing a rebase. This enables you to revert a complete feature back based on the merge commit. However, if a merge has been made from `origin/main` to the feature branch in the meantime, a history similar to a "fan" is created. People often try to avoid this because it contains unnecessary merge commits and bloats the git object store, especially for large mono projects.
Sign in to join this conversation.
No description provided.