nilslice / protolock

Protocol Buffer companion tool. Track your .proto files and prevent changes to messages and services which impact API compatibility.
https://protolock.dev
BSD 3-Clause "New" or "Revised" License
604 stars 37 forks source link

Deeply nested messages may conflict #155

Open zack-littke-smith-ai opened 10 months ago

zack-littke-smith-ai commented 10 months ago

Hello! I've noticed an issue where a nested message may conflict with another. For example (forgive the terrible names and missing boilerplate):

message OutermostA {
  message Inner {
    enum Innermost {
      reserved 1;
    }
  }
}

message OutermostB {
  message Inner {
    enum Innermost {
      reserved 1;
    }
  }
}

We see a lock file where the names of both OutermostA.Inner.Innermost and OutermostB.Inner.Innermost are only Inner.Innermost and may conflict (like above)

nilslice commented 8 months ago

Hi @zack-littke-smith - is this level of nesting (enum nested 2 levels within a parent message) the first at which you notice the issue? Or does something like this also produce the same issue:

message Inner {
  enum Innermost {
     reserved 1;
  }
}
zack-littke-smith-ai commented 7 months ago

I believe this only occurs in the nested case, would not be an issue in the example you provide