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

refactor(tibuild): pretty the code #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wuhuizuo
Copy link
Contributor

Signed-off-by: wuhuizuo wuhuizuo@126.com

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
Copy link

ti-chi-bot bot commented Apr 23, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from wuhuizuo, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@ti-chi-bot ti-chi-bot bot requested a review from purelind April 23, 2024 15:12
Copy link

ti-chi-bot bot commented Apr 23, 2024

I have already done a preliminary review for you, and I hope to help you do a better job.

The pull request seems to be a code refactoring that adds the github.com/deckarep/golang-set/v2 package to the go.mod file. It also renames the model.go file to types.go and updates the related imports. There are no potential problems related to these changes.

However, there are some issues with the code in dev_build_service.go that the pull request did not address. Specifically, there is an incorrect check for the edition field in the validateReq function. Instead of checking if the edition is valid against the ProductEdition type, it is checking if it is contained within a golang-set object. This could result in unexpected behavior if an invalid edition is passed in.

To fix this issue, the validateReq function should check if the edition is valid against the ProductEdition type. It could be done like this:

if !spec.Edition.IsValid() {
    return fmt.Errorf("edition is not valid")
}

In addition, since the ProductEdition type is not used in the code, it could be removed to simplify the codebase.

@ti-chi-bot ti-chi-bot bot added the size/L label Apr 23, 2024
Copy link

ti-chi-bot bot commented May 6, 2024

PR needs rebase.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant