Repository navigation
Keep the Homebrew cask intact when its layout changes - #752
Conversation
Make the release's Homebrew update survive changes Homebrew makes to the cask, and fail visibly when it cannot: the step rebuilt gitx.rb by line number, so one line added near its top produces a cask Ruby rejects, and the job would still open the pull request with it. - Move the update into scripts/update-homebrew-cask.sh, which replaces only the version and the two checksums, wherever they sit - Fail the release job, leaving the cask alone, when those values are not each found exactly once, instead of sending a broken cask - Keep the rest of the step order, the PR template and the PR as is
|
I see a new behavior in brew, I got the first notification with Homebrew/homebrew-cask#291706 (comment), then brew creates a new one Homebrew/homebrew-cask#291707. Only with the first one (made by us) I receive a notification. Without the first one, I'll complete out of notification |
|
As brew inform us on issues Homebrew/homebrew-cask#291707 (comment) I give it a try |
|
Ahh my bad. I merged this one, but my intention was to merge that Leave the Homebrew cask bump to Homebrew's autobump |
Well, this is a step in the right direction, and I've closed the one you are talking about so will not be merged by mistake... Will revive that PR and confirm it doesn't collide with the current 'master'. |
PR is revived - see PR #747 |
Make the release's Homebrew update survive changes Homebrew makes to the cask, and fail visibly when it cannot. This is the alternative to #747: the release job keeps opening its own bump PR, so the result is still immediate and the notifications still reach the PR's author, but the cask is no longer rebuilt by line number.
The step kept lines 1-3 and 7-33 of
Casks/g/gitx.rbaround a freshly written version and checksums. With one line added near the top (Homebrew last changed this cask in April, addingdepends_on macos), it writes theintel:checksum line twice, which Ruby rejects as a syntax error, and the job still opens the pull request with it.Changes
scripts/update-homebrew-cask.sh: it replaces only the version and the two checksums, wherever they sit in the file, and leaves everything else exactly as Homebrew keeps it. Being a script, it runs the same locally as in the release job.on_arm/on_intelblocks), instead of sending a broken cask. A failed run notifies whoever pushed the tag.Test plan
Ran the old step and the script on today's cask (from Homebrew/homebrew-cask) with the 1.6 disk images, and on variants of it:
ruby -c; the script changes exactly the three lines.ruby -candbrew style.on_arm/on_intelblocks, or theintel:line doubled: the script fails with a message and leaves the cask unchanged.