-
Notifications
You must be signed in to change notification settings - Fork 39
In response to issue #325, rework the dependency allow-list. #332
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
Conversation
Generally, the changes here allow a single dependency in the allow-list to have or **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 version the user's requested dependency version. Depending on how either is written, the allow-list version could be used or the user's requested version could be used. See the new documentation for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's here looks very good! 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
fn validate_versionreq(vreq: &VersionReq, require_exact: bool) -> bool { | ||
let has_prelrease = vreq.comparators.iter().any(|cmp| !cmp.pre.is_empty()); | ||
if has_prelrease { | ||
// -shitshow versions not allowed (https://docs.rs/semver/latest/semver/struct.Prerelease.html#examples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💩
This change was really helpful by also allowing git dependencies -- thanks! 🙏 |
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.