Skip to content

🌱 Add unit tests for alpha/internal/update #4931

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

Merged

Conversation

cmallikarjunah
Copy link
Contributor

@cmallikarjunah cmallikarjunah commented Jul 16, 2025

Issue: 4925

Added unit tests for the following alpha internal update files:

pkg/cli/alpha/internal/update/prepare_test.go
pkg/cli/alpha/internal/update/update_test.go
pkg/cli/alpha/internal/update/validate_test.go
pkg/cli/alpha/internal/update/utils_test.go

Copy link

linux-foundation-easycla bot commented Jul 16, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: cmallikarjunah (15b7a1b)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jul 16, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @cmallikarjunah!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. 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/kubebuilder 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
Copy link
Contributor

Hi @cmallikarjunah. 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-sigs/prow 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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 16, 2025
@cmallikarjunah cmallikarjunah changed the title 🌱(cli; alpha commands): Add unit tests for alpha commands 🌱WiP (cli; alpha commands): Add unit tests for alpha commands Jul 16, 2025
@cmallikarjunah cmallikarjunah changed the title 🌱WiP (cli; alpha commands): Add unit tests for alpha commands [WiP] 🌱 (cli; alpha commands): Add unit tests for alpha commands Jul 16, 2025
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 16, 2025
@cmallikarjunah cmallikarjunah changed the title [WiP] 🌱 (cli; alpha commands): Add unit tests for alpha commands 🌱 (cli; alpha commands): Add unit tests for alpha commands Jul 18, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 18, 2025
@cmallikarjunah cmallikarjunah changed the title 🌱 (cli; alpha commands): Add unit tests for alpha commands 🌱 (cli; alpha commands): Add unit tests for alpha commands [WiP] Jul 20, 2025
@@ -75,7 +75,7 @@ func (opts *Update) defineFromVersion(config store.Store) (string, error) {

func (opts *Update) defineToVersion() string {
if len(opts.ToVersion) != 0 {
if !strings.HasPrefix(opts.FromVersion, "v") {
if !strings.HasPrefix(opts.ToVersion, "v") {
Copy link
Member

Choose a reason for hiding this comment

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

Could you please rebase with master?
So that we have no this change it is fixed and merged now 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure Camila, will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@camilamacedo86 I have rebased. But the code in master still checks prefix for opts.FromVersion in function defineToVersion(). Can you re-check and confirm if this change is not needed?

@cmallikarjunah cmallikarjunah force-pushed the issue-4925-add-UTs branch 4 times, most recently from 734cfa4 to 9612be0 Compare July 23, 2025 18:47
@cmallikarjunah cmallikarjunah changed the title 🌱 (cli; alpha commands): Add unit tests for alpha commands [WiP] [WiP]:seedling: (cli; alpha commands): Add unit tests for alpha commands Jul 24, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 24, 2025
@cmallikarjunah cmallikarjunah force-pushed the issue-4925-add-UTs branch 2 times, most recently from e83c126 to 6b552e5 Compare July 25, 2025 12:52
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Great work 🥇
To be fixed, for we can merge, I thinkit is only this one: https://github.com/kubernetes-sigs/kubebuilder/pull/4931/files#r2233127738

However, I think we need to find a better way to create those temporary directories.
However, it is for a follow-up. No worry, see: https://github.com/kubernetes-sigs/kubebuilder/pull/4931/files#r2233130602.

@cmallikarjunah cmallikarjunah changed the title 🌱 (cli; alpha commands): Add unit tests for alpha commands 🌱Add unit tests for alpha commands Jul 27, 2025
@cmallikarjunah cmallikarjunah changed the title 🌱Add unit tests for alpha commands 🌱 Add unit tests for alpha/internal/update Jul 27, 2025
@cmallikarjunah cmallikarjunah changed the title 🌱 Add unit tests for alpha/internal/update 🌱 Add unit tests for alpha/internal/update Jul 27, 2025
Add pkg/cli/alpha/internal/update/prepare_test.go

Add pkg/cli/alpha/internal/update/update_test.go

Add pkg/cli/alpha/internal/update/validate_test.go

Add pkg/cli/alpha/internal/update/utils_test.go
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm
/ok-to-test

Great work 🚀
Well done !!!

Thank you for the contribution 🥇

@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 Jul 29, 2025
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 29, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, cmallikarjunah, mayuka-c

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 merged commit c9b50e1 into kubernetes-sigs:master Jul 29, 2025
17 checks passed
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. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants