-
Notifications
You must be signed in to change notification settings - Fork 167
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
#281
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: William Woodruff <william@trailofbits.com>
CC @p-linnane @SMillerDev @colindean for thoughts as well 🙂 |
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 major nit and a few non-blocking questions and suggestions
PURL-TYPES.rst
Outdated
- Qualifier ``tap_url``: for taps that are not on GitHub or otherwise require an explicit URL, | ||
this is the full URL to the tap. |
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.
brew tap myco/brewhouse git@git.myco.com:brew/house.git
and the formula, uh, myco-ctl
could have a purl
pkg:brew/myco/brewhouse/myco-ctl?tap_url=git@git.myco.com:brew/house.git
and brew would know how to name the tap if it needed to be tapped, or perhaps
pkg:brew/myco/brewhouse/myco-ctl?tap_url=git@git.myco.com:brew/house.git&tap_name=myco/brewhouse
or more simply
pkg:brew/myco-ctl?tap_url=git@git.myco.com:brew/house.git&tap_name=myco/brewhouse
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:
pkg:brew/myco/brewhouse/myco-ctl?tap_url=git@git.myco.com:brew/house.git
I think that's unambiguous: the github.com/{org}/homebrew-{tap}
logic only applies when a tap_url
isn't present, so I think this is the shortest form that conveys all needed information. But maybe I've overlooked something?
Co-authored-by: Colin Dean <colindean@users.noreply.github.com>
Co-authored-by: Colin Dean <colindean@users.noreply.github.com>
Co-authored-by: Colin Dean <colindean@users.noreply.github.com>
Signed-off-by: William Woodruff <william@trailofbits.com>
@MikeMcQuaid 👋 A quick review or ack from you would awesome! |
Thanks! |
According to Stack Overflow, you cannot install a specific version. |
Both TL;DR yes, there is no way to install a specific minor version, e.g. postgres 16.1. Link for reference: https://github.com/Homebrew/homebrew-core/blob/master/Formula/p/postgresql%4016.rb |
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 good to me!
Gentle ping for review+approval here: this is no longer a blocker in Homebrew's attestation work, but I'd like to get it in so that we can consider it for any future attestation changes, if necessary 🙂 |
Another gentle ping for review 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.
+1 for merging this.
I think it's important for this PR to add entries to the test suite. Package names can contain the There's also a common misimplementation of the parsing spec which can cause problems here. The spec says "Split the remainder once from the right on '@'. The left side is the remainder. Percent-decode the right side. This is the version." However, some implementations split once from the left on '@'. If somebody writes
{
"description": "brew names may contain at signs",
"purl": "pkg:brew/postgres%4016",
"canonical_purl": "pkg:brew/postgres%4016",
"type": "brew",
"namespace": null,
"name": "postgres@16",
"version": null,
"qualifiers": null,
"subpath": null,
"is_invalid": false
},
{
"description": "brew may contain multiple at signs",
"purl": "pkg:brew/postgres@16@16.1",
"canonical_purl": "pkg:brew/postgres%4016@16.1",
"type": "brew",
"namespace": null,
"name": "postgres@16",
"version": "16.1",
"qualifiers": null,
"subpath": null,
"is_invalid": false
} |
Makes sense, although the ship has since sailed on the main backing feature that I needed this for (Homebrew's build provenance feature, which instead uses Homebrew's own wheel filename format for its subject).
Edit: @colindean has graciously done this 🙂 |
Copypasted verbatim from package-url#281 (comment)
Adds Homebrew test cases
💪 I like this test case setup. |
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.
@woodruffw I got one wrong upon reviewing the unresolved comments. Please merge this suggestion.
@matt-phylum I think the rest of the comments can be resolved.
Co-authored-by: Colin Dean <colindean@users.noreply.github.com>
Is there an update on this issue? I came here to submit a similar issue and was glad to see this but it's been open for 9 months now. Any ETA on review? |
From the perspective of the Homebrew upstream, this has been done and is ready for final review/merge since June. It'd be nice to have a repository owner to shepherd this, although I'm not exactly sure who that'd be (@pombredanne perhaps? 🙂) |
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.
please also remove brew
from the list "Other candidate types to define"
Signed-off-by: William Woodruff <william@trailofbits.com>
Done with f8fd63e; PTAL. |
Thank you for your PR @woodruffw. When you have the chance, could you please resolve the conflicts referred to below? |
Resolve merge conflict
This should be good to go again thanks to @colindean -- @johnmhoran @jkowalleck PTAL |
@johnmhoran @jkowalleck Is there any chance this can be merged in the next few days? |
need to do some detailed research, before i can actually approve the PR. |
Thanks for that timeline clarity and for the depth of review. The next great window for this would be in time for Homebrew's annual meeting on February 3. |
This adds the
brew
purl type.Closes #254.