bump-cask-pr: error when update fails#22901
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds an early failure guard to brew bump-cask-pr so the command stops before running audit/style when a requested version/checksum update ends up making no changes (e.g., due to unsupported nested on_arch stanzas).
Changes:
- Add a guard to detect when
replace_version_and_checksumproduces unchanged contents. - Raise an error early to prevent proceeding to audit/style with an unmodified cask.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
With the new approach to version/checksum modification that was introduced recently, `bump-cask-pr` doesn't attempt to modify values in an on_arch block that's nested within another block (e.g., on_os). In this scenario, `replace_version_and_checksum` won't modify the provided contents but `bump-cask-pr` won't fail unless/until a subsequent audit fails (e.g., livecheck version mismatch). `bump-cask-pr` shouldn't proceed to the audit or style check steps if the cask hasn't been modified, so this adds a guard to raise an error instead.
23495e5 to
3d6c338
Compare
bevanjkay
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?With the new approach to version/checksum modification that was introduced recently (#22462),
bump-cask-prdoesn't attempt to modify values in an on_arch block that's nested within another block (e.g., on_os). In this scenario,replace_version_and_checksumwon't modify the provided contents butbump-cask-prwon't fail unless/until a subsequent audit fails (e.g., livecheck version mismatch).bump-cask-prshouldn't proceed to the audit or style check steps if the cask hasn't been modified, so this adds a guard to raise an error instead.For context, I encountered this issue while looking through homebrew-cask autobump logs. For example, the
r-appcask is unable to be autobumped to the latest version because it uses arch-specific versions nested in anon_big_sur :or_newerblock, whichbump-cask-prdoesn't attempt to modify (i.e.,unsupported_nested_arch_stanza?(contents, :version, arch)is true for both archs inreplace_version_and_checksum). The update attempt only fails during the audit step, as the cask's versions differ from the livecheck versions (due to being unchanged).