Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make now stable variable instead of function #6

Merged
merged 1 commit into from
May 30, 2023
Merged

Conversation

rodaine
Copy link
Member

@rodaine rodaine commented May 30, 2023

CEL expects expressions to be pure, which the now() function we previously introduced would violate. To avoid this, and to align with other implementations, we're going to make now a global variable instead, so that it may be consistent within a single expression. The value can be lazily resolved in an activation to avoid overhead of resolving this variable on every expression.

Updated conformance tests to ensure now == now within an expression.

@rodaine rodaine added the Feature New feature or request label May 30, 2023
@rodaine rodaine requested a review from Alfus May 30, 2023 22:15
@rodaine rodaine merged commit ac046e9 into main May 30, 2023
@rodaine rodaine deleted the rodaine/stable-now branch May 30, 2023 22:32
rodaine added a commit to bufbuild/protovalidate-go that referenced this pull request May 30, 2023
pkwarren pushed a commit that referenced this pull request Jul 18, 2023
igor-tsiglyar pushed a commit to igor-tsiglyar/protovalidate that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants