There are two big changes here. Both have to do with how we want
to load casks in different scenarios. One also is related to formulae.
1. Prevent loading casks & formulae outside of taps for specific commands.
There are certain commands like `bump`, `bump-*-pr`, `livecheck` and `audit`
where it really makes no sense to try and run things if the specified formulae
or cask is not in a tap. A new `#to_formulae_and_casks_with_taps` method was
added to the `CLI::NamedArgs` class to allow us to easily grab and validate
formulae and casks from named arguments.
2. Always load the source file path when loading casks with the path loader.
There was an edge case where all JSON cask files were being loaded without
setting the source file path because most of the work was handed off to the
API loader where that normally would make more sense. Now we set that when
calling the API loader which solves the problem. This improves the user
experience of people using the `--cache` and `fetch` commands in certain
edge cases. Hopefully it makes the user experience a bit more consistent.
A regression test was added for this point.
Don't let users open more than 15 PRs at a time. We have other tooling
to nudge them to not do this but let's put it in the worst offenders:
the `bump*` commands.
Instead output a message that corresponding formula/cask is on the
autobump list. This avoids deferring the information to the error
message within `bump-{formula,cask}-pr`.
Signed-off-by: Michael Cho <michael@michaelcho.dev>
* tap: take ownership of synced_versions_formulae.json
* formula: add synced_with_other_formulae? logic
Signed-off-by: Michael Cho <michael@michaelcho.dev>
If there are duplicate PRs: we shouldn't suggest and allow a trivial
override. Instead, they should be created manually.
An undocumented override exists for BrewTestBot to do autobumps.
- This will give some information to users of `brew bump` that they
should keep the version of the formula in sync with other formulae.
- A future enhancement is actually making the bumping of the "related"
formulae automatic with `--open-pr`. But for now, telling people so
that they don't have to wait until `brew audit` fails either locally
or in CI at a later stage is a good start.
- Instead, let the `pull_requests&.any?` check do its job and not show
PRs that we couldn't find or fetch.
- In the `--debug` output, show the error message that we got from GitHub.
Even though the command already sets without_api that only
affects how named args are loaded. In this command, we used to load
many formulae and casks all at once using the API according to
user settings. Now we just mandate that all loading must skip the API.
Currently we only check for closed PRs in
`bump-cask-pr`. This adds that check to `bump`
and `bump-formula-pr`. The idea is that this
check can warn users about already updated
packages or those that can't be updated
easily and should be updated manually instead.