0

I am trying to test breaking change by running buf breaking command like this

buf breaking --against '../.git#branch=master' --path grpc/path/to/protoFile.proto --error-format=json

Upon running this I get an error which says

Failure: no .proto target files found

The confusion is that I am providing the absolute path of my .proto file but still I get no files found error. What am I missing here?.

Rajat Singh
  • 653
  • 6
  • 15
  • 29
  • Probably better raised as an issue on Buf's [repo](https://github.com/bufbuild/buf/issues). Could it be that `grpc/path/to` is not present in the Git repo? What if you run `buf lint` instead with that path? – DazWilkin Oct 14 '22 at 17:09

1 Answers1

0

From what I can see with my own recent testing, this error occurs when you're trying to do buf breaking against a branch that doesn't yet have the proto files in it. Were there existing proto files in master when you attempted to target it with buf breaking?

Another issue you might have is that you need to make sure you've informed buf breaking of where your buf.yaml is for the git repo. If it's not in the root of your repository, you'll need to add the subdir option to your --against argument to ensure imports are resolved correctly as shown in this example on their documentation: https://docs.buf.build/tutorials/getting-started-with-buf-cli#run-buf-breaking

Assuming your buf.yaml was in grpc rather than the root of the project, you'd need to modify your command to be:

buf breaking --against '../.git#branch=master,subdir=grpc' --path grpc/path/to/protoFile.proto --error-format=json
Vaeyrun
  • 1
  • 1