fix: keep default values of proto3 fields without presence in protobuf ingestion #20485
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.36) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 207 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.319
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #20485"
general
weight: 0.35
abhishekrb19
Fixes #18792.
Description
Protobuf ingestion turned proto3 fields that are not marked
optionalintonullwhenever they used their default value (0,"",false, or the first enum value). Users had to wrap such fields innvl()in transforms to get the actual value back.ProtobufConverter.convertMessagebuilt each row fromMessage.getAllFields(). That method only returns fields that are "set", and for proto3 fields without explicit presence a default value is indistinguishable from unset when serialized, so those fields were dropped from the row.convertMessagenow also walks the message descriptor and adds every singular field whereFieldDescriptor.hasPresence()is false and whichgetAllFields()did not already return, usingmsg.getField()to read the default. This mirrorsJsonFormat.printer().alwaysPrintFieldsWithNoPresence(), with one deliberate difference: empty repeated and map fields are still omitted, as before, so they keep ingesting asnullrather than an empty array.Release note
Protobuf ingestion now keeps the default value of proto3 fields that are not marked
optional. Previously anint32field holding0(or astringholding"", aboolholdingfalse, an enum holding its first value) was ingested asnull. Such fields now ingest as their actual value.<hr>
This PR has: