You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inferring support module rule ref, name and key from original rule ref for partial-eval.
Fixes: #6094
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Short description
Partial evaluation fails to generate valid optimized support modules for partial object/set ref head rules.
Steps To Reproduce
Given the policy:
1. Partial Evaluation
When running
opa eval --partial -fsource --shallow-inlining -d bug.rego 'data.bug.p.q[x]'
, we get the output:Notice how the name and key of the generated optimized rule are missing; resulting in broken Rego.
2. Build with optimization
When running
opa build bug.rego -O 1 -e 'bug/allow'
, we get a bundle with optimized Rego included at<bundle.tar.gz>/optimized/bug/p.rego
:Where, similar to (1), the generated Rego has missing rule name and key.
Expected behavior
When running
opa eval
(1), the expected output is:Similarly, when running
opa build
(2), the expected optimized Rego is:The text was updated successfully, but these errors were encountered: