316 Commits

Author SHA1 Message Date
Štefan Baebler
5627a90652
dev-cmd/bump-formula-pr: release notes as proper html link
The release notes link is not rendered as a proper hyperlink, this fixes it.

Few examples of PRs with unclickable links:
* https://github.com/Homebrew/homebrew-core/pull/228256
* https://github.com/Homebrew/homebrew-core/pull/228263
* https://github.com/Homebrew/homebrew-core/pull/228267
2025-06-27 18:52:43 +02:00
Bo Anderson
bf6f813492
dev-cmd/bump-formula-pr: handle null body 2025-06-12 04:48:15 +01:00
Mike McQuaid
3f15e0eef0
dev-cmd/bump-formula-pr: fix style. 2025-05-26 08:40:14 +01:00
Gibson Fahnestock
97acfb94ce
bump-pr: respect --write-only flag and skip git operations
The flag used to work well, but at some point started to run more and
more git actions. We use this to update formula and casks in other
homebrew taps, and it works well except for this issue.
2025-05-24 13:14:00 +01:00
Mike McQuaid
4aa7f83954
dev-cmd/bump-formula-pr: use Formatter.truncate.
Add new `Formatter.truncate` method, tests and use it.
2025-05-21 17:02:18 +01:00
Issy Long
63cdd0723c
Truncate long release notes in formula PR descriptions
- Some formula bumps have really long release notes which causes their
  bump PRs to exceed GitHub's 65k character limit for issue bodies.
2025-05-21 13:20:48 +00:00
Bevan Kay
effb07ee76
bump-formula-pr: fix case when only url is provided 2025-05-20 21:23:52 +10:00
botantony
18296808a2 dev-cmd/bump-*-pr: change autobump package message
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
Bevan Kay
b255a670c0
bump-formula-pr: restore pr message 2025-04-23 14:45:15 +10:00
Bevan Kay
2b132c0802
dev-cmd/bump-formula-pr: fix reference 2025-04-22 22:03:18 +10:00
Bevan Kay
c5a3879fdb
bump: bump synced formula together 2025-04-22 22:03:06 +10:00
Mike McQuaid
7873f0200f
Revert "bump: bump synced formula together" 2025-04-22 12:33:59 +01:00
Bevan Kay
7ccdc340a3
bump: bump synced formula together 2025-04-16 22:49:14 +10:00
Mike McQuaid
108ecf9aac
dev-cmd/bump-*: only warn on duplicate PRs for official taps.
The default behaviour is too strict for unofficial taps. We can still
warn elsewhere but, given the potential for false positives, let's
loosen things a bit.
2025-04-01 11:01:17 +01:00
Douglas Eichelberger
e58486cd4c
fix: Allow Formula.url with no args to get url 2025-03-26 12:15:25 -07:00
Nanda H Krishna
22da03e887
Fix type errors 2025-01-22 01:45:19 +05:30
Nanda H Krishna
f69478bc1d
dev-cmd/bump-formula-pr: automatically bump matched-version resources 2025-01-22 01:39:41 +05:30
Douglas Eichelberger
e1fdd2eda4 Enable strict typing in NamedArgs 2024-12-03 17:43:22 -08:00
Sutou Kouhei
0c3e207b24 dev-cmd/bump-formula-pr: fix type error
The error message:

    Error: Parameter 'formula': Expected type String, got type Formulary::FormulaNamespace87ec47e7f9dec2f39e30adcc9fdea28fb57606eab88d4f83e8ebec591964143c::ApacheArrow with value #<Formula apache-arrow (sta...ore/Formula/a/apache-arrow.rb>
    Caller: /opt/homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:152
    Definition: /opt/homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:417 (Homebrew::DevCmd::BumpFormulaPr#check_for_mirrors)
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/configuration.rb:296:in `call_validation_error_handler_default'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/configuration.rb:303:in `call_validation_error_handler'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/call_validation.rb:310:in `report_error'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/call_validation.rb:218:in `block in validate_call'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/signature.rb:213:in `each_args_value_type'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/call_validation.rb:215:in `validate_call'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
    /opt/homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:152:in `run'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/call_validation.rb:270:in `bind_call'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/call_validation.rb:270:in `validate_call'
    /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11618/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
    /opt/homebrew/Library/Homebrew/brew.rb:94:in `<main>'
    Please report this issue:
      https://docs.brew.sh/Troubleshooting

This happened when I use the following command line:

    brew bump-formula-pr \
         --commit \
         --no-audit \
         --sha256="abcf1934cd0cdddd33664e9f2d9a251d6c55239d1122ad0ed223b13a583c82a9" \
         --url="https://www.apache.org/dyn/closer.lua?path=arrow/arrow-18.0.0/apache-arrow-18.0.0.tar.gz" \
         --verbose \
         --write-only \
         apache-arrow
2024-10-29 06:42:29 +09:00
Dawid Dziurla
02cef968a2
dev-cmd/bump-formula-pr: always use full git repo as tap remote 2024-10-15 10:20:58 +02: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
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Sam Ford
24ac6967ba
Adjust typing around #check_pull_requests
`brew bump-formula-pr` is encountering a type error, as the inferred
return type of `GitHub#check_for_duplicate_pull_requests` doesn't
align with the explicit return type of `#check_pull_requests`:

```
Error: Return value: Expected type T.nilable(T::Array[String]), got
  type Module with value T::Private::Types::Void::VOID
Caller: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/
  bump-formula-pr.rb:137
Definition: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/
  dev-cmd/bump-formula-pr.rb:472 (Homebrew::DevCmd::BumpFormulaPr
  #check_pull_requests)
```

This addresses the issue by adding a type signature with a `void`
return type to `#check_for_duplicate_pull_requests` and setting the
return type of `#check_pull_requests` to `void` as well. The return
type from `#check_pull_requests` isn't used, so a `void` return type
is arguably a better reflection of the method's behavior. The
`#check_pull_requests` method in `BumpCaskPr` has a `void` return
type, so this change brings the `BumpFormulaPr` method in line.
2024-08-31 16:42:43 -04: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
Ruoyu Zhong
640f3c904a
dev-cmd/bump-formula-pr: fix missing require
Fixes https://github.com/Homebrew/homebrew-core/actions/runs/9931895403/job/27432438142#step:6:716.
2024-07-14 23:17:45 -04:00
Issy Long
517d3c9bcf
dev-cmd/bump-formula-pr: Fix types for fetch_resource_and_forced_version
- This should fix https://github.com/Homebrew/homebrew-core/actions/runs/9839505520, that is:

```
Parameter 'tag': Expected type Float, got type String with value "2024-07-05"
Caller: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11473/lib/types/private/methods/call_validation.rb:215
Definition: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:445 (Homebrew::DevCmd::BumpFormulaPr#fetch_resource_and_forced_version)
```

- I think I read https://sorbet.org/docs/sigs#rest-parameters too literally,
  yes Sorbet expands the kwargs into a hash type, but it's the value type that
  needs specifying in the sig (which for us is `String`).
2024-07-08 18:46:21 +01:00
Issy Long
58fb8afa2f
dev-cmd/bump-formula-pr: formula_version is Version not String
- Fixes https://github.com/Homebrew/brew/issues/17626.
2024-07-04 17:52:38 +01: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
Issy Long
b6f142f7a9
Fewer T.musts 2024-07-03 19:53:37 +01:00
Issy Long
9baf50af29
Get rid of even more T.musts
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-07-03 15:04:18 +01:00
Issy Long
3d09094df0
Fewer T.musts 2024-07-02 16:20:39 +01:00
Issy Long
8360218a3e
Run brew style on all the new Sorbet sigs 2024-07-01 19:16:57 +01:00
Issy Long
8587f4ba11
dev-cmd/bump-formula-pr: Bump to Sorbet typed: strict 2024-07-01 13:14:47 +01:00
Mike McQuaid
c13700af00
Use repository consistently instead of repo
The documentation linting job doesn't like `repo` so let's fix this
globally rather than naming it differently in documentation and code.
2024-06-10 09:31:53 +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
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
Michael Cho
4b65052b22
dev-cmd/bump-formula-pr: deprecate throttled_formulae.json
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-04-01 00:54:36 -04: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
Douglas Eichelberger
dc062bea52 Port Homebrew::DevCmd::PrPull 2024-03-22 09:33:28 -07: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
d873881c47 Port Homebrew::DevCmd::BumpFormulaPr 2024-03-20 10:25:17 -07:00
Eric Knibbe
afbf6a1e2c
bump-formula-pr: fix type of detected version
Fixes #16917.
2024-03-19 22:44:05 -04:00
Michael Cho
709afd58ed
dev-cmd/bump-formula-pr: replace partial version in URL
For now, restrict to partial version excluding the last part, i.e.
version with major.minor.patch will result in attempting to replace any
occurrences of "/#{major}.#{minor}/" or "/v#{major}.#{minor}/".

This should take care of common situations like GNOME, KDE, and
SourceForge URLs. It should also help with URLs like `util-linux`.

It may result in incorrect replacements if URL has partial version based
on another versioning scheme like the API version or if there are some
equivalent numbers in URL that happen to match

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-17 13:03:43 -04:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00: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
Mike McQuaid
8d463b1f4b
Merge pull request #16772 from cho-m/pypi-specify-dependencies
utils/pypi: specify dependencies needed to update resources
2024-03-04 09:24:51 +00:00
Michael Cho
216f571fff
bump-formula-pr: switch to install resource update dependencies
Also same feature for update-python-resources
2024-03-02 22:01:31 -05:00
Michka Popoff
f96290eb39
bump-formula|cask-pr: do not allow to bump autobumped packages
Avoids:
- Bumping stuff by mistake that will get autobumped anyway
- Abusing the system to get "free" commits
2024-03-01 09:15:43 +00:00