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

Visual Debugger #95

Open
GoldbergAlexander opened this issue Feb 2, 2021 · 3 comments
Open

Visual Debugger #95

GoldbergAlexander opened this issue Feb 2, 2021 · 3 comments

Comments

@GoldbergAlexander
Copy link

What would you like to be added

Visual debugging support like exists with Python in PyCharm or Java in JetBrains.

Why is this needed

This would speed up policy development and document discovery.
Features from a technical implementation are available using the Fregot tool, however, it would be nice to extend this integration into an IDE. Looking at the JetBrains documentation on plugins it seems like "Debuggers" are in the works and I don't know if this level of integration is even supported.

If this is not on the roadmap, I'd be interested in taking this up myself.

Implementation details

@anderseknert
Copy link
Member

That would be awesome @GoldbergAlexander 👍 I know of plenty other language integrations that adds debugging capabilities for their language so it should certainly be doable. What's missing for this type of integration is rather in OPA itself, as there is no way of tapping into this from the outside currently. At the last bi-weekly meeting we talked some about the options in that space, and @tsandall presented some ideas around that. Perhaps you'd like to join in for the next one? Details for how to join can be found in the OPA README. Next meeting is Tuesday the 16th.

We could obviously keep the discussion going here until then too :)

@GoldbergAlexander
Copy link
Author

GoldbergAlexander commented Feb 5, 2021

That sounds great — I’ll do a little more research on how that integration works and see if I can dial in. I see what you mean on the repl support in OPA. Fregot (https://github.com/fugue/fregot/tree/master/lib/Fregot) seems to have their own rego implementation, perhaps that could be the base?

@tsandall
Copy link
Member

tsandall commented Feb 8, 2021

Yep, you could use Fregot to implement a debugger extension. I also did a quick experiment to see how much it would take to do this inside OPA using the existing tracing support. The answer is not too much--tracing delivers events when expressions are being executed so the debugger can hook into those and then wait for input, query state, etc. Here's the spike: tsandall/opa@a2cc2db

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

No branches or pull requests

3 participants