Evaluate and debug generates different results while have data usage in regal
As above, "evaluate" generates false, while the actual result is true
Hi there!
And thanks for raising this. Regal (and before we had Regal, the VS Code extension calling opa eval) will read relevant files from the workspace in "bundle mode", which means that the location of data.json will determine where in the data tree the data will be placed. If you run the opa eval command with the -b (or --bundle) flag, you should see the same behavior.
I don't think we have an option to disable that in Regal eval currently, but that could of course be an option later. Let me know if that helps!
Thanks for answering! I don't quite get it. Here is my working tree, and I've place my data.json and input.json in the very root place. If I want the debug mode and the eval to have same results, isn't this the right place to go to?
What does your .regal/config.yaml look like? Have you configured Regal to ue the bundle directory as a project root?
project:
roots:
- bundle
I that's the case, both debug and eval will work relative to that and expect the data.json file to be in the bundle directory too. Does that make sense? If not, let me know, and I can elaborate further.
I tried to configure the root to be bundle, and arranged the location of data.json and input.json. Now they look like:
However, the debugger's eval and opa eval still generates different results:
Strangely, while i stepped into the method, it seems to be going well.
Hey! Sorry, I forgot to get back to you on this. Is this still an issue or did you find out what's wrong?
Came across just same issue, evaluation works fine in cli or with vscode under hot key, but doesn't work as "code lens feature". Fix it by adding .manifest file in bundle directory. Take me a while to figuring out what's wrong, doesn't very obviously when you just start usign this fascinating toolkit
Thanks @pru-mike 👍 Definitely high up on my list of priorities to look into this, but it'll most likely have to wait until after KubeCon next week.