3423 Commits

Author SHA1 Message Date
Rylan Polster
73b64390b3
Use existing Utils::Bottles::Collector#specification_for method 2025-06-05 12:38:15 -04:00
Rylan Polster
e83dc1cb3c
Fallback to older bottle hashes when viable 2025-06-05 11:32:47 -04:00
Rylan Polster
e47bc2fb86
Use hashes of arrays instead 2025-06-05 03:15:44 -04:00
Rylan Polster
b44ec56267
Reduce the internal formula API to contain the bare minimum data 2025-06-05 02:08:29 -04:00
Mike McQuaid
68ef29fb5c
Merge pull request #20045 from Homebrew/fix-sharded-api
Fix sharded API structure to match existing API
2025-06-04 07:58:26 +00:00
Rylan Polster
fa45209f09
Fix sharded API structure to match existing API 2025-06-03 16:58:47 -04:00
Eric Knibbe
3dc9e88542
parser: show related env var in switch description 2025-06-03 13:57:42 -04:00
Rylan Polster
c03f70f1dc
Refactor OnSystem and SimulateSystem bottle tag handling 2025-06-03 11:57:17 -04:00
Rylan Polster
0f03757e8f
Shard JSON API by OS/Arch combination 2025-06-02 23:06:02 -04:00
Bevan Kay
6278ac1801
Merge branch 'master' into cabal 2025-05-29 22:44:20 +10: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
Mike McQuaid
8b32d019d4
Merge pull request #19986 from Homebrew/fix_update_maintainers
dev-cmd/update-maintainers: various fixes.
2025-05-21 12:42:38 +00:00
Issy Long
ee15435a90
Fix multiline hash key/value indentation 2025-05-21 14:31:58 +02:00
Mike McQuaid
c1a2f94e01
dev-cmd/tap-new: fix root_url warning.
Ruby couldn't detect the `root_url` usage inside the ERB template.
Instead, use interpolation so it can for a fixed warning and more concise
syntax.
2025-05-21 13:19:11 +01:00
Mike McQuaid
a94037a6ff
dev-cmd/update-maintainers: various fixes.
- install the `man` gem group for `kramdown` so
  `Manpages.regenerate_man_pages` can run successfully
- hardcode the non-organisation PLC members so that they aren't
  missing from the GitHub team
- correctly populate the PLC members again
2025-05-21 13:08:37 +01:00
Douglas Eichelberger
38bad25a86
Include annotations in typecheck updates 2025-05-20 20:56:53 -07:00
Bevan Kay
effb07ee76
bump-formula-pr: fix case when only url is provided 2025-05-20 21:23:52 +10:00
botantony
92832c258c
dev-cmd/create: add --cabal switch
Signed-off-by: botantony <antonsm21@gmail.com>
2025-05-18 20:18:34 +02:00
Eric Knibbe
2b8d104281
dev-cmd/generate-*-api: simulate latest macOS 2025-05-15 11:06:24 -04:00
Steve Peters
3dd87e6d17 dev-cmd/prof: require fileutils
Fixes error when running `brew prof`:
uninitialized constant Homebrew::DevCmd::Prof::FileUtils
2025-05-08 13:41:11 -07: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
botantony
562c104b7e dev-cmd/bump: replace --no-auto with --no-autobump
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
botantony
ad66e0c418 tap: get autobump list from formula/cask API
Signed-off-by: botantony <antonsm21@gmail.com>
2025-04-29 18:04:59 +02:00
Alexander Bayandin
d60e72a055 dev-cmd/tap-new: use ERB templates instead of string interpolation 2025-04-28 23:57:44 +01:00
Alexander Bayandin
875702d51a dev-cmd/tap-new: support private repos 2025-04-28 18:07:19 +01:00
Bevan Kay
b255a670c0
bump-formula-pr: restore pr message 2025-04-23 14:45:15 +10:00
Patrick Linnane
5d8d453a90
Portable Ruby 3.4.3 2025-04-22 11:50:08 -07: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
e98a052896
dev-cmd/edit: remove unneeded variable. 2025-04-11 16:07:29 +01:00
Anatoli Babenia
fff2c3ea79 edit: move no_env and no_install checks out of the loop 2025-04-11 17:21:17 +03:00
Anatoli Babenia
ccf506f7f9 brew style --fix 2025-04-11 17:15:55 +03:00
Anatoli Babenia
7523daaf33 edit: review fixes
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-11 17:15:55 +03:00
Anatoli Babenia
a0e68613f5 Fix false/Boolean type check
https://sorbet.org/docs/error-reference#7001
2025-04-11 17:15:55 +03:00
Anatoli Babenia
9bf4e620e0 edit: show --build-from-source only for formulas 2025-04-11 17:15:55 +03:00
Anatoli Babenia
fb5438bfd1 Update Library/Homebrew/dev-cmd/edit.rb
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2025-04-11 17:15:54 +03:00
Anatoli Babenia
fc0d7ac21d dev-cmd/edit: Actionable message about no API install 2025-04-11 17:15:54 +03:00
Rafael Gallani
ef13b69b03
dev-cmd/create: handle nil stdin 2025-04-11 08:48:54 +01:00
Bo Anderson
5ff37113ff
dev-cmd/vendor-gems: fix incorrect Bundler version being used 2025-04-09 19:35:13 +01:00
Sam Ford
99681d7fbc
bump-cask-pr: replace "host" naming with "current"
`Homebrew::SimulateSystem.current_os` may be returning the host OS or
a simulated OS and we can't be sure which in this context. At the
moment, this is expected to be the host OS but that may change in the
future. It shouldn't matter on a technical level but using "host" in
these variable names may lead to confusion.

This replaces "host" in names with "current", as it more accurately
describes the information.
2025-04-06 10:58:47 -04:00
Sam Ford
b7065d5fcf
bump-cask-pr: extract system_options generation
This extracts the logic for generating the `system_options` array in
the `replace_version_and_checksum` method into a separate
`generate_system_options` method. This logic is becoming more complex
(after recent changes) and manually testing it is a pain, so this
change is intended to allow us to add tests. The tests added here
provide 100% coverage for the method.
2025-04-06 10:58:46 -04:00
Sam Ford
6f06afbc11
bump-cask-pr: respect depends_on arch
This reworks the `SimulateSystem` args in the `bump-cask-pr`
`replace_version_and_checksum` method to respect `depends_on arch`
values in casks. That is to say, we shouldn't simulate Intel for a
cask using `depends_on arch: :arm64` and we shouldn't simulate ARM if
the cask uses `depends_on arch: :x86_64`.

In the process, this refactors how we collect/combine OS/arch values.
To make this approach work predictably, I removed the logic that
omits OS values matching the host OS (as `SimulateSystem` already
handles this). The `[{ os:, arch: }]` hash format only made sense when
we were omitting values, so this returns to the previous
`[[os, arch]]` array format (to align with the
`OnSystem::ALL_OS_ARCH_COMBINATIONS` array format).
2025-04-06 10:58:46 -04:00
Sam Ford
ed48426a33
tests: support :needs_arm, :needs_intel metadata
This adds the ability to specify tests that depend on a certain CPU
architecture using `:needs_arm` or `:needs_intel`, similar to the
existing `:needs_macos` and `:needs_linux` metadata for tests that
depend on a certain OS.
2025-04-04 09:17:32 -04:00
Sam Ford
612fec47f3
bump-cask-pr: rescue CaskUnreadableError
The `replace_version_and_checksum` method handles a `CaskInvalidError`
when loading a cask (handling casks that aren't valid on Linux) but
we can sometimes still encounter an error when bumping a cask with
on_system blocks. For example, bumping `displaylink` will produce a
`Cask 'displaylink' is unreadable: undefined method 'csv' for nil`
error when `SimulateSystem` runs as Linux, as the cask interpolates
`version.csv.first` in a `license` string but `version` isn't set on
Linux.

This adds `Cask::CaskUnreadableError` to the `rescue` arguments,
which accounts for this particular situation (allowing `displaylink`
to be bumped like before).
2025-04-03 17:56:48 -04:00
Sam Ford
38410f5432
bump-cask-pr: fix macOS host handling
`bump-cask-pr` was recently updated to add Linux support but the
change to the `replace_version_and_checksum` logic has broken the
command for casks that have on_system blocks that reference specific
macOS versions (e.g., `on_monterey :or_newer` in `logi-options+`).

The previous logic only simulated the arch, so the `current_os` value
on macOS was a specific version like `:sequoia`. The current logic
uses generic `:macos` values, which work for `on_macos` blocks but
don't work for blocks like `on_sequoia`, etc. This leads to an
`undefined method 'latest?' for nil` error, as `old_cask.version` is
`nil` in this scenario (i.e., none of the on_system blocks apply to
`:macos`, so `version` is never set).

This updates the method to only specify the OS in `system_options` if
the value doesn't align with the host (e.g., `:linux` on macOS),
which restores the previous behavior.

This also replaces `:macos` values with the newest macOS version
(e.g., `:sequoia`), so that `bump-cask-pr` on Linux can update casks
with on_system blocks that reference specific macOS versions. A
generic `:macos` value doesn't work with those on_system blocks, so
`version` is never called on Linux in that scenario but it works as
expected if we use the newest macOS value instead. This may not be
perfect but it brings `bump-cask-pr` a little closer to parity with
macOS on Linux.

Lastly, this skips `system_options` values where `old_cask` has no
version, as this means the cask doesn't apply to that OS/arch. We've
been seeing a related error on homebrew/cask autobump CI and this
guard should help to avoid it.
2025-04-03 17:56:47 -04:00