mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-13 03:42:35 -06:00
fc5c4757a7
Before, we'd only plan a single rule functions when a function used
in that rule's body was mocked, instead of planning one rule function
for the mocked, and one for the un-mocked function.
This only affects uses where both the mocked and the un-mocked version
of the rule are queried, like
p {
q with time.now_ns as 1 # (1)
not q # (2)
}
Now, we plan g1.data.pkg.q for (1), and g0.data.pkg.q for (2), where
g1's plan uses the mocked function result, and g0's plan uses the
builtin.
Fixes #4746.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>