153 Commits

Author SHA1 Message Date
Sam Ford
01cb74e525
livecheck: clarify livecheckable language
Formulae, casks, and resources have a `#livecheckable?` method that
indicates whether they contain a `livecheck` block. This is intended
to be read as "has a livecheckable?", not "is livecheckable?" (as
livecheck can find versions for some packages/resources without a
`livecheck` block). Unfortunately, correct understanding of this
method's behavior [outside of documentation] relies on historical
knowledge that few people possess, so this is often confusing to
anyone who hasn't been working on livecheck since 2020.

In the olden days, a "livecheckable" was a Ruby file containing a
`livecheck` block (originally a hash) with a filename that
corresponded to a related formula. The `livecheck` blocks in
livecheckable files were integrated into their respective formulae in
August 2020, so [first-party] livecheckables ceased to exist at that
time. From that point forward, we simply referred to these as
`livecheck` blocks.

With that in mind, this clarifies the situation by replacing
"livecheckable" language. This includes renaming `#livecheckable?` to
`#livecheck_defined?`, replacing usage of "livecheckable" as a noun
with "`livecheck` block", replacing "livecheckable" as a boolean with
"livecheck_defined", and replacing incorrect usage of "livecheckable"
as an adjective with "checkable".
2024-12-02 10:13:03 -05:00
Sam Ford
1cbcc44cb4
bump: skip PR checking when livecheck fails
`brew bump` will check for PRs related to a package even if livecheck
fails to identify new versions. This reworks related conditions to
ensure that related PR checks are only run when livecheck returns
version information.
2024-11-24 20:50:39 -05:00
Sam Ford
a89457fcb9
bump: skip PR checking when up to date
`brew bump` will check for PRs related to a package even if the
package version and livecheck version are the same. We're presumably
only interested in related PRs when the livecheck version differs, so
we can reduce GitHub API requests by skipping the check(s) when the
versions are equal. We use `bump` in `autobump` workflows, so this
should help with recent rate limiting issues (e.g., 3203 out of 3426
autobumped formulae were up to date in a recent run).

This also reworks the output for duplicate PRs, making it clear when
`bump` skipped checking PRs (as printing "none" would suggest that
PRs were checked) and only printing the "Maybe duplicate" information
when checked. This makes it a little easier to understand what `bump`
has done internally from the output.
2024-11-24 20:50:37 -05:00
Klaus Hipp
837bc711b9
dev-cmd/bump: fix comparison of versions with comma-separated values 2024-10-02 17:18:41 +01:00
Rui Chen
09b71befb4
revert tap_remote_repository change
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-09-25 10:03:17 -04:00
Rui Chen
b178a80220
update tap_remote_repo ref
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-09-25 10:00:00 -04:00
Rui Chen
7655a6f91a
chore: remote_repo -> remote_repository
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-09-25 09:52:41 -04:00
Carlo Cabrera
800df2a284
Improve error message
Co-authored-by: Markus Reiter <me@reitermark.us>
2024-09-06 16:39:55 +08:00
Carlo Cabrera
e6dd9fbd9c
Use tap#autobump 2024-09-02 22:10:05 +08:00
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