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

✨ crd/gen: sort FindKubeKinds #679

Merged
merged 2 commits into from Jun 13, 2022
Merged

Conversation

gshirazi
Copy link
Contributor

@gshirazi gshirazi commented May 20, 2022

Fixes #675 by sorting kubeKinds in FindKubeKinds

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 20, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: gshirazi / name: Ghasem Shirazi (36518f6)

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

Welcome @gshirazi!

It looks like this is your first PR to kubernetes-sigs/controller-tools 🎉. 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/controller-tools 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 20, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @gshirazi. 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. 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 May 20, 2022
@gshirazi
Copy link
Contributor Author

@ahmetb kindly plz review

@ahmetb
Copy link
Member

ahmetb commented May 20, 2022

Seems to be working reproducibly and sorting kinds as expected. Thanks.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2022
@ahmetb
Copy link
Member

ahmetb commented May 25, 2022

needs rebase after #682 is merged.

@alvaroaleman
Copy link
Member

@gshirazi could you please add a test for this?

@alvaroaleman
Copy link
Member

/retest

@ahmetb
Copy link
Member

ahmetb commented May 26, 2022

@gshirazi could you please add a test for this?

at a high level, the Generate() function is largely untested, so I am not sure if it'll be a fair ask to add tests for this without while missing tests for the actual functionality.

but there seems to be some integration tests, so maybe it's possible to write one that captures +output:stdout case.

@alvaroaleman
Copy link
Member

By "this" I meant for this functionality. The PR is based on an older version of the master branch where I think this was deterministic regardless of the sorting and it seems it got broken in 81d0342

If we don't add a test, this will just regress again sooner or later so there is no point in fixing it.

@gshirazi
Copy link
Contributor Author

gshirazi commented Jun 6, 2022

I see,

pkg/crd/gen.go:275:20: cannot use i (variable of type int) as schema.GroupKind value in map index (typecheck)

I need to rebase this based on the latest master (map not slice). Then add some integration test.

@gshirazi
Copy link
Contributor Author

gshirazi commented Jun 6, 2022

any objections to reverting 81d0342 ?

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 6, 2022
@alvaroaleman
Copy link
Member

any objections to reverting 81d0342 ?

Yes, it was added to de-duplicate. Please just copy the map keys into a slice and sort that slice rather than reverting anything. Also, we are not going to merge anything here until there are tests.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 7, 2022
@gshirazi
Copy link
Contributor Author

gshirazi commented Jun 7, 2022

@alvaroaleman @ahmetb added tests. please review, thanks.

@gshirazi
Copy link
Contributor Author

gshirazi commented Jun 9, 2022

@alvaroaleman @ahmetb added tests. please review, thanks.

any feedback?

@ahmetb
Copy link
Member

ahmetb commented Jun 9, 2022

Sorry, I'm not very initiated in this repository. I will defer to others.

@alvaroaleman
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 Jun 10, 2022
@@ -20,6 +20,7 @@ import (
"fmt"
Copy link
Member

Choose a reason for hiding this comment

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

@gshirazi I can't comment on it, but you checked in a binary cmd/main. Please remove that, other than that the change looks good to me.
/hold

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 10, 2022
@alvaroaleman
Copy link
Member

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jun 13, 2022
@alvaroaleman
Copy link
Member

/lgtm
/approve
/hold cancel

Thanks!

@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 Jun 13, 2022
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 13, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, gshirazi

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 Jun 13, 2022
@k8s-ci-robot k8s-ci-robot merged commit 59485af into kubernetes-sigs:master Jun 13, 2022
@alvaroaleman
Copy link
Member

/cherrypick release-0.9

@k8s-infra-cherrypick-robot

@alvaroaleman: new pull request created: #694

In response to this:

/cherrypick release-0.9

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.

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

controller-gen: Deterministic ordering for CRD output manifests (output:stdout)
5 participants