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

sdk: allow use of StrictBuiltinErrors #5438

Merged
merged 4 commits into from
Dec 6, 2022
Merged

sdk: allow use of StrictBuiltinErrors #5438

merged 4 commits into from
Dec 6, 2022

Conversation

charlieegan3
Copy link
Contributor

@charlieegan3 charlieegan3 commented Dec 5, 2022

This allows the struct builtin errors functionality to be used in the SDK by passing the value in DecisionOptions & PartialOptions.

Related to #5176

@charlieegan3 charlieegan3 changed the title Allow use StrictBuiltinErrors functionality in SDK Allow use of StrictBuiltinErrors functionality in SDK Dec 5, 2022
@charlieegan3 charlieegan3 marked this pull request as ready for review December 5, 2022 14:47
anderseknert
anderseknert previously approved these changes Dec 5, 2022
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

Perhaps @philipaconrad or @srenatus could weigh in as well on the approach, but LGTM!

philipaconrad
philipaconrad previously approved these changes Dec 5, 2022
Copy link
Contributor

@philipaconrad philipaconrad left a comment

Choose a reason for hiding this comment

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

@charlieegan3 Overall, this looks great so far! 😄

One small concern I spotted that's tripped me up before: We probably want the ability to have strict errors during partial evaluation too.

It looks like opa_test.go has some partial eval examples you can pull from for tests, and the plumbing should be relatively straightforward. If you want to tackle partial eval in a followup PR, feel free to merge this one now. If you choose to extend this PR, just ping me when you're ready for review again. 👍

srenatus
srenatus previously approved these changes Dec 6, 2022
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. I'm with @philipaconrad wrt partial eval, adding stuff here or having a follow-up PR is all the same to me. 😃

@charlieegan3
Copy link
Contributor Author

Thanks all, I think it makes sense to do it in this PR. I'm working on this now 🙂

This allows the struct builtin errors functionality to be used in the
SDK by passing the value in DecisionOptions.

Related to #5176

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
Feedback from PR review

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Dec 6, 2022

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit a8212e623eb4aad2024381ff2cbed573232f0812
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/638f06b51b8ef70009487a96
😎 Deploy Preview https://deploy-preview-5438--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
@netlify
Copy link

netlify bot commented Dec 6, 2022

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit ea035a0
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/638f074725246b0009753429
😎 Deploy Preview https://deploy-preview-5438--openpolicyagent.netlify.app/docs/edge
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

srenatus
srenatus previously approved these changes Dec 6, 2022
sdk/opa_test.go Show resolved Hide resolved
The unknown values are not needed for the test to function so they have
been removed.

Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com>
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.

Thanks! 🎉

@charlieegan3 charlieegan3 changed the title Allow use of StrictBuiltinErrors functionality in SDK sdk: allow use of StrictBuiltinErrors Dec 6, 2022
@charlieegan3 charlieegan3 merged commit 8a0c080 into open-policy-agent:main Dec 6, 2022
@charlieegan3 charlieegan3 deleted the strict-builtin-errors branch December 6, 2022 10:39
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.

4 participants