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

topdown/eval: Fix key construction for NDBCache. #5097

Merged
merged 3 commits into from Sep 7, 2022

Commits on Sep 6, 2022

  1. 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.
    
    Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
    philipaconrad committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    8ad9024 View commit details
    Browse the repository at this point in the history
  2. 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.
    
    Signed-off-by: Philip Conrad <philipaconrad@gmail.com>
    philipaconrad committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    9984920 View commit details
    Browse the repository at this point in the history
  3. 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 <philipaconrad@gmail.com>
    philipaconrad committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    27f2762 View commit details
    Browse the repository at this point in the history