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 print built-in #180

Merged
merged 1 commit into from
Jan 11, 2022

Conversation

anderseknert
Copy link
Member

While playing around with the Gator CLI today I noticed
that I couldn't use the new print built-in from OPA in that
context. This function is really useful to quickly be able to
debug values of rules and variables, and would be a nice
addition to the Gator CLI (and possibly to the Gatekeeper
server too, but others can decide that). This PR adds options
to the local driver for enabling print and for providing a
printHook that decides where the output of print calls should
go. Will submit another PR for support in Gator if/when this
is merged.

Signed-off-by: Anders Eknert anders@eknert.com

@codecov-commenter
Copy link

Codecov Report

Merging #180 (9e9cece) into master (527ad40) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #180      +/-   ##
==========================================
- Coverage   44.92%   44.91%   -0.01%     
==========================================
  Files          59       59              
  Lines        2776     2783       +7     
==========================================
+ Hits         1247     1250       +3     
- Misses       1286     1290       +4     
  Partials      243      243              
Flag Coverage Δ
unittests 44.91% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...eworks/constraint/pkg/client/drivers/local/args.go 83.33% <0.00%> (-10.42%) ⬇️
...works/constraint/pkg/client/drivers/local/local.go 66.22% <0.00%> (+0.45%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 527ad40...9e9cece. Read the comment docs.

Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nitpick in the tests.

@anderseknert
Copy link
Member Author

@srenatus did you miss to post that nitpick? I can't find it 😄

While playing around with the Gator CLI today I noticed
that I couldn't use the new print built-in from OPA in that
context. This function is really useful to quickly be able to
debug values of rules and variables, and would be a nice
addition to the Gator CLI (and possibly to the Gatekeeper
server too, but others can decide that). This PR adds options
to the local driver for enabling print and for providing a
printHook that decides where the output of print calls should
go. Will submit another PR for support in Gator if/when this
is merged.

Signed-off-by: Anders Eknert <anders@eknert.com>
@anderseknert anderseknert merged commit 8c2d6e2 into open-policy-agent:master Jan 11, 2022
@anderseknert anderseknert deleted the allow-print branch January 11, 2022 12:36
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

Successfully merging this pull request may close these issues.

None yet

3 participants