-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: support addtional url parameters in homebrew cask #5800
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
feat: support addtional url parameters in homebrew cask #5800
Conversation
Using string `yaml:"using,omitempty" json:"using,omitempty"` | ||
Cookies map[string]string `yaml:"cookies,omitempty" json:"cookies,omitempty"` | ||
Referer string `yaml:"referer,omitempty" json:"referer,omitempty"` | ||
Headers []string `yaml:"headers,omitempty" json:"headers,omitempty"` |
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.
The name of the parameter actually required is header
,
but in the Homebrew Formula config, it is written as headers
. ref
So I also use headers
here to reduce migration costs from Formula to Cask.
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 should write this note into code maybe
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.
added: 949157e
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.
Nice! Looking good so far!
Thank you!
@caarlos0 While this would reduce migration costs from Formula, I feel there are too many settings starting with I've implemented it by grouping the additional parameters for now, and I'd like your opinion on this. |
Ah I forgot to update docs. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5800 +/- ##
=======================================
Coverage 82.93% 82.93%
=======================================
Files 163 163
Lines 16297 16298 +1
=======================================
+ Hits 13516 13517 +1
Misses 2190 2190
Partials 591 591 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@caarlos0 While looking at the Cask documentation, I found that there are also additional parameters like these. |
url_template: "https://github.mycompany.com/foo/bar/releases/download/{{ .Tag }}/{{ .ArtifactName }}" | ||
|
||
# Additional URL parameters for Homebrew Cask downloads. | ||
# These parameters can be used to provide extra headers, cookies, or other | ||
# download requirements for your application. | ||
# See https://docs.brew.sh/Cask-Cookbook#additional-url-parameters for more details. | ||
# | ||
# All parameters are optional and will only be included in the generated cask | ||
# if explicitly configured. No default values are set. | ||
# Templates: allowed. | ||
url_additional: |
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.
mostly a todo for me, butt maybe we can wrap this as all as:
url:
template: "{{ ... }}"
verified: ""
using: ""
# etc
wdyt? 🤔 if think this looks better I can do it in a subsequent PR
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.
Certainly, consolidating the URL settings might be a good idea!
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.
@caarlos0
However, if a significant number of users have configured url_template
in Homebrew Forumula,
it would be advisable to prepare a Migration Guide (or some lighter docs)
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 am interested in it anyway.
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.
merged, thanks @sushichan044 🙏 |
one-shot this quickly so I don't forget about it refs #5800 (comment) closes #5797
url
parameters in Homebrew Cask #5797This change will enable users to generate Homebrew Cask definitions with additional parameters, documented as follows:
https://docs.brew.sh/Cask-Cookbook#additional-url-parameters
A specific use case is the ability to achieve automated releases with GoReleaser, even for Casks that require authentication for downloads or demand special cookies.