Buf breaking PACKAGE not works when against to built bin files in workspace mode
We find breaking command not works as expected when:
- using workspace mode
- move a message to another file in the same package
- build two
.binfiles and runbreakingcommand
but it works fine when run buf breaking--against ".git#branch=master"
Here is a reproduce repo: https://github.com/zcong1993/buf-breaking-bug
Thanks for the bug report and reproduction. We'll look into this soon.
Hi, so basically what is happening, when you are comparing two images, base.bin and feat.bin, it is using the default breaking configuration, which defaults to FILE (https://buf.build/docs/breaking/rules#categories). This is because images do not contain your breaking configuration in buf.yaml, which is set to PACKAGE. When you are comparing two sources, it uses the configuration you have checked in.
For example, the following works for me:
- checkout
master,buf build -o base.bin - checkout
feat,buf breaking --against base.bin
This is using the buf.yaml configuration of your local checkout.
Similarly, buf breaking --against feat.bin base.bin --config demo/buf.yaml also works, since this would pass in your configuration file.
Closing this issue for now, please let me know if you have any other questions!