bufbuild / buf

The best way of working with Protocol Buffers.
https://buf.build
Apache License 2.0
8.49k stars 247 forks source link

Only validate min/max editions in code gen response when input uses editions #3073

Closed jhump closed 3 weeks ago

jhump commented 3 weeks ago

This works around an issue with some pre-v27.0 releases of protoc and the code generators there in (such as Java, C++, Python, etc).

Some of the languages advertised support for features, but in an experimental way, that did not include the minimum and maximum edition fields being set. With v1.32.0+ of buf, code gen always fails because the min/max editions are missing. This changes the validation so that it only occurs when an actual input file uses editions. So if editions aren't used at all, the plugin's output will be used without any error messages.