buf: Breaking change detector does not ignore deleting files

Is this expected? If so, what is the recommended way to delete a service?

Config:

build:
    roots:
        - proto/
lint:
    use:
        - DEFAULT
        - FILE_LOWER_SNAKE_CASE
breaking:
    use:
        - FILE
    ignore:
        - company/proto/iam/v1test

Steps:

  • Delete: company/proto/iam/v1test.
  • Run: buf check breaking --against-input .git#branch=master

Result:

:1:1:Previously present file “company/proto/iam/v1test/service.proto” was deleted.

Expected:

Breaking change detector to pass.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 22 (12 by maintainers)

Commits related to this issue

Most upvoted comments

Any updates on this?

It’s a more than fair argument. We need to look through what rule we could come up with for ignores that is universally applied for all breaking change checkers. Any modification woud require changing the definition of https://buf.build/docs/breaking-configuration#ignore slightly.

But that’s what pre-v1.0 is for! 😃

Will investigate, this seems like a bug

I can see that argument. I definitely sympathize and 100% agree with the mission to stay “correct”.

My counter, I suppose, is that when using ignore I’m already telling Buf that I know I am “incorrect”.

Right now I can delete everything in company/proto/iam/v1test/service.proto except the package argument (to pass the linter), and the breaking change detector happily ignores it if asked to do so. Thats as “incorrect” as deleting, right?

In practice there definitely are times in early development where no-one is using your services yet and you make a mistake and want to delete a file, split one file into two (incurs a delete), rename a file (incurs a delete).

Cheers!

If your buf.yaml is in ., then your above ignore is saying you have the directory ./proto/company/proto/iam/v1test - is this correct?

Edit: same response time 😃 ok