bump: output lower upstream version #20640
Merged
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 stylewith your changes locally?brew typecheckwith your changes locally?brew testswith your changes locally?Currently
brew bumpwill outputunable to get versionsfor 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 butbumpdoesn't do anything to handle the situation.This addresses the issue by updating
bumpto 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:Besides that, I've set
bumpto 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 bumpruns 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
bumplogic 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).