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

Add support for the new print() function #1654

Closed
tsandall opened this issue Nov 9, 2021 · 2 comments
Closed

Add support for the new print() function #1654

tsandall opened this issue Nov 9, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@tsandall
Copy link
Member

tsandall commented Nov 9, 2021

In v0.34.0 we added a new print() function that helps with simple debugging use cases. Library embeddings have to be updated to capture print() output. Without opt-in, print() statements are just erased from the policy at compile-time. Note, print() enablement might be better solved in the constraint framework. Feel free to close and move the issue over to constraints if you want.

Conftest was recently updated to support print(). See this PR: open-policy-agent/conftest#629

For more info on the print() function see this blog post: https://blog.openpolicyagent.org/introducing-the-opa-print-function-809da6a13aee

@tsandall tsandall added the enhancement New feature or request label Nov 9, 2021
@maxsmythe
Copy link
Contributor

Nice!

QQ about print: is it still subject to indexing (as in a rule that is not called because of indexing would lead to print not being called), or is it always called?

This definitely sounds like something that should go into the constraint framework.

@willbeason FYI

Closing this and re-opening there.

@maxsmythe
Copy link
Contributor

moved: open-policy-agent/frameworks#149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants