bump-formula-pr: check duplicate PRs as early as possible #8022
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 style
with your changes locally?brew tests
with your changes locally?As discussed in #8011, this PR changes
brew bump-formula-pr
to check for any duplicate PRs as early as possible, i.e. right after determining the formula and the tap in which it's contained.This allows
brew bump-formula-pr
to exit early and not have to download anything before checking for duplicate PRs.Example usages:
When an open duplicate PR is found:
When a closed duplicate PR is found:
Other misc. changes:
Fixed a bug introduced in bump-formula-pr: determine url/tag from version #8004 (my bad!) where the
version
stanza isn't updated if all three of--version/--url/--sha256
are specified (or alternatively--version/--tag/--revision
). The specific patch that fixes this is:Replaced all occurrences of
backup_file
with the more accurate nameold_contents
(as suggested in bump-formula-pr: restore formula if duplicate PR exists #8011)