Skip to content

Add Protobuf generation to the codegen utility #1385

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

JoelSpeed
Copy link
Contributor

This PR adds protobuf as a generator to the codegen generator utility.
The upstream generator unfortunately encodes a lot of logic within the cmd so the Run which we are using uses log.Fatal a lot when there are errors to return. For now, rather than duplicating the huge run fuction, I think we can work around that.

I've set it up so that the protobuf generator is opt-in (which is different to our other generators) and that it will error if the dependent binaries are missing, but you can make that just a warning with PROTO_OPTIONAL=1 as you could before, and it will print this in the error messages.

One thing that's new here, is the ability to disable a specific version of the API from generation, this is needed because the image group has proto generation on some versions, but not others. We may want to include this in other generators later but for now, it seems only to be needed on this generator.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 13, 2023

Hello @JoelSpeed! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

For merging purposes, this repository follows the no-Feature-Freeze process which means that in addition to the standard lgtm and approved labels this repository requires either:

bugzilla/valid-bug - applied if your PR references a valid bugzilla bug

OR

qe-approved, docs-approved, and px-approved - these labels can be applied by anyone in the openshift org via the /label <labelname> command.

Who should apply these qe/docs/px labels?

  • For a no-Feature-Freeze team who is merging a feature before code freeze, they need to get those labels applied to their api repo PR by the appropriate teams (i.e. qe, docs, px)
  • For a Feature Freeze (traditional) team who is merging a feature before FF, they can self-apply the labels (via /label commands), they are basically irrelevant for those teams
  • For a Feature Freeze team who is merging a feature after FF, the PR should be rejected barring an exception

@openshift-ci openshift-ci bot requested review from bparees and danwinship January 13, 2023 17:36
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 13, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2023
Copy link
Contributor

@elmiko elmiko left a comment

Choose a reason for hiding this comment

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

code generally looks good to me, although i admit i'm not an expert on the go/protobuf tooling. i like all the comments, thanks for adding those.

i tried testing this by running make update-codegen from the root of a clean project, but i get this error

topological order github.com/openshift/api/apps/v1
2023/01/13 14:37:23 /home/mike/dev/openshift-api/github.com/openshift/api/apps/v1/generated.proto: Input is shadowed in the --proto_path by "github.com/openshift/api/apps/v1/generated.proto".  Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.
2023/01/13 14:37:23 protoc -I . -I /home/mike/dev/openshift-api -I /home/mike/dev/openshift-api/vendor --gogo_out=/home/mike/dev/openshift-api /home/mike/dev/openshift-api/github.com/openshift/api/apps/v1/generated.proto
2023/01/13 14:37:23 Unable to generate protoc on github.com.openshift.api.apps.v1: exit status 1

did i do something wrong?

@JoelSpeed
Copy link
Contributor Author

Interesting error! I don't think you did something wrong, but, are you using GOPATH? I believe that the generator doesn't currently work if you aren't in the standard GOPATH structure

@elmiko
Copy link
Contributor

elmiko commented Jan 16, 2023

i notice my GOPATH is not set, so i set it and tried again but i get the same error:

topological order github.com/openshift/api/apps/v1
2023/01/16 12:42:53 /home/mike/dev/openshift-api/github.com/openshift/api/apps/v1/generated.proto: Input is shadowed in the --proto_path by "github.com/openshift/api/apps/v1/generated.proto".  Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.
2023/01/16 12:42:53 protoc -I . -I /home/mike/dev/openshift-api -I /home/mike/dev/openshift-api/vendor --gogo_out=/home/mike/dev/openshift-api /home/mike/dev/openshift-api/github.com/openshift/api/apps/v1/generated.proto
2023/01/16 12:42:53 Unable to generate protoc on github.com.openshift.api.apps.v1: exit status 1
make: *** [Makefile:90: update-protobuf] Error 1

@JoelSpeed
Copy link
Contributor Author

/home/mike/dev/openshift-api/github.com/openshift/api/apps/v1

This isn't the right GOPATH structure expected by the tooling, you need $GOPATH/src/github/openshift/api as the path for the API checkout, can you try moving it here?

@elmiko
Copy link
Contributor

elmiko commented Jan 19, 2023

i can try moving the openshift/api directory into my gopath, but i usually work on stuff outside the gopath. fwiw, my go path is like $HOME/go.

@elmiko
Copy link
Contributor

elmiko commented Jan 19, 2023

running from within the gopath did work

@JoelSpeed
Copy link
Contributor Author

running from within the gopath did work

Unfortunately, I know the protobuf generators aren't currently working outside of GOPATH, so I guess I could add a check in that warns about this 🤔 If you have it set up as expected, great, if you don't it causes errors as you've seen. Some of our other generators have a fix in for this but I'm waiting on upstream approval to fix the protobuf generator

@elmiko
Copy link
Contributor

elmiko commented Jan 20, 2023

if the check isn't too annoying to write i'd say sure, otherwise i think it would be fine to just print a warning message when that command starts. then at least i know what i did wrong.

@openshift-ci openshift-ci bot removed the request for review from danwinship January 21, 2023 19:17
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 22, 2023
@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 22, 2023
@JoelSpeed
Copy link
Contributor Author

/lifecycle frozen

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 2, 2023

@JoelSpeed: The lifecycle/frozen label cannot be applied to Pull Requests.

In response to this:

/lifecycle frozen

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.

@JoelSpeed
Copy link
Contributor Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 2, 2023
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 1, 2023
@JoelSpeed
Copy link
Contributor Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 7, 2023
@JoelSpeed JoelSpeed force-pushed the codegen-go-to-protobuf branch from 7987e3e to 4894dd2 Compare August 11, 2023 13:50
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 11, 2023
@openshift-ci openshift-ci bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Aug 11, 2023
@JoelSpeed
Copy link
Contributor Author

@elmiko I've rebased this now and added two further commits, one updates the dependencies for the tools module, the second adds TrimPathPrefix as a config for the go-to-protobuf generator. Just tested, and it now works with GOPATH= at the beginning, so I reckon we don't need those warnings anymore

@elmiko
Copy link
Contributor

elmiko commented Aug 11, 2023

i tried this out on my local machine, outside of the GOPATH, by running make update-protobuf but i get an error, did i mess something up?

$ make update-protobuf
hack/update-protobuf.sh
make[1]: Entering directory '/home/mike/dev/openshift-api/tools'
Tools vendor version mismatch, removing old utils
Writing tools vendor version e633c236d76c2053897f2bc7a16abc47986cd2f0
go build -mod=vendor -o /home/mike/dev/openshift-api/tools/_output/bin/linux/amd64/protoc-gen-gogo ./vendor/k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo
make[1]: Leaving directory '/home/mike/dev/openshift-api/tools'
make[1]: Entering directory '/home/mike/dev/openshift-api/tools'
Building codegen version 4894dd2bb191564ce2c1cb52d3132f4ae8a7365b
make[1]: Leaving directory '/home/mike/dev/openshift-api/tools'
I0811 11:26:24.894736  154102 root.go:80] Running generators for 
I0811 11:26:24.894781  154102 root.go:80] Running generators for apiserver.openshift.io
I0811 11:26:24.894787  154102 root.go:80] Running generators for apps.openshift.io
I0811 11:26:24.894843  154102 generator.go:113] Generating protobuf functions for for apps.openshift.io/v1
2023/08/11 11:26:26 protoc -I . -I /home/mike/dev/openshift-api -I /home/mike/dev/openshift-api/vendor --gogo_out=/home/mike/dev/openshift-api /home/mike/dev/openshift-api/github.com/openshift/api/apps/v1/generated.proto
2023/08/11 11:26:26 /home/mike/dev/openshift-api/github.com/openshift/api/apps/v1/generated.proto: Input is shadowed in the --proto_path by "github.com/openshift/api/apps/v1/generated.proto".  Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.

2023/08/11 11:26:26 Unable to generate protoc on github.com.openshift.api.apps.v1: exit status 1
make: *** [Makefile:91: update-protobuf] Error 1

it also appears to drop a github.com directory in my top-level repository directory.

@JoelSpeed JoelSpeed force-pushed the codegen-go-to-protobuf branch from 01f6f59 to e0ebc62 Compare August 11, 2023 16:44
@JoelSpeed
Copy link
Contributor Author

/test all

@elmiko
Copy link
Contributor

elmiko commented Aug 14, 2023

i saw you made an update here and gave it another run locally, different error this time:

$ make update-protobuf
hack/update-protobuf.sh
make[1]: Entering directory '/home/mike/dev/openshift-api/tools'
make[1]: Leaving directory '/home/mike/dev/openshift-api/tools'
make[1]: Entering directory '/home/mike/dev/openshift-api/tools'
make[1]: Leaving directory '/home/mike/dev/openshift-api/tools'
I0814 15:22:31.681216  636451 root.go:80] Running generators for 
I0814 15:22:31.681246  636451 root.go:80] Running generators for apiserver.openshift.io
I0814 15:22:31.681249  636451 root.go:80] Running generators for apps.openshift.io
I0814 15:22:31.681291  636451 generator.go:113] Generating protobuf functions for for apps.openshift.io/v1
2023/08/14 15:22:33 protoc -I . -I /home/mike/dev/openshift-api -I /home/mike/dev/openshift-api/vendor --gogo_out=/home/mike/dev/openshift-api apps/v1/generated.proto
2023/08/14 15:22:33 google/protobuf/descriptor.proto: File not found.
github.com/gogo/protobuf/gogoproto/gogo.proto:32:1: Import "google/protobuf/descriptor.proto" was not found or had errors.
github.com/gogo/protobuf/gogoproto/gogo.proto:38:8: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.EnumOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:46:8: "google.protobuf.EnumValueOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:50:8: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FileOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:92:8: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.MessageOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto:129:8: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
github.com/gogo/protobuf/gogoproto/gogo.proto: "google.protobuf.FieldOptions" is not defined.
apps/v1/generated.proto:8:1: Import "github.com/gogo/protobuf/gogoproto/gogo.proto" was not found or had errors.

2023/08/14 15:22:33 Unable to generate protoc on github.com.openshift.api.apps.v1: exit status 1
make: *** [Makefile:91: update-protobuf] Error 1

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 31, 2023
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 18, 2024
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 11, 2024
@JoelSpeed
Copy link
Contributor Author

/remove-lifecycle rotten

@openshift-ci openshift-ci bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 12, 2024
@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 14, 2024
@JoelSpeed
Copy link
Contributor Author

/remove-lifecycle stale

@openshift-ci openshift-ci bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 14, 2024
@JoelSpeed JoelSpeed force-pushed the codegen-go-to-protobuf branch from e0ebc62 to af86c36 Compare March 26, 2025 17:24
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 26, 2025
@JoelSpeed JoelSpeed force-pushed the codegen-go-to-protobuf branch from af86c36 to c4f5259 Compare March 27, 2025 09:37
@JoelSpeed JoelSpeed force-pushed the codegen-go-to-protobuf branch from c4f5259 to fff23c1 Compare March 27, 2025 12:16
Copy link
Contributor

openshift-ci bot commented Apr 11, 2025

@JoelSpeed: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-upgrade-minor e0ebc62 link true /test e2e-upgrade-minor
ci/prow/e2e-aws-serial e0ebc62 link true /test e2e-aws-serial
ci/prow/e2e-aws-ovn-techpreview e0ebc62 link true /test e2e-aws-ovn-techpreview
ci/prow/e2e-aws-ovn-hypershift e0ebc62 link true /test e2e-aws-ovn-hypershift
ci/prow/e2e-upgrade e0ebc62 link true /test e2e-upgrade
ci/prow/e2e-aws-serial-techpreview e0ebc62 link true /test e2e-aws-serial-techpreview
ci/prow/e2e-aws-ovn e0ebc62 link true /test e2e-aws-ovn
ci/prow/minor-e2e-upgrade-minor e0ebc62 link true /test minor-e2e-upgrade-minor
ci/prow/verify fff23c1 link true /test verify
ci/prow/verify fff23c1 link true /test verify
ci/prow/verify-client-go fff23c1 link true /test verify-client-go

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.


// Options contains the configuration required for the protobuf generator.
type Options struct {
// Disabled indicates whether the deepcopy generator is enabled or not.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Disabled indicates whether the deepcopy generator is enabled or not.
// Disabled indicates whether the protobuf generator is enabled or not.

Comment on lines +45 to +48
if os.Getenv("PROTO_OPTIONAL") != "" {
klog.Warningf("Skipping protobuf generation: %v", err)
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we do this at the beginning of this function? That way if PROTO_OPTIONAL is set we just don't do anything?

In the current state setting PROTO_OPTIONAL only skips generation if checking binaries returns an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the binaries are present, then PROTO_OPTIONAL shouldn't have an effect IMO. The PROTO_OPTIONAL was always a get out of jail free when folks didn't have the correct binaries. It has the side effect of skipping all protobuf generation, but the correct way to skip all protobuf generation would be to not run this generator. If the variable were SKIP_PROTO then I think it would make more sense.

This is a change of behaviour though, so maybe someone is relying on skipping the protobuf even when they do have the correct binaries 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed sync, need to account for GOPATH and, if not in GOPATH, also skip. Should move proto optional to skip everything even if you have the binaries

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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants