Preserve stable Protobuf field tags and support field lifecycle management - #188
Open
stelund wants to merge 3 commits into
Open
Preserve stable Protobuf field tags and support field lifecycle management#188stelund wants to merge 3 commits into
stelund wants to merge 3 commits into
Conversation
Author
|
If this is the path for defining protobuf tags, I have some more improvements for better protobuf generations. If someone has another idea how to describe it, I would be all ears. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preserve stable Protobuf field tags and support field lifecycle management
Summary
This PR makes IFEX-to-Protobuf generation safe for long-lived, wire-compatible
APIs.
It preserves field numbers when parsing and rendering
.protofiles, requiresexplicit stable tags for IFEX-generated fields, and adds support for deprecated
and removed struct members.
Changes
= 0.protobuf_tagto IFEX struct members and method input/output/return arguments.1..536870911;19000..19999are rejected. (Reserved by protobuf)protobuf_deprecated: true, emitted as[deprecated = true]while retaining the existing tag.protobuf_reserved_tagsandprotobuf_reserved_names, emitted as valid Protobufreservedstatements.Example
Generates:
Compatibility / migration impact
This intentionally makes missing
protobuf_taga generation error. ExistingIFEX definitions that generate Protobuf must add explicit tags before
generation. Tags must never be renumbered or reused after publication.
Validation
Tested with repository-local
.venvon Python 3.12:Commits included:
Preserve protobuf field numbersRequire stable protobuf field tagsSupport deprecated and reserved protobuf fields