Questions tagged [buf]

The Buf tool, here, allows the user to develop compiler configurations that can be used to transform protobuf .proto files to source code in a predictable manner, without having to interact directly with protoc-gen-go, protoc-gen-grpc or other protobuf plugins. This tool also offers access to remote repositories for uploading and sharing protobuf code, known as the Buf Schema Registry or BRS. Additionally, buf offers integration with GitHub actions.

17 questions
5
votes
0 answers

buf build can't find file when called from same directory as buf.work.yaml

I have a protobuf repository with the following structure: ├── protos │ ├── common │ │ ├── buf.yaml │ │ └── time.proto │ └── internal │ ├── buf.yaml │ └── user │ └── user.proto ├── buf.gen.yaml └──…
Woody1193
  • 7,252
  • 5
  • 40
  • 90
2
votes
0 answers

What is the purpose of the go_package_prefix in the buf build library?

I I don't understand the purpose of the go_package_prefix code snippet in generating protobuf files version: v1 managed: enabled: true go_package_prefix: default: github.com/imsobad/grpc-gateway-demo except: -…
Stupidd
  • 21
  • 2
2
votes
1 answer

How to use buf cli to check breaking changes against one file

Buf is a tool to make Protobuf reliable and user friendly for service owners and clients. Has anyone tried using buf breaking command against one single file to detect any breaking changes for that proto file? The buf doc only mentions running that…
1
vote
0 answers

Is it possible to use the remote grpc python plugin for `buf` to generate a Python Client Stub, but not generate the Servicer?

I'm working with buf to try to generate code for my grpc service. However, I don't want to create a Python service. I only want to use a Python client to talk to my service. Is there some option I can give to buf, or the remote plugin to do…
1
vote
1 answer

Import cycle in tensorflow protobufs

I am trying to write client code to talk to a tensorflow server. I need the golang compiled protobufs for tensorflow and tensorflow_serving. These are not easy to come by, I managed to do so through this. Basically, using buf to generate them. Here…
maininformer
  • 967
  • 2
  • 17
  • 31
1
vote
2 answers

How would I add a RUST plugin for a buf command line to generate rust libraries for protofile

I am working on a gRPC experiment at this githib repo, using buf cli to generate the gRPC server and Client libraries. I have it working in GoLang but I want to generate libraries for RUST. The git repo is at: …
IrishGringo
  • 3,864
  • 7
  • 37
  • 49
1
vote
1 answer

How do I add an import to the service proto file in a golang project with a buf?

I have such a project structure: vgm: -music: -app: -cmd -go.mod -migrations -proto: -buf.yaml -music_service: -album: -v1: -album.proto -service.proto .env Here…
Alpharius
  • 489
  • 5
  • 12
1
vote
1 answer

openapiv2 imports causes compilation error in generated code

I am using buf to generate grpc server and client code for several languages (go, python, js, java, c#), while using grpc-ecosystem/plugins/openapiv2 plugin to generate swagger documentation from the same proto files. In some files I'm using…
Budbreaker
  • 35
  • 5
0
votes
0 answers

Buildbuf buf breaking protoc-gen-validate

I'm trying to detect breaking protobuf changes in our CI workflow but I'm running into an issue with our use of protoc-gen-validate. $ npx buf breaking . --against '.git#branch=main' command/command.proto:5:8:validate/validate.proto: does not…
0
votes
0 answers

File structure for generated code in Rust

I'm generating protobuf code for my Rust project using the neoeinstein-prost buf plugin which, so far, is working well for my use case. My question is where is the idiomatic place for the generated *.rs files to go and be referenced? Is this a…
Goldie
  • 81
  • 1
  • 7
0
votes
0 answers

https://crates.io/crates/protoc-gen-prost-crate Failure: plugin prost:

I am following this link https://crates.io/crates/protoc-gen-prost-crate to generate crate for rust code. Below part generates mod.rs file version: v1 plugins: - name: prost-crate out: gen strategy: all opt: - no_features Afaik…
punam
  • 1
  • 1
0
votes
0 answers

How show protoc and protobuf versions that Buf is using?

In order to help integrate Buf into our workflow, I need help figuring out what versions of protoc and protobuf that Buf is depending on. I found in the repo that they are defaulting to PROTOC_VERSION := v22.0, but that doesn't seem like a…
Greg McKelvey
  • 229
  • 1
  • 8
0
votes
1 answer

buf generate - .proto not exists

When I run buf generate, get error: proto/auth_service.proto:5:8:user.proto: does not exist buf.gen.yaml: version: v1 plugins: - name: go out: gen/go opt: - paths=source_relative - name: go-grpc out: gen/go opt: -…
Eric
  • 22,183
  • 20
  • 145
  • 196
0
votes
1 answer

Buf: Import protocol buffers from another project

I am using buf CLI to generate protos for Go via command buf generate. I am able to generate protos successfully if any imports are defined in the same directory. However, I could not import protos from another repository or even the same repository…
Harun Sasmaz
  • 119
  • 1
  • 1
  • 10
0
votes
0 answers

How can I set validation and default value in proto3?

I'm trying to add default value to an optional field alongside with validation, but could not find any infos in the docs for multiple conditions in a proto field. This is the example: optional string date = 1 [(validate.rules).string = { pattern:…
Fulvio
  • 87
  • 7
1
2