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

🐛 Fix wrong branch name display for weekly update script #9918

Merged

Conversation

chandankumar4
Copy link
Contributor

What this PR does / why we need it:
Fix the branch name display issue after running the command make release-weekly-update-tool from branch other than main.

Example: Output of command after bug fix!!

$:: github.com/sigs.k8s.io/cluster-api ‹release-1.6*› » ./bin/weekly --from 2023-12-11 --to 2023-12-17 --milestone v1.7
Weekly update :rotating_light:
Changes from 2023-12-11 to 2023-12-17 a total of 7 new commits where merged into release-1.6.

- 1 :sparkles: New Features
         - KCP: Allow mutation of all fields that should be mutable (#9885)

- 4 :bug: Bug Fixes
         - capd: fix ignition to also set the kube-proxy configuration to skip setting sysctls (#9895)
         - Improve log k/v pairs and a improve/drop a few log lines (#9880)
         - ipam: fix webhooks using mixed api versions (#9863)
         - clusterctl: validate no objects exist from CRDs before deleting them (#9834)

- 2 Other changes :seedling:

All merged PRs can be viewed in GitHub:
https://github.com/kubernetes-sigs/cluster-api/pulls?q=is%3Apr+closed%3A2023-12-11..2023-12-18+is%3Amerged+milestone%3Av1.7+

_Thanks to all our contributors!_ 😊
/Your friendly comms release team

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 # N/A

/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 Dec 22, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @chandankumar4!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Dec 22, 2023
@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.

@mcbenjemaa
Copy link
Member

/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 Dec 22, 2023
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.

Looks good pending one minor comment. Thanks for working on this!

hack/tools/release/weekly/main.go Outdated Show resolved Hide resolved
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.

/lgtm

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

LGTM label has been added.

Git tree hash: 3c4984f75560f25a0bbc453132d682e7dbfe66ad

@chandankumar4
Copy link
Contributor Author

chandankumar4 commented Jan 3, 2024

Hey @mcbenjemaa @willie-yao if you get time, can you please take a look once, Is there any more update I need to do in this PR?

@willie-yao
Copy link
Contributor

This looks good to me. Just waiting on an approver to take a look. cc @sbueringer

@sbueringer
Copy link
Member

/assign @cahillsf @g-gaston

// fetch the current branch
out, err = exec.Command("git", "rev-parse", "--abbrev-ref", "HEAD").CombinedOutput()
if err != nil {
fmt.Println("Error")
Copy link
Member

Choose a reason for hiding this comment

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

this is a bit confusing, i think we can consolidate the "Error" string to print in the same line as err

Copy link
Contributor Author

@chandankumar4 chandankumar4 Jan 9, 2024

Choose a reason for hiding this comment

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

I have followed the same pattern which is there in line no: 105 after executing any command. Do I need to update in all places?

Copy link
Member

Choose a reason for hiding this comment

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

ah cool, if this is a pattern that works for the comms team it works for me 👍

if err != nil {
fmt.Println("Error")
fmt.Println(err)
fmt.Println(string(out))
Copy link
Member

Choose a reason for hiding this comment

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

is this a debug print statement? if there is an error in attempting to assign the value and we are about to return 1, why print this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Similar comment as above.

@cahillsf
Copy link
Member

cahillsf commented Jan 9, 2024

question on your example output, is it expected to have the milestone minor version differ from the branch minor version?
$:: github.com/sigs.k8s.io/cluster-api ‹release-1.6*› » ./bin/weekly --from 2023-12-11 --to 2023-12-17 --milestone v1.7

the corresponding docs don't really specify:

#### Generate weekly PR updates to post in Slack

@chandankumar4
Copy link
Contributor Author

chandankumar4 commented Jan 12, 2024

from the branch minor version

@cahillsf
Yes, that's the expected behaviour, the use of milestone minor version is for targeting against which version the notes should be generated and branch minor version is indicating that from which branch notes is generated.
cc @willie-yao

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jan 12, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 12, 2024
@cahillsf
Copy link
Member

from the branch minor version

@cahillsf Yes, that's the expected behaviour, the use of milestone minor version is for targeting against which version the notes should be generated and branch minor version is indicating that from which branch notes is generated. cc @willie-yao

hm, that seems at odds with the most recent update provided in the CAPI channel: https://kubernetes.slack.com/archives/C8TSNPY4T/p1704956238693459?thread_ts=1704956148.936569&cid=C8TSNPY4T

the current branch and the milestone are the same:

Changes from 2024-01-01 to 2024-01-07 a total of 1 new commits where merged into release-1.5.
1 Other changes 🌱
All merged PRs can be viewed in GitHub:
https://github.com/kubernetes-sigs/cluster-api/pulls?q=is%3Apr+closed%3A2024-01-01..2024-01-08+is%3Amerged+milestone%3Arelease-1.5+

@chandankumar4
Copy link
Contributor Author

@cahillsf In this link: https://kubernetes.slack.com/archives/C8TSNPY4T/p1704956238693459?thread_ts=1704956148.936569&cid=C8TSNPY4T milestone is v1.7 and current branch is release-1.5

@cahillsf
Copy link
Member

cahillsf commented Jan 15, 2024

@cahillsf In this link: https://kubernetes.slack.com/archives/C8TSNPY4T/p1704956238693459?thread_ts=1704956148.936569&cid=C8TSNPY4T milestone is v1.7 and current branch is release-1.5

followed up in that thread, but those links were actually not correct. this is actually not related to your pull request, but i believe the docs need to be updated (or the behavior of the tool needs to be improved). here is the link in your example: https://github.com/kubernetes-sigs/cluster-api/pulls?q=is%3Apr+closed%3A2023-12-11..2023-12-18+is%3Amerged+milestone%3Av1.7+

you will see that the commits shown do not correspond to what the generated output message says, , i will open a separate issue regarding the links/doc


thanks for working on this improvement. lgtm pending squashed commits

@cahillsf
Copy link
Member

/lgtm
/approve
/hold (feel free to unhold, not sure if you want more reviews)

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jan 16, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1c268924b488bac0ce57288505e0c8ce421c0053

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cahillsf

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 Jan 16, 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 Jan 16, 2024
@chandankumar4
Copy link
Contributor Author

Have checked with @willie-yao and he is good with this change!!

@k8s-ci-robot k8s-ci-robot merged commit 4216a96 into kubernetes-sigs:main Jan 16, 2024
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.7 milestone Jan 16, 2024
@chandankumar4 chandankumar4 deleted the fix-weekly-update-branch branch January 16, 2024 17:44
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants