144 Commits

Author SHA1 Message Date
Carlo Cabrera
07d04dd348
dev-cmd/bump: add --auto flag
This will read from the tap's `.github/autobump.txt` when provided.

See discussion at Homebrew/homebrew-core#183126.
2024-09-02 20:01:16 +08:00
Mike McQuaid
fe909c41b8
Improve duplicate pull request handling
- change the messaging depending on how confident we are that we're
  actually looking at duplicates i.e. we're not confident without a
  version number supplied
- similarly, just warn instead of failing with an error (and no
  override) if we're not confident that we're looking at duplicates
  because a version wasn't supplied
- change `bump-cask-pr` and `bump-formula-pr` to always check for all
  pull requests with the new version number (to allow failing on this)
  rather than only checking closed pull requests with a version number
- change `bump` to check for definite/maybe duplicate PRs and only
  exit if they are definitely duplicates
- cleanup some variable usage to DRY things up a bit
2024-08-30 14:21:42 +01:00
Nanda H Krishna
d20add9786
brew bump: more improvements 2024-07-14 23:46:17 -04:00
Nanda H Krishna
32d1f10fcf
Fix style issues 2024-07-14 23:13:59 -04:00
Nanda H Krishna
4b2c9e0651
brew bump: cleanup and improve --eval-all handling 2024-07-14 23:11:34 -04:00
Thierry Moisan
0bb64fd312
Add --repology flag 2024-07-14 16:35:10 -04:00
Thierry Moisan
f4c263f565
brew bump: do not call repology by default 2024-07-14 15:19:46 -04:00
Sam Ford
ae06033afa
bump: add utils/repology require
A recent commit reworked `require`s to improve performance but this
led to an `uninitialized constant Homebrew::DevCmd::Bump::Repology`
error in `brew bump`. This adds a `utils/repology` `require` to
`dev-cmd/bump.rb` to resolve the error.
2024-07-14 10:08:55 -04:00
Issy Long
f2f4f1c06d
sorbet: Tighten up dev-cmd types
- Change `returns(NilClass)` to `void`.
- Get rid of some of the `T.untyped`.
2024-07-04 12:04:29 +01:00
Mike McQuaid
712ca361d7
dev-cmd/bump*: improve autobump messaging.
Let's make it clearer _why_ autobumped PRs cannot be submitted by humans
and, while we're here, similarly for disabled/head-only packages.
2024-05-31 10:23:13 +01:00
Kevin
c44e053847
Merge pull request #17242 from Homebrew/fix-cask-source-file-path-loading-issues
Fix cask source file path loading issues
2024-05-08 18:28:04 -07:00
Mike McQuaid
222fe8ef0b
Homebrew 4.3.0 deprecation/disable/removals.
The usual pass of deprecating/disabling/removing code for the next
minor Homebrew release.
2024-05-07 12:18:04 +01:00
apainintheneck
ffc503f1d0 Fix cask source file path loading issues
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.
2024-05-06 23:34:23 -07:00
Mike McQuaid
acb7f45cfd
dev-cmd/bump: unconditionally skip Repology queries for now.
We've been blocked by Repology so let's stop querying them for now.

Fixes #17021.
2024-04-04 09:43:44 +01:00
Douglas Eichelberger
c50fb2dbd2 Remove redundant cli/parser requires 2024-03-29 18:53:07 -07:00
Mike McQuaid
fe16b14479
dev-cmd/bump*: limit the number of open PRs to 15.
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.
2024-03-28 11:56:25 +00:00
Michael Cho
43e2e28869
dev-cmd/bump-formula-pr: clean up unused code
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-21 10:11:50 -04:00
Michael Cho
bfec6eecac
livecheck: support throttle DSL
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-21 10:11:49 -04:00
Douglas Eichelberger
b48f85f991 Fix nil repositories in dev-cmd bump 2024-03-20 13:40:35 -07:00
Douglas Eichelberger
df42e9cfb3 Port Homebrew::DevCmd::Bump 2024-03-20 10:36:10 -07:00
Mike McQuaid
d3ea535a9a
dev-cmd/bump: handle no formula tap case.
Fixes https://github.com/Homebrew/brew/issues/16913
2024-03-19 08:52:28 +00:00
Bo Anderson
8102e239f9
Merge pull request #16887 from Homebrew/bump-no-repology
dev-cmd/bump: skip Repology checks in CI for livecheckables
2024-03-16 03:13:47 +00:00
Bo Anderson
7b0c3d54f1
utils/github: use GraphQL PR searching 2024-03-15 21:27:05 +00:00
Bo Anderson
f3a99ca676
dev-cmd/bump: skip Repology checks in CI for livecheckables 2024-03-14 03:53:47 +00:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Michael Cho
2d9b352ad7
Merge pull request #16837 from cho-m/bump-replace-untyped-args
dev-cmd/bump: change `args` type to `CLI::Args`
2024-03-07 10:08:38 -05:00
Michael Cho
12d1e56ff5
dev-cmd/bump: skip autobump formulae & casks
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>
2024-03-06 12:34:29 -05:00
Michael Cho
030980164d
dev-cmd/bump: change args type to CLI::Args
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-06 11:13:33 -05:00
Justin Klaassen
009ddd7036
dev-cmd/bump: add --tap= flag 2024-03-05 18:11:53 -08:00
Michael Cho
72f8399110
formula_auditor: move out synced_versions_formulae logic
* tap: take ownership of synced_versions_formulae.json
* formula: add synced_with_other_formulae? logic

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-03 20:51:09 -05:00
Michael Cho
387bfd972e
dev-cmd/bump: hide version syncing when empty list 2024-02-28 14:41:39 -05:00
Patrick Linnane
9092f760fb
dev-cmd/bump: add --no-fork switch
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-02-23 12:20:59 -08:00
Mike McQuaid
7df07b991b
dev-cmd/bump*: do not allow forcing multiple PRs.
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.
2024-02-15 17:02:31 +00:00
Mike McQuaid
3d03ed2710
Merge pull request #16515 from issyl0/bump-point-out-if-formulae-are-synced
dev-cmd/bump: Point out if formulae should be kept in sync with others
2024-01-26 14:04:20 +00:00
Issy Long
bf44e74a01
Fix Sorbet - don't need the T.musts anymore 2024-01-25 23:11:37 +00:00
Issy Long
1b5fa172bb
Split audit_synced_versions_formulae checks into reusable methods
- This way we can use them in the audit and in `bump`.
2024-01-24 14:01:01 +00:00
Issy Long
22203fb6d9
dev-cmd/bump: Be more explicit that we have no PRs
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-01-21 19:41:49 +00:00
Issy Long
c7ed62a7d6
dev-cmd/bump: Point out if formulae should be kept in sync with others
- 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.
2024-01-21 00:43:50 +00:00
Issy Long
de6ec7c54e
dev-cmd/bump: Don't fall over when retrieving PRs errors
- 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.
2024-01-20 16:41:47 +00:00
Eric Knibbe
4259e2ad96
cmd/bump: indicate deprecated or skipped formulae/casks 2023-12-17 16:50:02 -05:00
Bevan Kay
dc2ded859b
Gemfile: load REXML gem for brew bump 2023-12-04 13:03:21 +11:00
Douglas Eichelberger
00ba09d73d Remove use of ActiveSupport try 2023-11-05 09:28:19 -08:00
Eric Knibbe
7c707216a2
dev-cmd/bump: skip head-only & disabled formulae 2023-09-13 18:02:12 -04:00
Eric Knibbe
6235a7f1af
dev-cmd/bump: omit PR lines with --no-pull-requests 2023-09-13 17:59:11 -04:00
apainintheneck
0979f7c35f cmd/bump: add --installed flag
This allows users to only try to bump formulae and casks they
currently have installed. It copies this behavior from the
livecheck command.
2023-08-05 10:01:11 -07:00
apainintheneck
474656ffaa dev-cmd/bump : stop using API to load formulae/casks
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.
2023-08-04 19:08:22 -07:00
Razvan Azamfirei
3949138d5b
format bump block 2023-08-03 09:58:59 -04:00
Razvan Azamfirei
2d330bcd32
bump: add arch-specific support 2023-08-03 09:41:01 -04:00
Douglas Eichelberger
08e46c18cd Add type to Formula attrs 2023-07-24 14:12:36 -07:00
Bo Anderson
bb7aef85db
Migrate remaining no-api commands to new scoped system 2023-06-22 17:11:20 +01:00