Add support for Go features (features.(pb.go).*) in buf#4363
Conversation
This commit adds support for configuring Go features in buf.yaml for managed mode code generation and breaking change detection. Changes: - Add ResolveGoFeature and ResolveGoFeatureForEnum functions in customfeatures - Add FIELD_SAME_GO_STRIP_ENUM_PREFIX breaking change rule - Add FileOptionGoApiLevel for managed mode (features.(pb.go).api_level) - Add test for ResolveGoFeature The Go features use the external google.golang.org/protobuf/types/gofeaturespb package to avoid namespace conflicts. Note: The strip_enum_prefix breaking rule test is skipped as it requires edition 2024 which is not yet fully supported in buf.
|
Thank you for submitting this change -- I think this request seems very reasonable. Internally, our current priority is getting Editions 2024 support up and running with our new compiler, and would prefer to review this when it can be completed with the required tests. So transparently, I won't be able to review this until that body of work is complete, but if it is okay with you, I am happy to keep this PR open and will provide feedback once we are ready to accept this request. |
Sure |
themavik
left a comment
There was a problem hiding this comment.
ResolveGoFeatureForEnum plus handleBreakingFieldSameGoStripEnumPrefix wires (pb.go).strip_enum_prefix into FIELD_SAME_GO_STRIP_ENUM_PREFIX in the same pattern as the other feature rules.
TestRunBreakingFieldSameGoStripEnumPrefix stays skipped until edition 2024 lands; maybe link the enabling issue in the skip comment so it does not rot.
|
@doriable Any updates about this PR? It seems that buf supports edition 2024 now. I'm looking forward to use this new feature in managed mode |
This commit adds support for configuring Go features in buf.yaml for managed mode code generation and breaking change detection.
Changes:
The Go features use the external google.golang.org/protobuf/types/gofeaturespb package to avoid namespace conflicts.
Note: The strip_enum_prefix breaking rule test is skipped as it requires edition 2024 which is not yet fully supported in buf.