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

✨ Add release notes expander functionality #10091

Merged

Conversation

chandankumar4
Copy link
Contributor

What this PR does / why we need it:

Add expander in generated release notes

./bin/notes --release v1.6.0 --pre-release-version true > CHANGELOG/v1.6.0.md


$ cat CHANGELOG/v1.6.0.md 
🚨 This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api/issues/new).
## 👌 Kubernetes version support

- Management Cluster: v1.**X**.x -> v1.**X**.x
- Workload Cluster: v1.**X**.x -> v1.**X**.x

[More information about version support can be found here](https://cluster-api.sigs.k8s.io/reference/versions.html)

## Highlights

* REPLACE ME

## Deprecation Warning

REPLACE ME: A couple sentences describing the deprecation, including links to docs.

* [GitHub issue #REPLACE ME](REPLACE ME)

## Changes since v1.5.0
## :chart_with_upwards_trend: Overview
- 417 new commits merged
- 6 breaking changes :warning:
- 16 feature additions ✨
- 46 bugs fixed 🐛

## :memo: Proposals
- Community meeting: Add proposal for karpenter integration feature group (#9571)

<details>
<summary>More details about the release</summary>

## :warning: Breaking Changes
- API: Remove v1alpha3 API Version (#8997)
- API: Stop serving v1alpha4 API Versions (#8996)
- clusterctl: Improve Context handling in clusterctl (#8939)
- Dependency: Bump to controller-runtime v0.16 (#8999)
- MULTIPLE_AREAS[Metrics/Logging]: Implement secure diagnostics (metrics, pprof, log level changes) (#9264)
- util: : Remove go-vcs dependency from releaselink tool (#9288)

## :sparkles: New Features
- Testing: V1.29: Prepare quickstart, capd and tests for the new release including kind bump (#9890)
.....

## :bug: Bug Fixes

- util: Fix AddAnnotations for unstructured.Unstructured (#9164)
.....

## :seedling: Others
- API: Add ClusterClass column to Cluster CRD (#9120)
....

:book: Additionally, there have been 65 contributions to our documentation and book. (#10024, #10047, #8260, #8500, #8678, #8819, #8988, #9001, #9013, #9014, #9024, #9029, #9080, #9081, #9087, #9112, #9119, #9141, #9146, #9150, #9161, #9173, #9208, #9209, #9213, #9214, #9232, #9270, #9286, #9291, #9305, #9328, #9364, #9386, #9403, #9415, #9429, #9433, #9463, #9487, #9488, #9490, #9511, #9513, #9514, #9527, #9550, #9559, #9565, #9572, #9577, #9590, #9593, #9613, #9635, #9654, #9706, #9815, #9816, #9824, #9830, #9878, #9902, #9951, #9979) 


</details>
<br/>

_Thanks to all our contributors!_ 😊

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #9319

/area release

@k8s-ci-robot k8s-ci-robot added area/release Issues or PRs related to releasing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 2, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @chandankumar4. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 2, 2024
@willie-yao
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 2, 2024
Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

Nice work! I generated release notes for v1.6.0-rc.1 and compared it to the existing release notes here. It looks like the intention is to move everything under Kubernetes version support into the dropdown section, and to list changes from the previous release candidate or beta version (v1.6.0-rc.0) in this case outside of the dropdown. This is because the generated content is from v1.5.0 rather than the previous release candidate or beta version. Let me know if this makes sense!

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 6, 2024
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 6, 2024
@chandankumar4
Copy link
Contributor Author

chandankumar4 commented Mar 6, 2024

Nice work! I generated release notes for v1.6.0-rc.1 and compared it to the existing release notes here. It looks like the intention is to move everything under Kubernetes version support into the dropdown section, and to list changes from the previous release candidate or beta version (v1.6.0-rc.0) in this case outside of the dropdown. This is because the generated content is from v1.5.0 rather than the previous release candidate or beta version. Let me know if this makes sense!

Made the changes accordingly. Added --previous-release-version flag, so the example command will looks like

./bin/notes --release v1.6.0-rc.1 --previous-release-version tags/v1.6.0-rc.0  --pre-release-version true > CHANGELOG/v1.6.0-rc.1.md

And generated notes will be

🚨 This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api/issues/new).
## Highlights

* REPLACE ME

## Deprecation Warning

REPLACE ME: A couple sentences describing the deprecation, including links to docs.

* [GitHub issue #REPLACE ME](REPLACE ME)

## Changes since v1.6.0-rc.0
## :chart_with_upwards_trend: Overview
- 57 new commits merged
- 2 feature additions ✨
- 14 bugs fixed 🐛

## :sparkles: New Features
- Control-plane: KCP: Allow mutation of all fields that should be mutable (#9885)
- Testing: V1.29: Prepare quickstart, capd and tests for the new release including kind bump (#9890)

## :bug: Bug Fixes
- CAPD: Fix ignition to also set the kube-proxy configuration to skip setting sysctls (#9895)
...

## :seedling: Others
- CABPK: Add pod metadata to capbk manager (#10212)
- CI: Bump kubebuilder envtest to 1.29.0 (#10014)
....


🚨 This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api/issues/new).
<details>
<summary>More details about the release</summary>
## 👌 Kubernetes version support

- Management Cluster: v1.**X**.x -> v1.**X**.x
- Workload Cluster: v1.**X**.x -> v1.**X**.x

[More information about version support can be found here](https://cluster-api.sigs.k8s.io/reference/versions.html)

## Highlights

* REPLACE ME

## Deprecation Warning

REPLACE ME: A couple sentences describing the deprecation, including links to docs.

* [GitHub issue #REPLACE ME](REPLACE ME)

## Changes since v1.5.0
## :chart_with_upwards_trend: Overview
- 435 new commits merged
- 6 breaking changes :warning:
- 16 feature additions ✨
- 49 bugs fixed 🐛

## :memo: Proposals
- Community meeting: Add proposal for karpenter integration feature group (#9571)

## :warning: Breaking Changes
- API: Remove v1alpha3 API Version (#8997)
...

## :sparkles: New Features
- API: Add validation to nested ObjectMeta fields (#8431)
...

## :bug: Bug Fixes
- CABPK: Certificate paths in cloud-init scripts should not use a platform-dependent path separator (#9167)
...

## :seedling: Others
- API: Add ClusterClass column to Cluster CRD (#9120)
....

:book: Additionally, there have been 67 contributions to our documentation and book. (#10024, #10047, #10105, #10116, #8260, #8500, #8678, #8819, #8988, #9001, #9013, #9014, #9024, #9029, #9080, #9081, #9087, #9112, #9119, #9141, #9146, #9150, #9161, #9173, #9208, #9209, #9213, #9214, #9232, #9270, #9286, #9291, #9305, #9328, #9364, #9386, #9403, #9415, #9429, #9433, #9463, #9487, #9488, #9490, #9511, #9513, #9514, #9527, #9550, #9559, #9565, #9572, #9577, #9590, #9593, #9613, #9635, #9654, #9706, #9815, #9816, #9824, #9830, #9878, #9902, #9951, #9979) 


</details>
<br/>
_Thanks to all our contributors!_ 😊

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

I ran the following command as it was listed in the PR description and get a a panic: panic: runtime error: index out of range [1] with length 1

./bin/notes --release v1.6.0 --pre-release-version true > CHANGELOG/v1.6.0.md

I think you might need to enforce setting --previous-release-version if --pre-release-version is set to true.

This also seems to happen for regular releases without setting --pre-release-version true. For example, running this gives me the same error.

RELEASE_TAG=v1.6.0 make release-notes

@@ -79,7 +81,11 @@ func (p *releaseNotesPrinter) print(entries []notesEntry) {
fmt.Printf("🚨 This is a RELEASE CANDIDATE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/%s/issues/new).\n", p.repo)
Copy link
Contributor

Choose a reason for hiding this comment

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

This could either be a release candidate or beta release. You can either change this based on how the release tag string is formatted, or just include both RELEASE CANDIDATE/BETA RELEASE and have the user manually change this.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 7, 2024
@chandankumar4 chandankumar4 force-pushed the release-notes-expander branch 2 times, most recently from a046390 to 6931f3a Compare March 7, 2024 15:43
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2024
@willie-yao
Copy link
Contributor

Looks like there are still some errors when running the release notes tool test with make test-release-notes-tool. I think it's just some minor formatting that you need to fix:

 -       <details>
        -       <summary>More details about the release</summary>
                ## 👌 Kubernetes version support
          
                ... // 188 identical lines
                - google.golang.org/grpc/cmd/protoc-gen-go-grpc: v1.1.0
          
        -       </details>
        -       <br/>

@willie-yao
Copy link
Contributor

When running this command, I noticed that This is a RELEASE CANDIDATE/BETA RELEASE. Use it only for testing purposes. If you find any bugs, file an [issue](https://github.com/kubernetes-sigs/cluster-api/issues/new). is printed at the start and right before the dropdown. I'm not sure if it's intended and it's probably worth to remove the second one!

./bin/notes --release v1.6.0-rc.1 --previous-release-version tags/v1.6.0-rc.0  --pre-release-version true > CHANGELOG/v1.6.0-rc.1.md

image

Copy link
Contributor

@willie-yao willie-yao left a comment

Choose a reason for hiding this comment

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

Thanks for making this change! I think the unit test make test-release-notes-tool is still failing.

Also one more nit: The tool should be printing this line inside the dropdown:
https://github.com/willie-yao/cluster-api/blob/main/CHANGELOG/v1.6.0-rc.1.md#L32

@chandankumar4
Copy link
Contributor Author

Thanks for making this change! I think the unit test make test-release-notes-tool is still failing.

Also one more nit: The tool should be printing this line inside the dropdown: https://github.com/willie-yao/cluster-api/blob/main/CHANGELOG/v1.6.0-rc.1.md#L32

Thanks for the review, made the required changes and fixed the test cases also

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2024
@willie-yao
Copy link
Contributor

I tried running this command ./bin/notes --release v1.6.0-rc.1 --previous-release-version tags/v1.6.0-rc.0 > CHANGELOG/v1.6.0-rc.1.md and the dropdown seems to be missing. You might need to adjust when to add the dropdown based on if the release tag is a preview version or not, now that there is no longer a --pre-release-version flag

@chandankumar4 chandankumar4 force-pushed the release-notes-expander branch 2 times, most recently from 8054541 to 3b72eb8 Compare March 28, 2024 19:04
@chandankumar4
Copy link
Contributor Author

chandankumar4 commented Mar 28, 2024

@willie-yao sorry for the confusion, It was messed up while resolving review comment as --pre-release-version flag is removed. I have fixed it now. Thanks

@willie-yao
Copy link
Contributor

No problem! Thanks for the rebase and quick fix!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 2242a031bb85b77ae23193527a6ba37449d4d124

fmt.Print(`<details>
<summary>More details about the release</summary>

:warning: **RELEASE CANDIDATE NOTES** :warning:
Copy link
Member

@tobiasgiese tobiasgiese Mar 29, 2024

Choose a reason for hiding this comment

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

Should we change here between beta and RC releases? Or is this only for RCs anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for both, thanks for pointing out, made the changes.

Comment on lines 123 to 126
var fromTag string
if previousRelease.value != "" {
fromTag = previousRelease.value
} else {
fromTag = d.fromTag
}
Copy link
Member

@tobiasgiese tobiasgiese Mar 29, 2024

Choose a reason for hiding this comment

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

only a nit, no merge blocker

Suggested change
var fromTag string
if previousRelease.value != "" {
fromTag = previousRelease.value
} else {
fromTag = d.fromTag
}
fromTag := d.fromTag
if previousRelease.value != "" {
fromTag = previousRelease.value
}

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2024
@tobiasgiese
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c34f71985015404545125917dda2370c603ed59d

@fabriziopandini
Copy link
Member

/lgtm
/approve

Let's start using this and eventually iterate while working on 1.7 pre releases

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 29, 2024
@chandankumar4
Copy link
Contributor Author

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 29, 2024
@k8s-ci-robot k8s-ci-robot merged commit e8b15a1 into kubernetes-sigs:main Mar 29, 2024
20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Mar 29, 2024
@chandankumar4 chandankumar4 deleted the release-notes-expander branch March 29, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release Issues or PRs related to releasing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add expandable auto-generated release notes for beta and RC (non-GA) releases
5 participants