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

Consider using packageurl::PackageUrl instead of custom Purl type. #410

Open
alilleybrinker opened this issue May 30, 2023 · 3 comments
Open

Comments

@alilleybrinker
Copy link

Right now the crate uses its own Purl type, with only hidden fields (which also makes it not terribly useful as-is, except for validation; use of its contents requires Display-ing and then reparsing with packageurl::PackageUrl or url::Url anyway). It's probably better to transition this to packageurl::PackageUrl to enable easier interoperation and enable extraction of the purl's components.

@Shnatsel
Copy link
Contributor

There is a downside to exposing packageurl::PackageUrl in the public API: every time packageurl makes a semver-breaking release, we would have to make one too. Switching to another PURL crate would also be semver-breaking.

For now we've instead exposed FromStr implementations for Purl in #381 to make it writable, but without actually transitioning to a foreign type.

@alilleybrinker
Copy link
Author

Alright, seems like a good enough solution. Do you think documentation could be added to more clearly indicate this is the recommended way to interoperate with the packageurl crate?

@Shnatsel
Copy link
Contributor

There are several package URL crates in use already. I don't think it makes sense to enumerate every one in the documentation.

I'd be happy to accept a PR adding a code example that uses the FromStr impl, and a note that other package URL types should be converted to an &str first.

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

2 participants