Skip to content

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

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

eeeebbbbrrrr
Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr commented Jun 11, 2023

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.

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.
@eeeebbbbrrrr eeeebbbbrrrr requested a review from thomcc June 11, 2023 21:08
Copy link
Contributor

@thomcc thomcc left a 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?

@eeeebbbbrrrr
Copy link
Contributor Author

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.

Copy link
Contributor

@thomcc thomcc left a 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💩

@eeeebbbbrrrr eeeebbbbrrrr merged commit 3dbd00d into develop Jun 12, 2023
@eeeebbbbrrrr eeeebbbbrrrr mentioned this pull request Jun 14, 2023
@andreas
Copy link

andreas commented Jun 14, 2023

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

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

Successfully merging this pull request may close these issues.

3 participants