-
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
CLI: opa eval -S/--strict #5182
Comments
We should only apply the strict mode checks to the Rego modules that get compiled, i.e., do not enable strict mode on the user-supplied query. |
Hey guys 👋 Just curious as I've been playing around with this a bit but getting a little stuck, how would you go about approach this? Maybe at a high level? 😅 |
Heya. I'm assuming that adding the CLI flag isn't the problem 😄 So, having skimmed the code of So we would have to add a field to its config methods, like Does that help? |
Definitely helps thanks! Now I see I was getting stuck here:
Glad I asked the question, I will keep hacking away then! Thanks again 👍 |
To be quite honest, I didn't foresee that extra hoop to jump through. 😅 |
Hey @srenatus 👋 I think I can work on this one now if you'd like to assign it to me. I've made some good progress and just need to figure out the testing part and what needs to be modified there. Is that ok? Thanks! |
Just small question on this, running
Could be I'm implementing it incorrectly 🤔 just wondering what you guys think should be the functionality here, should it be just running Which would just be Curious to hear your thoughts on this 👍 |
|
Hey! 👋 Just wondering @srenatus, how you would like to see this tested? As its kind of new behavior what should I consider when making tests? Any tips you can give on this? 😄 Thanks! |
There are no e2e tests for executables and their outputs. So it would be nice if there was a test cases added in |
Hey! @srenatus 👋 I will push what I have tomorrow/Monday for this, I have the basic groundwork done (but need to do some tidying up) for the testing but might need some guidance on doing the testing properly, hope that is okay, think it may be easier if you can see what I have done... 😅 Thanks! |
Hey @srenatus 👋, team, While working on this, I did notice the following and just wondered if it's intended or not, let's say in one policy we have multiple issues that
Policy:
Outputs:
I double-checked with And get (not sure if intended):
This is a bit of a head-scratcher for me 😅 but I think I am getting somewhere, was just curious about the above. Thanks! 👍 |
The compiler's strict mode is only exposed via
opa check --strict <file.rego>
. It would be nice ifopa eval
also had a flag like this.The text was updated successfully, but these errors were encountered: