Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add spec for
brew
package URLs #281base: master
Are you sure you want to change the base?
Add spec for
brew
package URLs #281Changes from 1 commit
5e94a65
d1ebec9
9ae6363
ca87bdd
9f288b0
ba01dcb
2d0348d
0ecae1b
7cd6265
ac6e582
f8fd63e
584a4e4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
question (non-blocking): When thinking about the examples below, I think you should clarify how purl spec should handle version-in-formula formulae.
As in, if I want PostgreSQL 12.17 (current release as of this posting), should the purl be
or
and let whatever's reading the purl — Homebrew, ostensibly — figure out how that version maps to our major-version formulae?
I speculate only the latter is a valid purl, a safe assumption because I don't think it's a good idea to allow two
@
in the purl.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 calling this out -- my read of the purl spec is that the name and other components are always URL-escaped, e.g.
pkg:brew/postgresql@12@12.17
would actually be encoded aspkg:brew/postgresql%4012@12.17
in a "wire format" context. So the purl should always unambiguously map to a package, without the end client having to do additional disambiguation work.This is a readability sacrifice, but my (potentially wrong) understanding is that purls are mostly meant to show up only in machine-readable contexts anyways.
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.
Sigh, it's not pretty, but if that's the way it needs to be, so be it. If that's the case, I'd recommend adding an example with that…
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.
Done! Looks like the other examples for other ecosystem purls also contain URL-escaping examples, so we're in-line here 🙂
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.
pkg:brew/postgresql@12@12.17
is incorrect. The instructions for parsing a PURL (which not all implementations follow) say to split on@
from the right, so it should parse as you expect for Homebrew, but the spec says that@
must always be escaped when it's not being used as the delimiter before the version number. It'd definitely be good to have an example and maybe even call this out since it's common for people to install packages with names like this.giterlizzi/perl-URI-PackageURL has name "postgresql" version "12" (and discards the "12.17")
maenchen/purl, sonatype/package-url-java have name "postgresql" version "12@12.17"
package-url/packageurl-js throws an error (I thought I saw a fix for this, but maybe the PR hasn't merged)
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.
Yep, I added @colindean's example below. Adding an explicit callout also makes sense to me; I'll add some language for that.
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.
question (non-blocking): Should there be another parameter to name the tap? We use the named tap at work, e.g.
and the formula, uh,
myco-ctl
could have a purland brew would know how to name the tap if it needed to be tapped, or perhaps
or more simply
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.
My 0.02c would be for your first form:
I think that's unambiguous: the
github.com/{org}/homebrew-{tap}
logic only applies when atap_url
isn't present, so I think this is the shortest form that conveys all needed information. But maybe I've overlooked something?