-
Notifications
You must be signed in to change notification settings - Fork 710
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
Update codegen #1069
Update codegen #1069
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
Hi @ohmystack. Thanks for your PR. I'm waiting for a kubeflow 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/test-infra repository. |
@ohmystack Thanks for the PR. Please sign the CLA first. BTW, Which version of code-generator are you using? Are you using the code-generator in vendor or in your $GOPATH? |
Travis tests have failedHey @ohmystack, 1st Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go,pkg/apis/common/*/zz_generated.*.go,pkg/apis/common/*/*_generated.go"
TravisBuddy Request Identifier: be5ff870-c009-11e9-aed2-2b81c1e31580 |
/ok-to-test |
We should add the hack/verify-codegen.sh in the travis CI. Could you help do this? |
pkg/controller.v1beta2/tensorflow/controller.go:114:25:warning: error return value not checked (tfjobscheme.AddToScheme(scheme.Scheme)) (errcheck) pkg/controller.v1/tensorflow/controller.go:121::warning: Errors unhandled.,LOW,HIGH (gosec) pkg/controller.v1beta2/tensorflow/controller.go:114::warning: Errors unhandled.,LOW,HIGH (gosec) pkg/controller.v1/tensorflow/controller.go:121:25:warning: error return value not checked (tfjobscheme.AddToScheme(scheme.Scheme)) (errcheck) Some linting errors in CI. |
@googlebot I fixed it.. |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Sure. |
@gaocegege Shall we ignore these lint errors? It seems that they are not caused by this commit. We can fix them later in another commit. |
The linting errors are caused by the changes in this PR, actually. In upstream/master now, the function In your PR, the function var AddToScheme = localSchemeBuilder.AddToScheme
// AddToScheme applies all the stored functions to the scheme. A non-nil error
// indicates that one function failed and the attempt was abandoned.
func (sb *SchemeBuilder) AddToScheme(s *Scheme) error {
for _, f := range *sb {
if err := f(s); err != nil {
return err
}
}
return nil
} Now it may return an error. Thus we should handle the err. |
BTW, we cannot merge any PR with errors. The prow bot does not allow us to achieve it. |
058c9b5
to
66bb855
Compare
Travis tests have failedHey @ohmystack, 1st Buildgometalinter --config=linter_config.json --vendor ./...
goveralls -service=travis-ci -v -package ./pkg/... -ignore "pkg/client/*/*.go,pkg/client/*/*/*.go,pkg/client/*/*/*/*.go,pkg/client/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*.go,pkg/client/*/*/*/*/*/*/*.go,pkg/util/testutil/*.go,pkg/apis/tensorflow/*/zz_generated.*.go,pkg/apis/tensorflow/*/*_generated.go,pkg/apis/common/*/zz_generated.*.go,pkg/apis/common/*/*_generated.go"
TravisBuddy Request Identifier: 49acc830-c23b-11e9-849b-b30322cb9b44 |
66bb855
to
0a520cc
Compare
To fix the gometalinter error
0a520cc
to
ddf4d85
Compare
@gaocegege This time, I use a clean go workspace to install the code-generator tools from vendor and run the update-codegen.sh script. I find that the IMHO, the diff in this commit is a correct update for this part of code. |
@@ -118,7 +118,10 @@ func NewTFController( | |||
tfJobInformerFactory tfjobinformers.SharedInformerFactory, | |||
option options.ServerOption) *TFController { | |||
|
|||
tfjobscheme.AddToScheme(scheme.Scheme) | |||
err := tfjobscheme.AddToScheme(scheme.Scheme) |
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.
Yeah, I know that the code is updated by the code-generator. Then if we update it, we should add a err check to avoid undefined behaviour. Code here LGTM
/lgtm
/lgtm Thanks for your contribution! 🎉 👍 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gaocegege 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 |
* Update codegen * Handle errors of adding tfjob scheme To fix the gometalinter error (cherry picked from commit d2499dc)
The generated code is out of date.
Update by hack/update-codegen.sh script.
This change is