bump: print skip status, message(s), and errors#21746
Merged
MikeMcQuaid merged 1 commit intomainfrom Mar 17, 2026
Merged
Conversation
51049e3 to
6edf5da
Compare
6 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Updates brew bump to better surface livecheck “skip”/message/error states (similar to brew livecheck) by treating these outputs as first-class “message” values instead of special-casing a couple of exact strings.
Changes:
- Adjust
livecheck_resultoutput formatting for skip information and propagate those results through bump’s version selection logic. - Introduce a
message?helper to identify message-like strings/values viaLIVECHECK_MESSAGE_REGEXand replace prior string comparisons. - Add RSpec coverage for
::message?.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Library/Homebrew/dev-cmd/bump.rb | Changes how livecheck skip/results are converted to displayable strings and how bump decides whether a value is a “message” vs a version. |
| Library/Homebrew/test/dev-cmd/bump_spec.rb | Adds unit tests for the new ::message? helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
`brew livecheck` surfaces the skip reason or message in its output (e.g., "deprecated", "skipped - Legacy version") but `brew bump` effectively ignores the `:status` and `:messages` values from `Livecheck::SkipConditions` and only prints "skipped" instead. Sometimes the reason can be inferred from parenthetical annotations (e.g., "(deprecated)" after the current version) but explicit output like "skipped - deprecated" is easier to read when skimming. Omitting a skip message from a `livecheck` block is only done to produce a predictable "skipped" string that can be used for comparison but we can handle that in a more robust way. A related issue we're now facing is that deprecated packages are producing an "unable to get versions" message rather than "skipped". This adds noise and makes it more challenging to identify real livecheck failures in bump output. This addresses these issues by modifying bump to print the skip `:status` and `:messages` values in the output. The way I've handled this, bump will also print error messages. In the process, this adds a `message?` method to check whether a value is a message string, replacing existing conditions that insufficiently check whether a value is a message using strict comparisons like `x != "skipped"` or `x != "unable to get versions"` and ignoring the possibility of error strings. This is still an imperfect way of identifying message strings but it should be an improvement over the status quo. In the future, it may be better to store message strings as something other than a `Cask::DSL::Version` object, so we can distinguish messages from versions without targeting a specific string pattern.
6edf5da to
76c471f
Compare
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.
brew lgtm(style, typechecking and tests) with your changes locally?brew livechecksurfaces the skip reason or message in its output (e.g., "deprecated", "skipped - Legacy version") butbrew bumpeffectively ignores the:statusand:messagesvalues fromLivecheck::SkipConditionsand only prints "skipped" instead. Sometimes the reason can be inferred from parenthetical annotations (e.g., "(deprecated)" after the current version) but explicit output like "skipped - deprecated" is easier to read when skimming. Omitting a skip message from alivecheckblock is only done to produce a predictable "skipped" string that can be used for comparison but we can handle that in a more robust way.A related issue we're now facing is that deprecated packages are producing an "unable to get versions" message rather than "skipped". This adds noise and makes it more challenging to identify real livecheck failures in bump output.
This addresses these issues by modifying bump to print the skip
:statusand:messagesvalues in the output. The way I've handled this, bump will also print error messages. In the process, this adds amessage?method to check whether a value is a message string, replacing existing conditions that insufficiently check whether a value is a message using strict comparisons likex != "skipped"orx != "unable to get versions"and ignoring the possibility of error strings.This is still an imperfect way of identifying message strings but it should be an improvement over the status quo. In the future, it may be better to store message strings as something other than a
Cask::DSL::Versionobject, so we can distinguish messages from versions without targeting a specific string pattern.