Skip to content

bump-cask-pr: error when update fails#22901

Merged
samford merged 1 commit into
mainfrom
bump-cask-pr-error-when-update-fails
Jul 2, 2026
Merged

bump-cask-pr: error when update fails#22901
samford merged 1 commit into
mainfrom
bump-cask-pr-error-when-update-fails

Conversation

@samford

@samford samford commented Jun 28, 2026

Copy link
Copy Markdown
Member

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • AI was used to generate or assist with generating this PR.

With the new approach to version/checksum modification that was introduced recently (#22462), 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.


For context, I encountered this issue while looking through homebrew-cask autobump logs. For example, the r-app cask is unable to be autobumped to the latest version because it uses arch-specific versions nested in an on_big_sur :or_newer block, which bump-cask-pr doesn't attempt to modify (i.e., unsupported_nested_arch_stanza?(contents, :version, arch) is true for both archs in replace_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).

Copilot AI review requested due to automatic review settings June 28, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_checksum produces 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.

Comment thread Library/Homebrew/dev-cmd/bump-cask-pr.rb Outdated
Comment thread Library/Homebrew/dev-cmd/bump-cask-pr.rb Outdated
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.
@samford samford force-pushed the bump-cask-pr-error-when-update-fails branch from 23495e5 to 3d6c338 Compare June 29, 2026 01:24
@github-actions github-actions Bot mentioned this pull request Jul 2, 2026
8 tasks
@samford samford added this pull request to the merge queue Jul 2, 2026
Merged via the queue into main with commit f0bc156 Jul 2, 2026
41 checks passed
@samford samford deleted the bump-cask-pr-error-when-update-fails branch July 2, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants