fix(cel): preserve timestamp and duration values across bindings - #45
Merged
Conversation
jrandolf
enabled auto-merge (squash)
September 4, 2026 23:19
This was referenced Sep 4, 2026
Merged
jrandolf
added a commit
that referenced
this pull request
Sep 4, 2026
CEL field reads must match protobuf defaults: an unset Timestamp reads as Unix epoch, an unset Duration reads as zero, and an unset nested message exposes its default instance. Presence remains false for `has()`. The previous `as_option()?` emission skipped entire rules, incorrectly accepting unguarded comparisons. Use Buffa's default-instance dereference for message field selection and remove the skip-on-unset closures. Keep the existing presence guard for rules attached to an absent field, matching upstream Protovalidate. Follow-up to [#45](#45) and [discussion #44](#44), originally reported by @LuKev. The release remains paused until this correction is included. Validated expected semantics directly against protovalidate-go commit `573e8070aa030baf4d4f574293364b998a133a52` using the same protobuf descriptors. Three new regressions fail before the correction and pass afterward, covering owned messages and borrowed views. All 185 workspace tests pass. The workspace build and Clippy with all features and warnings denied pass. The official protovalidate-conformance v1.2.2 harness reports `PASS (failed: 0, skipped: 0, passed: 2872, total: 2872)`.
jrandolf
added a commit
that referenced
this pull request
Sep 4, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>protoc-gen-protovalidate-buffa: 0.7.2</summary> ## [0.7.2](protoc-gen-protovalidate-buffa-v0.7.1...protoc-gen-protovalidate-buffa-v0.7.2) (2026-09-04) ### Bug Fixes * **cel:** Preserve timestamp and duration values across bindings ([#45](#45)) ([94037da](94037da)) * **cel:** Read protobuf defaults for unset message fields ([#47](#47)) ([32742d4](32742d4)) </details> <details><summary>0.7.1</summary> ## [0.7.1](v0.7.0...v0.7.1) (2026-09-04) ### Bug Fixes * **cel:** Preserve timestamp and duration values across bindings ([#45](#45)) ([94037da](94037da)) </details> <details><summary>protovalidate-buffa-conformance: 0.0.15</summary> ### Dependencies * The following workspace dependencies were updated * dependencies * protovalidate-buffa bumped from 0.7.0 to 0.7.1 * build-dependencies * protoc-gen-protovalidate-buffa bumped from 0.7.1 to 0.7.2 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Fixes the Timestamp comparison failure reported in discussion #44, reported and diagnosed by @LuKev. Timestamp and Duration fields now use CEL temporal values while
has()continues to check protobuf presence.The same conversion now handles repeated-item and map-value rules. Field and element rules receive the schema index and skip unset nested messages consistently. Generated timestamp literals and accessors use the runtime's
chronore-export, so consumers do not need a directchronodependency. Regenerate validators with the new generator and update the runtime together.Validation: 182 workspace tests pass, including four regression tests for owned messages and borrowed views. The original and related regression tests failed before their respective fixes. Workspace build, Clippy with all features and warnings denied, formatting, and protobuf lint pass. The lockfile is refreshed as required by the repository freshness check; CI also verifies Rust 1.88 compatibility.