Preserve FieldMask as a message in the CelValue runtime path#1074
Open
andrewparmet wants to merge 5 commits into
Open
Preserve FieldMask as a message in the CelValue runtime path#1074andrewparmet wants to merge 5 commits into
andrewparmet wants to merge 5 commits into
Conversation
BaseProtoCelValueConverter.fromWellKnownProto converts FieldMask to a
comma-separated string of its paths. That's correct in JSON-assignment
contexts (handled separately by CelProtoJsonAdapter), but it breaks CEL
expressions that access fields on the FieldMask itself — e.g.
`fieldMask.paths` — because the string has no field `paths`.
The CEL spec's WKT conversion table does not list FieldMask. cel-go
treats it as a regular message, as does cel-java's legacy
ProtoLiteAdapter.adaptValueToWellKnownProto for non-JSON contexts.
Override fromWellKnownProto in ProtoCelValueConverter to preserve
FieldMask as a ProtoMessageValue. JSON-assignment paths (e.g.
TestAllTypes{single_value: FieldMask{...}}) are unaffected because
EvalCreateStruct and CelValueRuntimeTypeProvider.createMessage both
unwrap StructValue results before the outer assignment runs, and the
outer assignment goes through CelProtoJsonAdapter.adaptValueToJsonValue
which handles FieldMask → string conversion at that layer.
3 tasks
l46kok
reviewed
Jun 2, 2026
Move the FieldMask case into BaseProtoCelValueConverter, delegating to a new fromProtoMessageToStructValue hook that both the full and lite converters implement. This reuses the existing non-well-known message wrapping path (removing the duplicated ProtoMessageValue.create call) and extends the fix to the lite runtime. Adds a lite-converter test.
…converter" This reverts commit 984193b.
Mirror the full converter: intercept FIELD_MASK in the lite converter and wrap it as a ProtoMessageLiteValue so it is navigable as a message on the lite runtime. Adds a lite-converter test.
l46kok
approved these changes
Jun 3, 2026
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.
BaseProtoCelValueConverter.fromWellKnownProto converts FieldMask to a comma-separated string of its paths. This breaks CEL expressions that access fields on the FieldMask.
Match cel-go and
ProtoLiteAdapter.adaptValueToWellKnownProtoand treat FieldMask as a regular message.