-
Notifications
You must be signed in to change notification settings - Fork 632
Adds a clean-generated target to remove stale generated files #4082
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
Adds a clean-generated target to remove stale generated files #4082
Conversation
|
Welcome @carmal891! |
|
Hi @carmal891. 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 Once the patch is verified, the new status will be reflected by the 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. |
|
This WIP PR may require adjustments based on the discussion in #4077. Will update from draft status once the approach is finalized. |
|
/cc @candita |
| all: generate vet fmt verify test | ||
|
|
||
| .PHONY: clean-generated | ||
| clean-generated: |
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.
question for others: do we care about cleaning also "config/crd/{standard|experimental} ? Also, there is a "kustomization.yaml" file inside it, we should either re-generate it based on the CRDs we are generating.
I think we can do this as a followup, but as the generation is part of update-codegen (running pkg/generator), and probably would be good to also keep a consistency of the current API.
As an example, once we decide to promote ListenerSet, it will become a different API (ListenerSet vs XListenerSet) and a different CRD, but by the current approach the old XListenerSet CRD manifest will stick there until someone cleans 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.
We will need to leave the existing XListenerSet around for some time for backward compatibility, and we haven't actually defined how the transition out of the experimental API group will work yet - it could be that we will leave XListenerSet around to be a place to prototype new things, unsure as yet.
So, I think it's better to make cleanup for that in particular require a definite action from a person.
| clean-generated: | ||
| rm -rf pkg/client/clientset | ||
| rm -rf pkg/client/listers | ||
| rm -rf pkg/client/informers |
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 may also want to add "applyconfiguration" directory
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.
@rikatz Regarding apply configuration, I intentionally ignored the dir as I had observed a bug which I wanted to clarify. More details mentioned here :
#4077 (comment) in the Additional Finding section . Kindly help to clarify
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.
|
/ok-to-test |
4cf5125 to
817ecb6
Compare
rikatz
left a comment
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
Thank you!
|
Hi @candita, |
|
@carmal891 it needs now some project maintainer to approve it |
|
@robscott @youngnick @mlavacca This PR has received LGTM but is pending maintainer approval for merging. Could you help review the same when convenient ?. Thanks |
817ecb6 to
4b67a98
Compare
robscott
left a comment
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.
Thanks @carmal891!
|
|
||
| all: generate vet fmt verify test | ||
|
|
||
| .PHONY: clean-generated |
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 great @carmal891! This would be very helpful to include in https://gateway-api.sigs.k8s.io/contributing/devguide/ as well if you can find the time.
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.
Done
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: carmal891, rikatz, robscott 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 |
|
@carmal891 please look at Rob's comment on your code :) I was waiting you to send the update to the docs as well, to do another review Thanks! |
|
IMO it is fine, we don't have all of the Makefile targets documented. @robscott I think we are good? |
|
/lgtm |
…etes-sigs#4082) * Adds a clean-generated target to remove stale generated files * Update the docs for make generate
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes an issue where make generate doesn't properly clean up generated client files before regeneration, causing leftover files to accumulate and potentially cause linter errors. The fix adds targeted cleanup of generated client directories
before running the code generation tools.
Which issue(s) this PR fixes:
Fixes #4077
Does this PR introduce a user-facing change?: