Title: Evaluating unchecked expressions in CEL-Java · Issue #276 · cel-expr/cel-java · GitHub
Open Graph Title: Evaluating unchecked expressions in CEL-Java · Issue #276 · cel-expr/cel-java
X Title: Evaluating unchecked expressions in CEL-Java · Issue #276 · cel-expr/cel-java
Description: Describe the bug In the README, under "Common Questions", it is written that: Checking is an optional, but strongly suggested, step in CEL expression validation. It is sufficient in some cases to simply Parse and rely on the runtime bind...
Open Graph Description: Describe the bug In the README, under "Common Questions", it is written that: Checking is an optional, but strongly suggested, step in CEL expression validation. It is sufficient in some cases to s...
X Description: Describe the bug In the README, under "Common Questions", it is written that: Checking is an optional, but strongly suggested, step in CEL expression validation. It is sufficient in some ...
Opengraph URL: https://github.com/cel-expr/cel-java/issues/276
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Evaluating unchecked expressions in CEL-Java","articleBody":"**Describe the bug**\r\n\r\nIn the README, under \"Common Questions\", it is written that:\r\n\r\n_Checking is an optional, but strongly suggested, step in CEL expression validation. It is sufficient in some cases to simply Parse and rely on the runtime bindings and error handling to do the right thing._\r\n\r\nI believe there currently is no way around checking an expression before evaluation, as an expression must be checked before it can be turned into a program and evaluated. An attempt to create a program from an unchecked AST always results in an error \"programs must be created from checked expressions\".\r\n\r\nChecking in turn requires declaring variables. However, in my particular use case, I cannot acquire a full list of variables to be used in expressions (there may be many, and acquiring variable values is costly, so I would only like to do this whenever required). I believe that the above should be achievable with an unchecked variable and CelVariableResolver.\r\n\r\nIt seems that this behavior deviates from CEL Go and also does not coincide with a similar question posted in the CEL Go group: https://groups.google.com/g/cel-go-discuss/c/PoyIrdFPwHM. Here, the possibility of evaluating unchecked expression is suggested. An (unrelated) Python implementation supports the same functionality: https://github.com/cloud-custodian/cel-python.\r\n\r\nI file this as a bug as the current behavior seems to be conflicting with respect to the documentation.\r\n\r\n**To Reproduce**\r\n\r\nCheck which components this affects:\r\n\r\n- [ ] parser\r\n- [ ] checker\r\n- [x] runtime\r\n\r\nWhen attempting to create a program from an unchecked AST:\r\n\r\n`var p = cel.createProgram(cel.parse(\"5\").getAst()).eval();`\r\n\r\n**Expected behavior**\r\n\r\nI expect to be able to evaluate the unchecked expression.\r\n\r\n**Additional context**\r\n\r\nNone.\r\n","author":{"url":"https://github.com/Frnd-me","@type":"Person","name":"Frnd-me"},"datePublished":"2024-03-20T16:57:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/276/cel-java/issues/276"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d5bdf465-53f2-f64d-266a-3704bb7dfbb9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B6A:8F52B:3AC6AE:53B9D6:6A4E6CE7 |
| html-safe-nonce | ea96b0d138222afa7e7403fd3c7c0c306c6589a54e1d40deaa7a875b36a7f68e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjZBOjhGNTJCOjNBQzZBRTo1M0I5RDY6NkE0RTZDRTciLCJ2aXNpdG9yX2lkIjoiNzE3Nzc4MzEzOTY2MTQwOTUxMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aa5cf413ab7d909d608f68a858e1c5a701a5200be406ef4152f4f1e7e2d1a51c |
| hovercard-subject-tag | issue:2198043147 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cel-expr/cel-java/276/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3c9434bf19a5c21e177e57aebc6d08a10d277bc6611dcf79aa92f98ec80fd4ba/cel-expr/cel-java/issues/276 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3c9434bf19a5c21e177e57aebc6d08a10d277bc6611dcf79aa92f98ec80fd4ba/cel-expr/cel-java/issues/276 |
| og:image:alt | Describe the bug In the README, under "Common Questions", it is written that: Checking is an optional, but strongly suggested, step in CEL expression validation. It is sufficient in some cases to s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Frnd-me |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| turbo-cache-control | no-preview |
| go-import | github.com/cel-expr/cel-java git https://github.com/cel-expr/cel-java.git |
| octolytics-dimension-user_id | 186625994 |
| octolytics-dimension-user_login | cel-expr |
| octolytics-dimension-repository_id | 587078119 |
| octolytics-dimension-repository_nwo | cel-expr/cel-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587078119 |
| octolytics-dimension-repository_network_root_nwo | cel-expr/cel-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width