buf icon indicating copy to clipboard operation
buf copied to clipboard

Buf breaking PACKAGE not works when against to built bin files in workspace mode

Open zcong1993 opened this issue 2 years ago • 1 comments

We find breaking command not works as expected when:

  1. using workspace mode
  2. move a message to another file in the same package
  3. build two .bin files and run breaking command

but it works fine when run buf breaking--against ".git#branch=master"

Here is a reproduce repo: https://github.com/zcong1993/buf-breaking-bug

zcong1993 avatar Jun 19 '23 09:06 zcong1993

Thanks for the bug report and reproduction. We'll look into this soon.

bufdev avatar Jun 19 '23 15:06 bufdev

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:

  1. checkout master, buf build -o base.bin
  2. 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!

doriable avatar Jun 05 '24 23:06 doriable