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

partial eval: apply copy propagation to support rule bodies #911

Closed
tsandall opened this issue Aug 29, 2018 · 0 comments
Closed

partial eval: apply copy propagation to support rule bodies #911

tsandall opened this issue Aug 29, 2018 · 0 comments

Comments

@tsandall
Copy link
Member

Currently copy propagation is only applied to the queries returned by partial evaluation. If the partial evaluation result includes support modules, copy propagation is not applied to the bodies of rules in those modules. By default, we should apply copy propagation in all of the partial evaluation results. In cases where clients cannot consume support modules, the additional latency will not be important (since the presence of support modules will likely result in an error). In cases where clients CAN consume support modules, the removal of unnecessary variables will simplify processing for clients.

tsandall added a commit to tsandall/opa that referenced this issue Aug 29, 2018
Previously copy propagation was only being applied to queries returned
by partial eval. The assumption was that clients would typically be
implemented to deal with queries and that support rules would be
unhandled. In some cases though, clients may be capable of handling
support rules. For them, it's better if we apply copy propagation to
both queries and rule bodies.

Note, we ensure that rule bodies are non-empty so that comparisons to
parsed rules that are equivalent (but lacking a body) succeed.

Fixes open-policy-agent#911

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall added a commit that referenced this issue Aug 30, 2018
Previously copy propagation was only being applied to queries returned
by partial eval. The assumption was that clients would typically be
implemented to deal with queries and that support rules would be
unhandled. In some cases though, clients may be capable of handling
support rules. For them, it's better if we apply copy propagation to
both queries and rule bodies.

Note, we ensure that rule bodies are non-empty so that comparisons to
parsed rules that are equivalent (but lacking a body) succeed.

Fixes #911

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant