Clean up field presence checks and tests in anticipation of Protobuf Editions#3920
Merged
alecgrieser merged 3 commits intoFoundationDB:mainfrom Feb 5, 2026
Merged
Conversation
…tional. Also, changing this in either direction is problematic as to whether default values are indexed as nulls.
alecgrieser
approved these changes
Feb 5, 2026
| final String labelText = label.name().substring(label.name().indexOf('_') + 1).toLowerCase(Locale.ROOT); | ||
| errMsg = labelText + " field is no longer " + labelText; | ||
| } | ||
| final DescriptorProtos.FieldDescriptorProto.Label newLabel = labels.get((i + 1) % labels.size()); |
Collaborator
There was a problem hiding this comment.
At some point, we probably want a test like "compare a proto2/proto3 file with explicit optionals to a file with editions set correctly/incorrectly", but I think we throw an error right now if the syntax doesn't match between two files anyway, so that test is probably pre-mature. This change, on the whole, seems to put us closer to that future, though
g31pranjal
pushed a commit
to g31pranjal/fdb-record-layer
that referenced
this pull request
Feb 6, 2026
…Editions (FoundationDB#3920) * Add a test of Proto3 with explicit presence. * Use `hasPresence` instead of `isOptional` in evolution validator. * See FoundationDB#3919 for confirmation that compiling with a newer Proto dependency will work.
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.
hasPresenceinstead ofisOptionalin evolution validator.