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

Feature: Changelog #118

Closed
estahn opened this issue Apr 8, 2021 · 18 comments
Closed

Feature: Changelog #118

estahn opened this issue Apr 8, 2021 · 18 comments

Comments

@estahn
Copy link

estahn commented Apr 8, 2021

We had multiple users ask for a changelog on the GitHub release. We use semantic-release but not sure how to wire this up.

@smlx
Copy link

smlx commented Apr 11, 2021

related: helm/chart-releaser-action#44

not sure if this feature request belongs in the action or in cr itself.

@pratikbin
Copy link

pratikbin commented Jun 2, 2021

You can give option to add body in release i.e. cr upload --release-body <file or text>, so we can add our custom one.

@thesuperzapper
Copy link

@unguiculus are you ok with a feature like cr upload --release-body <file_path>?

This will make it possible for users to store things like changelogs in the GitHub release text.

@pratikbin
Copy link

@thesuperzapper But then how can it can distinguish for which chart release will set body cause AFAIK it will check charts in CR_PACKAGE_PATH and based on that it will release multiple if there

@estahn
Copy link
Author

estahn commented Jun 29, 2021

Atlassian came up with an interesting approach, which they called changesets (https://github.com/atlassian/changesets). I've seen this being used in Backstage. This could solve the above issue as it will also allow recording migration strategies, e.g. structure changes in values.yaml.

@thesuperzapper
Copy link

Regardless, we still need to support some way of specifying the body of the release in chart-releaser.

I think the proposed cr upload --release-body <file_path> is a good idea.

@estahn
Copy link
Author

estahn commented Jun 30, 2021

@thesuperzapper I think you skipped @pratikbalar comment.

But then how can it can distinguish for which chart release will set body cause AFAIK it will check charts in CR_PACKAGE_PATH and based on that it will release multiple if there

@pratikbin
Copy link

Atlassian came up with an interesting approach, which they called changesets (https://github.com/atlassian/changesets). I've seen this being used in Backstage. This could solve the above issue as it will also allow recording migration strategies, e.g. structure changes in values.yaml.

Kindly tell us more about it if you can

@macobo
Copy link

macobo commented Jul 7, 2021

I think we can standardize this beyond --release-body by copying e.g. dependabot for a default.

E.g.

CHART DESCRIPTION

Updates chart to version X

Commits:
Collapsible section with list of all commits since master

@chgl
Copy link

chgl commented Sep 15, 2021

ArtifactHub introduced annotations to encode a changelog for a chart: https://artifacthub.io/docs/topics/annotations/helm/#supported-annotations

In theory, these could be parsed, prettified and set similarly to how the current implementation uses the Chart.yaml's description as the release description: https://github.com/helm/chart-releaser/blob/main/pkg/releaser/releaser.go#L322 However, this would couple the chart-releaser implementation to ArtifactHub's annotations which may not be desirable.

@aabouzaid
Copy link
Contributor

This feature is really important to automate the whole workflow.

To set the release notes after the actual release I need to do a lot of kung-fu! (which is error-prone) I need to extract the updated charts and call GH API twice because even GH CLI doesn't support update release at the moment!

For that reason, I've created this PR no. #137 to add chart release-notes or changelog (without any coupling to an external source).

@Zelldon
Copy link

Zelldon commented Oct 26, 2021

This should be much easier now, since the github release also supports auto generate changelog
Newest version which supports this: https://github.com/google/go-github/releases/tag/v39.2.0

See blog post https://github.blog/2021-10-04-beta-github-releases-improving-release-experience/#introducing-auto-generated-release-notes

@aabouzaid
Copy link
Contributor

@cpanato since the PR no. #137 is merged, the last thing to close this issue is to release a new version.
Is there an expected date/schedule for the release?

@LeoColomb
Copy link

In theory, these could be parsed, prettified and set similarly to how the current implementation uses the Chart.yaml's description as the release description: main/pkg/releaser/releaser.go#L322 However, this would couple the chart-releaser implementation to ArtifactHub's annotations which may not be desirable.

Indeed, but like the file for the release notes, I guess the annotation to use can be managed by the configuration?

@cpanato
Copy link
Member

cpanato commented Nov 5, 2021

@aabouzaid @LeoColomb are you willing to submit a PR to contribute to some docs in how to use that?

the release will come soon, need to perform some tests

will close this issue since it is already merged to the main branch

@cpanato cpanato closed this as completed Nov 5, 2021
@chgl
Copy link

chgl commented Nov 5, 2021

In theory, these could be parsed, prettified and set similarly to how the current implementation uses the Chart.yaml's description as the release description: main/pkg/releaser/releaser.go#L322 However, this would couple the chart-releaser implementation to ArtifactHub's annotations which may not be desirable.

Indeed, but like the file for the release notes, I guess the annotation to use can be managed by the configuration?

I think the current implementation is perfect to also handle generating a changelog file from the annotations. I'm currently playing around with something like this:

cat "Chart.yaml" |
        yq e '.annotations["artifacthub.io/changes"]' - |                                                           # extract the changes annotation, which is a YAML array
        yq -o json e '.' - |                                                                                        # convert the YAML array to a JSON array
        jq 'group_by(.kind) | to_entries | map({key: .value[0].kind, value: .value})' - |                           # group the JSON array by their 'kind' - ie. the type of change
        gomplate -d chart="Chart.yaml" -d changes=stdin:///in.json -f CHANGELOG.md.gotmpl >"CHANGELOG.md" # use the JSON above as input to render the changelog

CHANGELOG.md.gotmpl:

{{ $chart := (ds "chart") -}}
{{ $changes := (ds "changes") -}}
# Changelog

## {{ $chart.version }}

{{- range $kind := $changes }}

### {{ $kind.key | strings.Title }}

{{- range $change := $kind.value }}
- {{ $change.description }}
{{- end }}

{{- end }}

@nlamirault
Copy link

does anyone have an example of how to make a chart release with a changelog using this Github Action ?

@aabouzaid
Copy link
Contributor

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

No branches or pull requests