-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
General refs/planner #6235
General refs/planner #6235
Conversation
Fixes: open-policy-agent#5995 Signed-off-by: Johan Fylling <johan.dev@fylling.se>
…y other rules (including defined by themselves) Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
✅ Deploy Preview for openpolicyagent ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…rtion of ref Signed-off-by: Johan Fylling <johan.dev@fylling.se>
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
There's a potential follow-up wrt the CallDynamic optimization: With the following rego, package x
import future.keywords
p.a.b := true
p.d.e := 12 querying
So since
Now, if we make the rego file package x
import future.keywords
p.a.b := true
p.d.e := 12
p[y].c if y := "b" we get this plan,
where Now, it's absolutely non-obvious how to make that happen, so this -- for now -- might just be something we need to be aware of and keep in mind; not a blocker. What do you think? |
#"refheads/general, input var": "Tests with arbitrary vars in rule refs (general refs) are not supported by the planner yet" | ||
#"refheads/general, external non-ground var": "Tests with arbitrary vars in rule refs (general refs) are not supported by the planner yet" | ||
#"refheads/general, multiple result-set entries": "Tests with arbitrary vars in rule refs (general refs) are not supported by the planner yet" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 But let's also remove the comments 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I totally forgot about those 😅. Will remove 👍.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 Let's get this merged.
test/cases/testdata/partialobjectdoc/test-partialobjectdoc-ref.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Johan Fylling <johan.dev@fylling.se>
In previous versions of OPA, you see the same behavior with partial object "overrides": package x
import future.keywords
p.a := true
p.d := 12
p[y] if y := "b" -->
There might be an opportunity to do some optimization here, though. Conflict resolution might still force us to always execute blocks for the rules with variables in their ref (we want to error whenever |
It's been more than a week since I've had a look, so I don't know 😅 BTW it's a good point, I actually messed this up when introducing string prefixes 👍 |
Fixes: #5995