-
Notifications
You must be signed in to change notification settings - Fork 650
Add Package URL (PURL) display to crate sidebar #11416
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
base: main
Are you sure you want to change the base?
Conversation
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.
👍
One thought I do have is whether we should add some sort of help explaining what this is, since PURLs aren't a super well known concept right now. One thought: could we add a question mark on the right hand side of the PURL that has a hover explaining what a PURL is and why it's useful? Or maybe we have some other way of linking to more information. 🤷
|
||
// Add repository_url query parameter | ||
const repositoryUrl = `https://${host}/`; | ||
const separator = purl.includes('?') ? '&' : '?'; |
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.
It feels like this is redundant, since we can't ever generate a package URL that includes a ?
right now?
(I guess, more broadly, I'm not quite clear on why this is separated from the basic PURL generation in the model.)
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.
I'm not quite clear on why this is separated from the basic PURL generation in the model
I initially implemented the same property on the crate
model too and wanted to DRY it up 😉
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.
Thanks for that!
This PR adds Package URL (PURL) support to crate pages, enabling better integration with software supply chain and security tools. PURLs follow the format
pkg:cargo/{name}@{version}
and are displayed in the sidebar metadata section with click-to-copy functionality.This is a frontend-only implementation that generates PURLs client-side using existing crate data. The display uses ellipsis overflow with a tooltip showing the full PURL.
On
staging.crates.io
(and everywhere that is nocrates.io
itself) it will append arepository_url
qualifier (see package-url/purl-spec#215).