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

Release notes tool generates duplicate release notes #10492

Open
sbueringer opened this issue Apr 23, 2024 · 12 comments
Open

Release notes tool generates duplicate release notes #10492

sbueringer opened this issue Apr 23, 2024 · 12 comments
Labels
area/release Issues or PRs related to releasing kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@sbueringer
Copy link
Member

sbueringer commented Apr 23, 2024

Hey folks,
I was trying to use the release-notes tool to generate release notes for CR. I hit two issues:

  1. It was necessary to specifcy branch because we don't create release branches before the release in CR. Is this actually necessary? Could we e.g. maybe fallback if the branch doesn't exist? What was the difference again between calculating the diff based on a release branch or main?

  2. It generates duplicate notes

 $CAPI_HOME/bin/notes --release v0.18.0 --branch=main --previous-release-version=tags/v0.17.0 --repository kubernetes-sigs/controller-runtime --prefix-area-label=false --deprecation=false --add-kubernetes-version-support=false > release-notes.md
2024/04/23 13:58:11 Computing diff between v0.17.0 and heads/main
2024/04/23 13:58:11 Calling endpoint repos/kubernetes-sigs/controller-runtime/compare/v0.17.0...main?per_page=250&page=1&
2024/04/23 13:58:12 Total of 1 pages and 133 elements read
2024/04/23 13:58:12 Reading ref heads/main for upper limit
2024/04/23 13:58:12 Reading commit b74908fd50f01704785762e94e79484d35ef6814 for upper limit
2024/04/23 13:58:12 Listing PRs from 2024-01-16 07:21:39 +0000 UTC to 2024-04-23 09:29:40 +0000 UTC
2024/04/23 13:58:12 Calling endpoint search/issues?per_page=100&page=1&q=repo:kubernetes-sigs/controller-runtime+is:pr+is:merged+merged:2024-01-16T07:21:39Z..2024-04-23T09:29:40Z+base:main+base:main
2024/04/23 13:58:14 Total of 1 pages and 64 elements read
2024/04/23 13:58:14 Found 64 PRs in github
2024/04/23 13:58:14 63 PRs match the commits from the git diff
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump actions/upload-artifact from 4.3.1 to 4.3.3 (#2794)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump actions/checkout from 4.1.2 to 4.1.3 (#2793)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump golang.org/x/sys from 0.18.0 to 0.19.0 (#2763)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/onsi/ginkgo/v2 from 2.17.0 to 2.17.1 (#2731)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/onsi/gomega from 1.31.1 to 1.32.0 (#2718)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/onsi/ginkgo/v2 from 2.16.0 to 2.17.0 (#2716)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/onsi/ginkgo/v2 from 2.15.0 to 2.16.0 (#2704)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump golang.org/x/sys from 0.17.0 to 0.18.0 (#2700)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 (#2699)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump go.uber.org/zap from 1.26.0 to 1.27.0 (#2696)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0 (#2691)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump golangci/golangci-lint-action from 3 to 4 (#2683)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump golang.org/x/sys from 0.16.0 to 0.17.0 (#2682)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump EndBug/add-and-commit from 9.1.3 to 9.1.4 (#2667)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/evanphx/json-patch/v5 from 5.8.1 to 5.9.0 (#2666)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump k8s.io/klog/v2 from 2.120.0 to 2.120.1 (#2661)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/evanphx/json-patch/v5 from 5.8.0 to 5.8.1 (#2658)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump github.com/onsi/gomega from 1.30.0 to 1.31.1 (#2657)]
2024/04/23 13:58:14 Ignoring PR [:seedling: Bump k8s.io/klog/v2 from 2.110.1 to 2.120.0 (#2653)]
INFO[0003] Setting up repository github.com/kubernetes-sigs/controller-runtime
INFO[0003] Retrieving modules of v0.17.0
INFO[0004] Retrieving modules of main
INFO[0015] 173 modules found
INFO[0015] 4 modules added
INFO[0015] 28 modules changed
INFO[0015] 3 modules removed
2024/04/23 13:58:26 Computing diff between tags/v0.17.0 and heads/main
2024/04/23 13:58:26 Calling endpoint repos/kubernetes-sigs/controller-runtime/compare/v0.17.0...main?per_page=250&page=1&
2024/04/23 13:58:27 Total of 1 pages and 133 elements read
2024/04/23 13:58:27 Reading ref heads/main for upper limit
2024/04/23 13:58:28 Reading commit b74908fd50f01704785762e94e79484d35ef6814 for upper limit
2024/04/23 13:58:28 Listing PRs from 2024-01-16 07:21:39 +0000 UTC to 2024-04-23 09:29:40 +0000 UTC
2024/04/23 13:58:28 Calling endpoint search/issues?per_page=100&page=1&q=repo:kubernetes-sigs/controller-runtime+is:pr+is:merged+merged:2024-01-16T07:21:39Z..2024-04-23T09:29:40Z+base:main+base:main
2024/04/23 13:58:29 Total of 1 pages and 64 elements read
2024/04/23 13:58:29 Found 64 PRs in github
2024/04/23 13:58:29 63 PRs match the commits from the git diff
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump actions/upload-artifact from 4.3.1 to 4.3.3 (#2794)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump actions/checkout from 4.1.2 to 4.1.3 (#2793)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump golang.org/x/sys from 0.18.0 to 0.19.0 (#2763)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/onsi/ginkgo/v2 from 2.17.0 to 2.17.1 (#2731)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/onsi/gomega from 1.31.1 to 1.32.0 (#2718)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/onsi/ginkgo/v2 from 2.16.0 to 2.17.0 (#2716)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/onsi/ginkgo/v2 from 2.15.0 to 2.16.0 (#2704)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump golang.org/x/sys from 0.17.0 to 0.18.0 (#2700)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 (#2699)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump go.uber.org/zap from 1.26.0 to 1.27.0 (#2696)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/prometheus/client_model from 0.5.0 to 0.6.0 (#2691)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump golangci/golangci-lint-action from 3 to 4 (#2683)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump golang.org/x/sys from 0.16.0 to 0.17.0 (#2682)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump EndBug/add-and-commit from 9.1.3 to 9.1.4 (#2667)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/evanphx/json-patch/v5 from 5.8.1 to 5.9.0 (#2666)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump k8s.io/klog/v2 from 2.120.0 to 2.120.1 (#2661)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/evanphx/json-patch/v5 from 5.8.0 to 5.8.1 (#2658)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump github.com/onsi/gomega from 1.30.0 to 1.31.1 (#2657)]
2024/04/23 13:58:29 Ignoring PR [:seedling: Bump k8s.io/klog/v2 from 2.110.1 to 2.120.0 (#2653)]
INFO[0018] Setting up repository github.com/kubernetes-sigs/controller-runtime
INFO[0018] Retrieving modules of v0.17.0
INFO[0019] Retrieving modules of main
INFO[0025] 173 modules found
INFO[0025] 4 modules added
INFO[0025] 28 modules changed
@sbueringer sbueringer added the kind/bug Categorizes issue or PR as related to a bug. label Apr 23, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 23, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

CAPI contributors will take a look as soon as possible, apply one of the triage/* labels and provide further guidance.

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.

@sbueringer sbueringer added area/release Issues or PRs related to releasing and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 23, 2024
@sbueringer
Copy link
Member Author

cc @g-gaston In case you have some context :)

@fabriziopandini
Copy link
Member

/priority important-soon

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Apr 23, 2024
@g-gaston
Copy link
Contributor

@sbueringer how many PR entries you get in the markdown output?

@chrischdi
Copy link
Member

Dropping the --previous-release-version flag prevents the duplicated output. However, maybe the tool could auto-detect if both would be the same.

@sbueringer
Copy link
Member Author

Sorry should have attached this. Too much :)

release-notes.md

@g-gaston
Copy link
Contributor

g-gaston commented May 17, 2024

hey yall sorry it took me a bit
Looking at the code, I believe this duplication is related to the new functionality added to print notes for pre-releases: #10091

Although I understand how the notes should look for pre-releases (and it's true that two sets of notes need to be generated), I do lack context about this feature and new code. I'm not sure what --previous-release-version is for.

Maybe @chandankumar4 or @kubernetes-sigs/cluster-api-release-team may know something?

@willie-yao
Copy link
Contributor

Hmm that's weird, it definitely is related to #10091 where it prints the changes from the previous release version if it's a beta or rc release, then prints the changes since the last minor release in a dropdown. --previous-release-version is for the first part of the notes to print the changes since the last beta or rc release.

In your case, --previous-release-version is not needed since it's not a beta or rc release. This should probably be specified in the description for the flag.

@willie-yao
Copy link
Contributor

#10324 added logic to detect the release type: https://github.com/kubernetes-sigs/cluster-api/pull/10324/files#diff-42e246c09fe01942779ff9af547e932b606a68a6f692fe137b254e4a9a10da78R104

Maybe we can prevent --previous-release-version to be set if the release type is not beta or rc to prevent confusion.

@sbueringer
Copy link
Member Author

sbueringer commented May 23, 2024

Ah okay. Seems to work when I just don't specificy --previous-release-version.

In the case I hit above it didn't add any details tag, it just ~ printed the entire release notes twice

Ah, seems like that's because the release type is an empty string in my case.

Maybe we can prevent --previous-release-version to be set if the release type is not beta or rc to prevent confusion.

I guess that makes sense

I wonder why we only add details tags if previousRelease is also empty?

if p.releaseType != "" && previousReleaseRef.value == "" {

Maybe that flags is defined in a weird way to be honest. The flag seem to indirectly influence behavior based on the cases when we use the flag? Or maybe I"m just missing why details are only added if previous release is not set

@willie-yao
Copy link
Contributor

I'm not sure how the check works, it may have been added because of this comment about the e2e test: #10091 (comment)

cc @chandankumar4 the current comms lead. I think there can be an improvement task for the comms team for simplifying the logic of --previous-release-version or finding a way to automatically detect it based on the beta/rc version. wdyt?

@chandankumar4
Copy link
Contributor

Yeah, I agree!! I’ll open up an issue for simplifying the logic of “previous-release-version”.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/release Issues or PRs related to releasing kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

7 participants