-
Notifications
You must be signed in to change notification settings - Fork 73
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
Use buf.build to generate go from proto #73
Conversation
.github/workflows/buf-push.yaml
Outdated
- uses: bufbuild/buf-push-action@v1 | ||
with: | ||
buf_token: ${{ secrets.BUF_TOKEN }} |
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.
This is to publish proto as buf.build/cncf/xds
in buf.build registry
@phlax , what do you think about this ? |
i think its generally a good idea - i tried to introduce buf to this repo previously (#47) altho in that case just for linting having said that i think it should be using bazel to install/run/build buf - my pr above covers at least the install part - i would be happy to help setting up a build target |
Can you contribute to my PR or shall include your modifications myself ? |
lets get a general nod from repo maintainers before proceeding - i think the next step would be to land the buf/bazel installation, and then figure it out from there |
I don't know much about buf, but if the idea is to use that instead of protobuf to generate the go protos, we would need to make sure that the resulting generated code is compatible with protobuf, since there are existing go data planes using these protos with protobuf. @dfawley can speak to this w.r.t. grpc-go. @howardjohn may also want to weigh in from the Istio side. |
We use buf in Istio. I think its a great tool, especially if not using bazel (but may still be useful without bazel, I just haven't done the mix of the two; the alternative is a mess of makefiles generally). Its sort of like a build tool specific for proto, it is still invoking the same proto plugin binaries so the generation should be identical; this PR shows more changes since its also changing the versions of those binaries, but in general it should only change the comment (where it says which version of protoc was used for generation). |
Makes sense to me, will defer to Go folks. |
Hi @htuch , By the way, following your comment
I tried to align the used version with the actually used for the generation but it seems like protoc-gen-validate was not in v1.0.2 as gomod says it |
@mmorel-35 busy with other things atm - ill separate out the bazel/buf install into its own PR later or over w/end |
@phlax ,
It was more in the sense that, there is nothing blocking you on there point of view. Like if they are not interested there is no point to start working on it. Once this is not a blocker for them, you can start if and when ever you want. Sorry if this was misleading.
I totally agree |
Signed-off-by: Matthieu MOREL <[email protected]>
sha256 = "27b3202ba6e9eb37dca0f902c8f96b6330670b33d8669ad739f60ab61bdaf296", | ||
strip_prefix = "protoc-gen-validate-1.0.2", | ||
urls = ["https://github.com/envoyproxy/protoc-gen-validate/archive/refs/tags/v1.0.2.tar.gz"], |
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.
I aligned protoc-gen-validate with it's go.md version, see :
https://github.com/cncf/xds/pull/73/files#diff-340a0a599142950de3cef119fa68e93ef2350dbab23edaa3c7e561899e9ea399R6
Yes, this is the key; they still run our codegen, so this change seems more about "how the code generators are executed" vs. "what code is generated". So from gRPC-Go's perspective, this change is a no-op. |
I have used buf.build to regenerate the go files from the proto file .
This just needs to execute from root folder
I don’t have any knowledge on how bazel work to adapt the actual workflow but there is a documentation for this here :
https://buf.build/docs/build-systems/bazel
Signed-off-by: Matthieu MOREL [email protected]