tcdi / plrust

A Rust procedural language handler for PostgreSQL
PostgreSQL License
1.1k stars 32 forks source link

In response to issue #325, rework the dependency allow-list. #332

Closed eeeebbbbrrrr closed 1 year ago

eeeebbbbrrrr commented 1 year ago

Generally, the changes here allow a single dependency in the allow-list to have one or more versions specified, either as exact (=) or bounded ranges (>=,<=) or wildcards (*).

PL/Rust will pick the largest (newest, hopefully) entry from the allow-list that matches the function's requested version. Depending on how either is written, the allow-list version could be used or the requested version could be used.

See the new documentation for more details.


As a drive-by, a number of our unit tests were tagged with #[should_panic] but without an expected message. Turns out many of them were panicking but for the wrong reason! This PR addresses these too.

That said, the plrust_pgloglevel_dont_allcaps_panic test is currently set to #[ignore]. Its intent is to block using Postgres' PANIC log level (which purposely crashes the backend), and I'm not yet clear on how this is supposed to be addressed.

eeeebbbbrrrr commented 1 year ago

I thought it was complete, but it looks like there's a little bit of WIP left?

No. I think it's just some spaghetti code. We discussed this in discord, specifically the validate_user_dependencies function.

andreas commented 1 year ago

This change was really helpful by also allowing git dependencies -- thanks! 🙏