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

Modify API and Generate Addon API clientset/lister/informers #111

Closed
wants to merge 23 commits into from

Conversation

ccfishk
Copy link
Contributor

@ccfishk ccfishk commented Feb 20, 2022

Signed-off-by: jhu02 [email protected]

Fixes:
#97
https://github.intuit.com/kubernetes/arktika/issues/3541

  1. Use code-generator generate API(s) clientset/informer/listers and put into pkg/client directory.
  2. Add code-generator into Makefile
  3. move api/v1alpha1 to apis/addon/v1alpha1, and add "comment marker" for code generator

@ccfishk ccfishk requested a review from a team as a code owner February 20, 2022 20:47
Copy link

@figo figo left a comment

Choose a reason for hiding this comment

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

Thank you for working on this refactoring effort, Refactor is good, but would like to share a few guideline to help both reviewers and PR owners.

  1. In the PR description, document what problem the PR trying to solve (break the large PR into smaller ones, and make it incremental as much as possible), "refactoring" is the approach, but it is not a problem statement,
  2. To make sure reviewer can review the PR thoroughly, add the dependencies and steps that generate the PR into a script (in this case, kubebuilder version etc), include the script in the PR, this will make sure others can also generate the PR using the script, this apply to PR when there is generated code.
  3. (optional) walk through the PR with reviewers, and share the plan for the following PRs.

Thanks again.

@ccfishk
Copy link
Contributor Author

ccfishk commented Feb 20, 2022

Thank you for working on this refactoring effort, Refactor is good, but would like to share a few guideline to help both reviewers and PR owners.

  1. In the PR description, document what problem the PR trying to solve (break the large PR into smaller ones, and make it incremental as much as possible), "refactoring" is the approach, but it is not a problem statement,
  2. To make sure reviewer can review the PR thoroughly, add the dependencies and steps that generate the PR into a script (in this case, kubebuilder version etc), include the script in the PR, this will make sure others can also generate the PR using the script, this apply to PR when there is generated code.
  3. (optional) walk through the PR with reviewers, and share the plan for the following PRs.

Thanks again.
This comments justifying the strategy
#99 (comment)

@figo
Copy link

figo commented Feb 20, 2022

Thank you for working on this refactoring effort, Refactor is good, but would like to share a few guideline to help both reviewers and PR owners.

  1. In the PR description, document what problem the PR trying to solve (break the large PR into smaller ones, and make it incremental as much as possible), "refactoring" is the approach, but it is not a problem statement,
  2. To make sure reviewer can review the PR thoroughly, add the dependencies and steps that generate the PR into a script (in this case, kubebuilder version etc), include the script in the PR, this will make sure others can also generate the PR using the script, this apply to PR when there is generated code.
  3. (optional) walk through the PR with reviewers, and share the plan for the following PRs.

Thanks again.
This comments justifying the strategy
#99 (comment)

Yes, glad those 3 action items make sense to you, could you start to address them?

@ccfishk
Copy link
Contributor Author

ccfishk commented Feb 22, 2022

Thank you for working on this refactoring effort, Refactor is good, but would like to share a few guideline to help both reviewers and PR owners.

  1. In the PR description, document what problem the PR trying to solve (break the large PR into smaller ones, and make it incremental as much as possible), "refactoring" is the approach, but it is not a problem statement,
  2. To make sure reviewer can review the PR thoroughly, add the dependencies and steps that generate the PR into a script (in this case, kubebuilder version etc), include the script in the PR, this will make sure others can also generate the PR using the script, this apply to PR when there is generated code.
  3. (optional) walk through the PR with reviewers, and share the plan for the following PRs.

Thanks again.
This comments justifying the strategy
#99 (comment)

Yes, glad those 3 action items make sense to you, could you start to address them?

Documented the problem details in following ticket tracking all the solutions that are applied.
#99 (comment)

Makefile Outdated Show resolved Hide resolved
Signed-off-by: jhu02 <[email protected]>
jhu02 added 2 commits February 25, 2022 08:33
Signed-off-by: jhu02 <[email protected]>
Signed-off-by: jhu02 <[email protected]>
@ccfishk ccfishk changed the title Generate Addon API clientset/lister/informers Modify API and Generate Addon API clientset/lister/informers Feb 25, 2022
Dockerfile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Signed-off-by: jhu02 <[email protected]>
e2e/addon_types_test.go Outdated Show resolved Hide resolved
e2e/suite_test.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
test: generate fmt vet manifests
go test ./api/... ./controllers/... ./pkg/... ./cmd/... -coverprofile cover.out
.PHONY: test
test:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Needs the other targets also.

Suggested change
test:
test: generate fmt vet manifests

$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./api/...
generate: controller-gen code-generator
$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=./apis/addon/...
bash $(GOPATH)/src/k8s.io/[email protected]/generate-groups.sh \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's capture this code-generator call as env. var, $(CODE_GEN)

cd $$CODE_GENERATOR_DIR ;\
go get github.com/kubernetes/[email protected] ;\
}
endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
endif
else
CODE_GEN="bash $(GOPATH)/src/k8s.io/[email protected]/generate-groups.sh"
endif

@ccfishk ccfishk removed the request for review from figo February 26, 2022 00:39
@ccfishk
Copy link
Contributor Author

ccfishk commented Feb 26, 2022

per conversation, this PR is moved to #116.

@ccfishk
Copy link
Contributor Author

ccfishk commented Feb 26, 2022

close as it is.

@ccfishk ccfishk closed this Feb 26, 2022
@kevdowney kevdowney deleted the apiclient branch May 1, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants