microsoft / regorus

Regorus - A fast, lightweight Rego (OPA policy language) interpreter written in Rust.
MIT License
106 stars 27 forks source link

Ruby bindings for existing FFI methods, plus eval_rule() #188

Closed thedavemarshall closed 3 months ago

thedavemarshall commented 3 months ago

I have a few things left to figure out, but I wanted to get some early feedback on my first time wring Rust. Feedback is welcome!

The other thing I'd call out is that I ran into some issues with a circular build when I had the bindings/ruby/ext/regorusrb/Cargo.toml depend on the relative location of regorus, so I locked it to 0.1.2 . Other language bindings seem to work with the relative paths, I think this might be something to do with the other manifest at bindings/ruby/Cargo.toml? Not sure if resolving this is a blocker or if we can manually update the versions as needed for each release. Update- I think I got it to work with relative paths for the crate!

The other callout is that rubygems expects a Cargo.lock file to be included, source, which in this case is the top level regorus crate's Cargo.lock

thedavemarshall commented 3 months ago

@microsoft-github-policy-service agree

anakrish commented 3 months ago

Looks great, especially if this is the first time with Rust!

anakrish commented 3 months ago

I have created an issue #191.

You could also update the bindings section of the main README.md

thedavemarshall commented 3 months ago

There are a few other things I haven't gotten to yet besides adding the Ruby bindings tests to the github actions, but I think these could each be followup PRs.

@anakrish thank you so much for the feedback!

anakrish commented 3 months ago

@thedavemarshall I will go ahead and merge the PR. The remaining items including the github action could be done as separate PRs.

anakrish commented 3 months ago

Support calling add_extension() with Ruby code blocks - I have some ideas about this

Interesting!