cel-go icon indicating copy to clipboard operation
cel-go copied to clipboard

Attribute Tracking Through Comprehensions

Open jnthntatum opened this issue 5 years ago • 1 comments

Feature request checklist

  • [x] There are no issues that match the desired change
  • [x] The change is large enough it can't be addressed with a simple Pull Request
  • [] If this is a bug, please file a Bug Report.

Change Add support for tracking attributes through comprehensions.

Example var[2].field is declared unknown for expression: var.exists(x, x.field == 'test') I would expect that var[2].field might be returned as an unknown value.

Adding tracking here to keep feature parity with cel-cpp. I'm not sure what the current level of support is in cel-go. Let me know if I can add more detail.

jnthntatum avatar Mar 16 '20 21:03 jnthntatum

Thanks Jon, the details look fine. Support for unknowns currently stops at comprehensions, but is slightly different from what you might have seen before since the Go implementation optimizes the field selection behavior in addition to building an attribute trail.

It's totally possible to make the change you've suggested and it would have a dramatic speedup on comprehension processing since currently the code will stop evaluation at var when it could actually complete the evaluation. :) Thanks for the report.

TristonianJones avatar Mar 16 '20 21:03 TristonianJones