Skip to content

fix(cel): preserve timestamp and duration values across bindings - #45

Merged
jrandolf merged 2 commits into
mainfrom
fix/cel-message-wkt
Sep 4, 2026
Merged

fix(cel): preserve timestamp and duration values across bindings#45
jrandolf merged 2 commits into
mainfrom
fix/cel-message-wkt

Conversation

@jrandolf

@jrandolf jrandolf commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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 chrono re-export, so consumers do not need a direct chrono dependency. 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.

@jrandolf
jrandolf enabled auto-merge (squash) September 4, 2026 23:19
@jrandolf
jrandolf merged commit 94037da into main Sep 4, 2026
8 checks passed
@jrandolf
jrandolf deleted the fix/cel-message-wkt branch September 4, 2026 23:23
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant