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

update: generate protobufs with tags field support and fix makefile #55

Merged
merged 2 commits into from
Sep 24, 2021

Conversation

jasondellaluce
Copy link
Contributor

What type of PR is this?

/kind bug

/kind feature

Any specific area of the project related to this PR?

/area api

/area makefile

What this PR does / why we need it:
This PR contributes with the following:

Which issue(s) this PR fixes:
Fixes #54

Does this PR introduce a user-facing change?:

update: generate protobufs with tags field support and fix makefile

jasondellaluce and others added 2 commits September 23, 2021 13:56
Signed-off-by: Jason Dellaluce <[email protected]>
Co-authored-by: Leonardo Grasso <[email protected]>
@poiana poiana added kind/bug Something isn't working release-note dco-signoff: yes kind/feature New feature or request labels Sep 23, 2021
@poiana
Copy link

poiana commented Sep 23, 2021

@jasondellaluce: The label(s) area/makefile cannot be applied, because the repository doesn't have them.

In response to this:

What type of PR is this?

/kind bug

/kind feature

Any specific area of the project related to this PR?

/area api

/area makefile

What this PR does / why we need it:
This PR contributes with the following:

Which issue(s) this PR fixes:
Fixes #54

Does this PR introduce a user-facing change?:

update: generate protobufs with tags field support and fix makefile

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.

@poiana
Copy link

poiana commented Sep 23, 2021

Welcome @jasondellaluce! It looks like this is your first PR to falcosecurity/client-go 🎉

Copy link
Member

@leodido leodido left a comment

Choose a reason for hiding this comment

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

PR changes look good to me.

The only thing I'm not getting is why the file names are different now.

Can we keep the file names of the generated *.pb.go the same as before?
Ie., pkg/api/outputs/outputs.pb.go rather than the new pkg/api/outputs/output_grpc.pb.go

@jasondellaluce
Copy link
Contributor Author

Thank you for your review!

This is caused by the changes at: https://github.com/falcosecurity/client-go/pull/55/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R35

From my understanding, it seems like the "new way" is to generate two separate files, one containing the gRPC service definitions (_grpc.pb.go) and one containing the protobuf message information (.pb.go). This is due to the fact the two files are now generated by two distinct tools, protoc-gen-go-grpc and protoc-gen-go respectively. This is documented in this release note: https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.20.0#v1.20-grpc-support

gRPC support
The v1.20 protoc-gen-go does not support generating gRPC service definitions. In the future, gRPC service generation will be supported by a new protoc-gen-go-grpc plugin provided by the Go gRPC project.
The github.com/golang/protobuf version of protoc-gen-go continues to support gRPC and will continue to do so for the foreseeable future.

This topic is also related to the error of #54, which currently breaks our make setup in newer versions of protoc.

--go_out: protoc-gen-go: plugins are not supported; use 'protoc --go-grpc_out=...' to generate gRPC

@leodido
Copy link
Member

leodido commented Sep 24, 2021

Oh, I see. They split the services out. Gotcha!

/lgtm

@poiana
Copy link

poiana commented Sep 24, 2021

LGTM label has been added.

Git tree hash: 8b1042c0f87c65ddfe847157d3023ed5329f7d13

@poiana
Copy link

poiana commented Sep 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce, leodido

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

@poiana poiana merged commit dc15fa2 into falcosecurity:master Sep 24, 2021
@jasondellaluce jasondellaluce deleted the update-protos-makefile branch September 24, 2021 08:19
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.

Make fails to build protobufs and mocks
3 participants