Skip to content

bump: print skip status, message(s), and errors#21746

Merged
MikeMcQuaid merged 1 commit intomainfrom
bump-output-skip-status
Mar 17, 2026
Merged

bump: print skip status, message(s), and errors#21746
MikeMcQuaid merged 1 commit intomainfrom
bump-output-skip-status

Conversation

@samford
Copy link
Member

@samford samford commented Mar 16, 2026

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

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.

Copilot AI review requested due to automatic review settings March 16, 2026 17:44
@samford samford force-pushed the bump-output-skip-status branch from 51049e3 to 6edf5da Compare March 16, 2026 17:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_result output formatting for skip information and propagate those results through bump’s version selection logic.
  • Introduce a message? helper to identify message-like strings/values via LIVECHECK_MESSAGE_REGEX and 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.

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks!

`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.
@samford samford force-pushed the bump-output-skip-status branch from 6edf5da to 76c471f Compare March 16, 2026 20:23
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit 28749a7 Mar 17, 2026
38 checks passed
@MikeMcQuaid MikeMcQuaid deleted the bump-output-skip-status branch March 17, 2026 09:14
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