-
Couldn't load subscription status.
- Fork 2.1k
feat: Added goreleaser config for generating release notes and pre release creation #2788
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
base: main
Are you sure you want to change the base?
feat: Added goreleaser config for generating release notes and pre release creation #2788
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Rishab87 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This issue is currently awaiting triage. If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
| release: | ||
| github: | ||
| owner: Rishab87 | ||
| name: kube-state-metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be the release author (the one that the release will be attributed to)? If so, this should ideally infer the person who pushed the tag, as they will be responsible for reviewing the overall changeset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no this is supposed to be the org, I'll change this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if this was still attributed to the person running the release, to maintain ownership records. So instead of a per-org. release like so:
I'd suggest a per-author release such as:
This is all assuming that the name shown in the image and attributed to the release is indeed derived from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not possible to show the tag pusher name here, either we need a PAT of someone or we can show on the changelog itself released by: username.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Nevermind, then!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not quite sure what you mean by setting this to the "org"? I'd reckon it'd be a bot alias (since that doesn't require a PAT)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've seen there is no direct way of changing bot alias in a release in goreleaser.
I'm not quite sure what you mean by setting this to the "org"?
In the snippet here I've changed the owner to k8s since it was supposed to be the org name here, it is not at all related to the author's name on release which we are discussing here.
| owner: Rishab87 | ||
| name: kube-state-metrics | ||
|
|
||
| prerelease: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First a release candidate (e.g. v1.2.0-rc.0) should be cut. If after a period of 7 days no bugs or issues were reported after publishing the release candidate, a stable release (e.g. v1.2.0) can be cut.
Do we plan on running a prerelease: false workflow after 7 days?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of creating a seperate post release workflow (for merging back to main and running kpromo first) after which we can mark the release as the main release manually (we need to do mark it as main manually because it needs to be done after the merging of the kpromo PR & the 7 day wait period).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather see that automated after a 7-day cron, mostly because it's easy to lose track of. Also, I believe the kpromo and "merging back into main" effort needs to be done for the pre-release too, ideally, all release steps need to be done for both pre-release and final release, so they may be sourced from a single script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, I'll create a seperate PR with cron to check for pre release and mark it as main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just checked the krpomo and merging back to main does not needs to be done for pre-release, it needs to be done before marking the release as main, this is what is mentioned in RELEASE.md, please do correct if I'm wrong, so do we still need a cron? Since we have to manually run post release after prow build is finished and then merge the PRs after 7 days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I guess it made sense to do a kpromo promotion for pre-release as well, so users can test out the image. But since we don't do that at the moment, and no one's asked us to do that anyway, let's keep it as you mentioned.
.goreleaser.yaml
Outdated
| - This release builds with Go `v1.24.6` | ||
| - This release builds with `k8s.io/client-go`: `v0.33.4` | ||
| - This release is the last release that has endpoint metrics enabled by default. In the next release we will enable endpointslices metrics and disable endpoint metrics by default, since the endpoint resources are deprecated. You can still alter this behaviour in kube-state-metrics' config. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be dynamic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you can use
# Additional templated extra files to add to the release.
# Those files will have their contents pass through the template engine,
# and its results will be added to the release.
#
# This feature is only available in GoReleaser Pro.
# Templates: allowed.
templated_extra_files:
- src: LICENSE.tpl
dst: LICENSE.txt
to achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the versions dyanmic by getting them from go.mod in wokflow and passing them in env
| - 'Merge branch' | ||
| - 'Merge pull request' | ||
|
|
||
| release: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussions should allow user to report concerns between the prerelease-to-release period.
# If set, will create a release discussion in the category specified.
#
# Warning: do not use categories in the 'Announcement' format.
# Check https://github.com/goreleaser/goreleaser/issues/2304 for more info.
#
# Default: ''.
discussion_category_name: Releases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we can close the discussions once that period is over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope we need to do that manually
| footer: | | ||
| **Full Changelog**: {{ .GitURL }}/compare/{{ .PreviousTag }}...{{ .Tag }} | ||
|
|
||
| mode: replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# You can add extra pre-existing files to the release.
# The filename on the release will be the last part of the path (base).
# If another file with the same name exists, the last one found will be used.
#
# Templates: allowed.
extra_files:
- glob: ./path/to/file.txt
- glob: ./glob/**/to/**/file/**/*
- glob: ./glob/foo/to/bar/file/foobar/override_from_previous
- glob: ./single_file.txt
name_template: file.txt # note that this only works if glob matches 1 file only
I believe we'll need to use this to export the openvex and SBOMs? Or is that done without this already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they're built currently on creating a main release automatically, I don't think we should add them in pre-release here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not sure if we should skip them for pre-releases, I'd rather keep the pre-release and release workflow as coherent as possible, so the pre-release artifacts can be inspected as well. This pattern will allow us to have a nearly identical release copy to verify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so for that I can create a seperate PR changing the existing workflow which exports openvex and sboms to run on both pre release and release?
.goreleaser.yaml
Outdated
| builds: | ||
| - skip: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KSM isn't shipped as a library at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should build it then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should, as long as it invokes the in-house build target.
.goreleaser.yaml
Outdated
| builds: | ||
| - skip: true | ||
|
|
||
| archives: [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we do release tarballs:
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
due to skip build set to true , no artifacts are being uploaded as an asset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now I've removed build skip and I'm able to build these tarballs
32f0445 to
0c0b972
Compare
|
@rexagod thanks for the review, I've addressed them, can you have a look again? The full changelog compares to v2.16.0, I think that's because while releasing v2.17.0 & merging back to main, instead of |
0c0b972 to
af3802f
Compare




What this PR does / why we need it:
In this PR I've added goreleaser config and a workflow which on tag push helps to generate release notes and create a pre release on github.
Test release: https://github.com/Rishab87/kube-state-metrics/releases/tag/v2.18.0
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
does not changes
Which issue(s) this PR fixes: (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged)Related to #2756