Add configuration to new appcast check#6155
Add configuration to new appcast check#6155MikeMcQuaid merged 3 commits intoHomebrew:masterfrom core-code:master
Conversation
|
btw, i can also contribute pre-made "configurations" to get around 50 casks to automerge provided this is merged: |
|
thanks! |
|
i think this is working fine now, as already evidenced e.g. here Homebrew/homebrew-cask#63701 two more notes regarding cask auto-merging and appcast-checking 1.) some appcasts (e.g. objective-see.com ) are delivered by the webservers in GZIP form. i've done some research but couldn't find a a way to prevent that in the 2.) i think the appcast checking works fine for the main cask repo, but has a higher false-positive rate in other repositories, especially in the versions repo (where most appcast stanzas are low quality) and in the font repo. it could be beneficial to turn on the appcast checking only for the main repo, but i don't know how to do that |
|
Great job, @core-code, thank you! Looking at the PRs, though, I’m seeing |
at first i tried e.g.
but while that worked, it failed the style check (of the caskfile) and style --fix suggested to use
which works too and passes the style check. maybe it also works without the .to_s - i don't know since i didnt try it. can do some experiments here if you want. |
|
thanks, i've edited the top post to remove the unnecessary to_s in case someone comes back here. in any case, should i try to send pull requests for those 50 casks mentioned above, or is preferred to just add them one demand when and if those casks are updated? |
| def initialize(uri, **parameters) | ||
| @uri = URI(uri) | ||
| @parameters = parameters | ||
| @configuration = parameters[:configuration] if parameters.key?(:configuration) |
There was a problem hiding this comment.
No need for the if here, it will be nil if the key doesn't exist anyways.
No preference. If it’s beneficial to you to have them already updated, said updates will be merged. Otherwise, this is not urgent and we can fix cases as they come by. |
|
ok lets do it as-they-come then ;) |
brew stylewith your changes locally?brew testswith your changes locally?This a followup to PR #5972
Recap: PR #5972 introduced an optional new flag '--appcast' to 'brew cask audit' that checks whether the version stanza is contained in the downloaded appcast. This allows the Travis CI check to fail for submitted PRs that are for unofficial/beta versions, this preventing automerging by @BrewTestBot.
However, this also prevents auto-merging Cask PRs for a lot of fine PRs. This PR is meant to address that. Changes:
1.) the 'curl_output' call to download the appcast is changed to follow redirects. we've seen quite a lot of failures because the appcast URL actually leads to an redirect. following the redirect in the cask itself is not always appropriate, so the appcast check should be adjusted to be able to follow the redirect
2.) as discussed many times previously the new appcast check is not 'perfect' because many appcasts do not contain the whole version stanza in unmodified form. this PR fixes this problem by allowing the appcast stanza to be annotated to specify which part or which transformation of the version stanza is actually contained in the appcast, therefore allowing the appcast check to succeed and those PRs to be automerged
3.) some appcasts do not contain the version number at all, but automerging PRs for these casks may still be desired. therefore this patch allows to disable the appcast check as needed
examples:
cask 'visual-paradigm'
the appcast ( https://www.visual-paradigm.com/downloads/vp/checksum.html ) does not contain the while version number ( currently 15.2,20190501 ) but just the last part which constitutes the build number. currently all PRs for visual-paradigm fail Travis and can not be automerged. using this PR we can now annotate the appcast stanza with the 'configuration' option which properly makes the appcast check search just for the build number in the appcast:
other transformations work similarly. i guess you could even specify 'context', if you want the appcast e.g. to contain "Version #{version} released"
another example, cask 'p4v' the appcast ( https://cdist2.perforce.com/perforce/r18.4/bin.macosx1013x86_64/SHA256SUMS ) only contains checksums and therefore doesn't contain the version number at all. the appcast is still useful because it can be observed for changes. however, we don't want the fact that it doesn't contain version numbers prevent auto-merging for this cask. now we can just change the appcast to
which instructs the appcast check to skip checking the appcast despite the --appcast flag which travis passes.
cc @reitermarkus @vitorgalvao