KEMBAR78
bump: output lower upstream version by samford · Pull Request #20640 · Homebrew/brew · GitHub
Skip to content

Conversation

samford
Copy link
Member

@samford samford commented Sep 5, 2025

  • 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 style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Currently brew bump will output unable to get versions for the livecheck (or Repology) version if it's lower than the current package version. This makes it impossible to distinguish between a failing livecheck and one where the livecheck version is lower. We can detect when the package version is newer than the upstream version but bump doesn't do anything to handle the situation.

This addresses the issue by updating bump to display the lower upstream version and flag the current version with a trailing "(newer than upstream)" parenthetical to make the situation apparent (and so we can easily search for this text in the output). For example:

==> example
Current cask version:     1.2.4 (newer than upstream)
Latest livecheck version: 1.2.3
==> example
Current cask version:     arm:   1.2.4 (newer than upstream)
                          intel: 1.2.0
Latest livecheck version: arm:   1.2.3
                          intel: skipped

Besides that, I've set bump to skip duplicate PR checking if the current version is newer than upstream (or if both the current ARM/Intel versions are newer than upstream), as we only need to check for duplicate PRs if the upstream version is newer.


For what it's worth, I did brew bump runs across homebrew/core and homebrew/cask and didn't encounter any issues. That's not to say that this is definitively free of bugs but it's at least broader in scope than the manual testing I did while working on this.

The bump logic can be a little tricky to follow in places, so check my work and let me know if I've overlooked anything (especially conditional logic).

Currently `brew bump` will output `unable to get versions` for the
livecheck (or Repology) version if it's lower than the current
package version. This makes it impossible to distinguish between a
failing livecheck and one where the livecheck version is lower. We can
detect when the package version is newer than the upstream version but
`bump` doesn't do anything to handle the situation.

This addresses the issue by updating `bump` to display the lower
upstream version and flag the current version with a trailing "(newer
than upstream)" parenthetical to make the situation apparent (and so
we can easily search for this text in the output).
@samford samford force-pushed the bump-output-lower-livecheck-version branch from 6d2fc4a to b22d232 Compare September 5, 2025 20:25
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.

Seems reasonable, thanks!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Sep 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 8, 2025
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Sep 8, 2025
Merged via the queue into main with commit c5b8cc9 Sep 8, 2025
36 checks passed
@MikeMcQuaid MikeMcQuaid deleted the bump-output-lower-livecheck-version branch September 8, 2025 07:58
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.

2 participants