-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 Make release notes tool not dependent on local git #9618
🌱 Make release notes tool not dependent on local git #9618
Conversation
d7b55d0
to
a3e863f
Compare
ffb51ab
to
6db511f
Compare
- CAPD: Fix fail-swap-on=false flag not being part of kind images anymore (#8767) | ||
- CAPD: Implement watch filter (#8789) | ||
- CAPD: Test/capd: fix kind mapper entry for v1.25.11 (#8914) | ||
- CAPD: Test/e2e fix fail-swap-on=false flag not being part of kind images anymore (#8767) |
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.
These the same PR. The title was changed in the PR and since now we read from the PR API and not the commits, now we output the new title. This is expected (and IMO a good change).
6db511f
to
1181097
Compare
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.
This is some great stuff! Excited to see this tool in use. Everything looks good pending a few minor comments.
|
||
// githubClient uses the gh CLI to make API request to GitHub. | ||
type githubClient struct { | ||
// repo is full [org]/[repo_name] |
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.
nit: i think this comment can be reworded. Is it the full url? I'm not entirely sure what a full [org]/[repo_name] is.
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.
example kubernetes-sigs/cluster-api
kubernetes-sigs
is the org and cluster-api
is the repo name
How would you phrase it?
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 think I'm just a bit confused by the usage of the word full
. I would maybe change it to repo in format [org]/[repo_name]
but I think it's fine the way it is. Whichever you think is better!
/lgtm |
LGTM label has been added. Git tree hash: 07b70012fa2b3e61d954fc6bb95b9f2eb6d213cf
|
/test ? |
@furkatgofurov7: The following commands are available to trigger required jobs:
The following commands are available to trigger optional jobs:
Use
In response to this:
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. |
/test pull-cluster-api-e2e-main |
@g-gaston looks like it needs a rebase, I'll take a look after it is rebased. |
maybe. At least it should make it easier to make it work if it doesn't on its current state Edit: I just checked. This PR doesn't fix the issue but it's actually easy to fix on top of the new code. I just need to add a second regex condition here. If you give me a review, I'll add it as a bonus 🤝 |
2d55fca
to
3bc3415
Compare
82b8e95
to
ee8d6b1
Compare
ee8d6b1
to
4b3c154
Compare
/test pull-cluster-api-test-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.
/lgtm
LGTM label has been added. Git tree hash: f6c03a1cabe5b95c7a56b45f69c40199d714fab7
|
@g-gaston Thank you, looks good! Really appreciate the improvements made to the tool in this PR (and over the last few months)!! Happy to approve after a rebase for the go.mod conflicts. |
Now all the date is retrieved through GitHub APIs, making the tool more portable and easier to use. It should not increase the rate limiting chances since it now performs less API requests (by getting the label from all PRs at once instead of with one request per PR).
4b3c154
to
4452c01
Compare
Done! |
/lgtm |
LGTM label has been added. Git tree hash: a99197f0c1e71088190393ac70b9ce8a71048afb
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
@g-gaston Could it be that we have to update release-tasks.md? As far as I can tell the current instructions don't work anymore without modifications |
} | ||
// computeConfigDefaults calculates the value the non specified configuration fields | ||
// based on the set fields. | ||
func computeConfigDefaults(config *notesCmdConfig) error { |
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 tried to run this tool for CR with the following args:
-from tags/v0.16.0 -branch main -release v0.17.0 -repository kubernetes-sigs/controller-runtime -prefix-area-label=false -add-kubernetes-version-support=false
This func returns in l.158. Then l.182 is never executed and it eventually panics in parseRef
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
main.parseRef({0x0, 0x0})
/Users/buringerst/code/src/sigs.k8s.io/cluster-api/hack/tools/release/notes/ref.go:43 +0xbc
main.(*notesCmd).run(0x1400004e050)
/Users/buringerst/code/src/sigs.k8s.io/cluster-api/hack/tools/release/notes/main.go:101 +0x124
main.main()
/Users/buringerst/code/src/sigs.k8s.io/cluster-api/hack/tools/release/notes/main.go:41 +0x28
Exiting.
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.
If I see correctly we should also check for toRef != "" or maybe drop the if (not sure)
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.
Otherwise it works great!
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 are 100% right
I'll get it fixed
That said, you don't need to specify -from
in this case. Specifying -release
is enough for the program to infer the rest. You do need to specify the branch bc it seems like in controller-runtime
minor releases are cut directly from main
. That would work even without the fix.
./bin/notes --branch main --release v0.17.0 --repository kubernetes-sigs/controller-runtime --prefix-area-label=false --add-kubernetes-version-support=false
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.
Thx, yup sounds reasonable. I just started with adding --from without thinking much about it and then I added what was needed :)
But you're right leaving --from empty works to skip the if branch in l.157
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.
Thx again for that!! |
What this PR does / why we need it:
Now all the data is retrieved through GitHub APIs, making the tool more portable and easier to use. It should not increase the rate limiting chances since it now performs less API requests (by getting the label from all PRs at once instead of with one request per PR).
This tool had also outgrown its previous code structure, which made a bit difficult to made these changes and think about how the overall program works. So I went a bit overboard with the original purpose and refactor the code a bit. Mostly splitting it into different files and adding some comments here and there. the new structure should make easier to reuse piece of the code from other release team tools and compose the different pieces to do similar but different tasks (like the weekly update).
I also have simplified the command flags for the tool, since the comms team doesn't need most of them and they needed to be re-implemented with this new "API approach" if we wanted to keep supporting them. We can implement support and re-add them if the need for them comes back in the future.
The new UI is:
For new releases, it's possible to just specify the tag of the new (to be released) release and the program will compute the rest of the values. This also opens the door in the future to alter the behavior depending on if it's a RC/beta release (instead of having individual flags).
./bin/notes --release=v1.6.0 > CHANGELOG/v1.6.0.md
Apologies in advance for the big diff.
I want to merge #9617 first so we can look at the output changes.
/area release
cc @kubernetes-sigs/cluster-api-release-team