-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
topdown: Fix key construction for NDBCache; rego: avoid NDBCache init (…
…#5097) * topdown/eval: Fix key construction for NDBCache. This commit fixes the construction process for keys used to look up entries in the non-deterministic builtins cache. The original cache lookup process could use refs that were not fully-grounded, and this meant that calling a builtin twice with differing parameters could appear identical to the cache if they involved refs as parameters. We now use fully-grounded terms for the cache keys during insertion/lookup, meaning that non-deterministic builtin calls with different parameters are now guaranteed to result in unique cache entries, even if hidden behind a ref. * rego/rego: Fix unneeded NDBCache initializations. The NDBCache is intended as an opt-in feature, and the initializations present in the `rego` module meant that it was forced on virtually every eval. This commit removes those initializations, so that the only way an NDBCache will ever make it to the evaluator is if it's provided from outside the evaluator. * rego/rego_test: Add ND builtin iteration test. This commit adds a test to ensure that the NDBCache correctly handles iterative calls of a builtin with different input parameters. Signed-off-by: Philip Conrad <[email protected]>
- Loading branch information
1 parent
ebf1997
commit 6a439c5
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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