121 Commits

Author SHA1 Message Date
Rylan Polster
c16a9b33b2
Use cached json API file for formulae and cask specified paths 2024-07-03 13:41:52 -04:00
apainintheneck
16e605e056 Load tap migration renames from API with short names
This is a follow-up to 484498e. I added loading for tap migration
renames from the API but it apparently only worked for full names.

There was a bug in both the code and the tests which prevented
loading by short names. This fixes those bugs so everything should
be good now.
2024-07-01 18:53:31 -07:00
apainintheneck
10aa981209 Load tap migration renames from the API
These would not get loaded from the API at all meaning these
were not loadable by the old names when the core formula or cask
tap was not installed. We assume that most users don't have those
core taps tapped which means this is broken for most everyone.
2024-06-30 11:26:03 -07:00
Philippe Eberli
20fb068085 Fix migrations of formulae and casks to non homebrew taps 2024-06-08 16:29:23 +02: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
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Markus Reiter
e575671477
Actually remove FromDefaultNameLoader. 2024-03-12 22:50:13 +01:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Markus Reiter
a24da6b072
Remove FromDefaultNameLoader to avoid warning twice. 2024-03-06 23:14:28 +01:00
Markus Reiter
a851bb86ef
Add type signature for Tap::fetch. 2024-03-06 14:30:17 +01:00
Mike McQuaid
f1eea64523
Merge pull request #16779 from reitermarkus/fix-load-from-path
Fix loading casks/formulae from relative paths.
2024-03-01 08:47:41 +00:00
Markus Reiter
3da0f8c4a6
Fix loading casks/formulae from relative paths. 2024-03-01 04:05:15 +01:00
Markus Reiter
755c8aecad
Simplify Tap#cask_files_by_name. 2024-02-29 22:47:43 +01:00
Issy Long
f4218a6316
Fix RuboCop Performance/MapCompact offenses
- Rename an iterator variable since it would make the line too long.
2024-02-25 22:59:59 +00:00
Markus Reiter
670eb3d02d
Remove CaskLoader::tap_paths. 2024-02-20 18:25:11 +01:00
Markus Reiter
876535c670
Use HOMEBREW_DEFAULT_TAP_CASK_REGEX in FromDefaultNameLoader. 2024-02-13 21:52:45 +01:00
Markus Reiter
d506645667
Add separate loader for default tap. 2024-02-13 21:25:52 +01:00
Markus Reiter
eaf7b38995
Allow tap migrations with renames. 2024-02-13 04:17:43 +01:00
Markus Reiter
c39abef045
Always prefer default tap. 2024-02-12 21:45:07 +01:00
Markus Reiter
48c9897081
Convert FromNameLoader to class. 2024-02-12 07:43:29 +01:00
Markus Reiter
8e04ab8b42
Fix type signature. 2024-02-12 07:14:28 +01:00
Markus Reiter
0211feebd7
Fix loading test fixtures. 2024-02-12 07:14:27 +01:00
Markus Reiter
6f28392d6e
Remove FromDefaultTapPathLoader and FromDefaultTapLoader. 2024-02-12 07:12:33 +01:00
Markus Reiter
d17aa66759
Avoid T.cast. 2024-02-12 07:12:32 +01:00
Markus Reiter
3e61e3b428
Stop following recursive tap migrations. 2024-02-10 15:07:31 +01:00
Markus Reiter
cb13f95928
Avoid T.cast. 2024-02-09 16:59:27 +01:00
Markus Reiter
1323262610
Rename constant. 2024-02-08 19:22:02 +01:00
Markus Reiter
76d8d6c840
Add type signatures. 2024-02-08 16:30:08 +01:00
Markus Reiter
a37afcb777
Fix loading renamed casks from API. 2024-02-08 16:29:31 +01:00
Markus Reiter
889854b0b3
Merge FromTapPathLoader into FromPathLoader. 2024-02-08 16:20:32 +01:00
Markus Reiter
dc21095731
Simplify multiple ifs into single case statement. 2024-02-08 16:20:32 +01:00
Markus Reiter
732e4438f4
Use token instead of name for casks. 2024-02-08 16:20:31 +01:00
Markus Reiter
6e5b6b7cc9
Remove unused parameter from CaskLoader::tap_paths. 2024-02-08 16:20:31 +01:00
Markus Reiter
c301b9c703
Readd debug logging. 2024-02-07 14:02:12 +01:00
Markus Reiter
825222cc83
Simplify code style.
Co-authored-by: Kevin <apainintheneck@gmail.com>
2024-02-07 14:02:10 +01:00
Markus Reiter
c559e6777c
Reuse rename logic for default cask tap. 2024-02-07 02:02:03 +01:00
Markus Reiter
889c3c38ed
Refactor CaskLoader::for. 2024-02-07 02:02:02 +01:00
Markus Reiter
e5a6f765da
Revert "Merge pull request #16608 from bevanjkay/revert-16596-cask-rename-migrations"
This reverts commit 5799e8541567385c4d729cc3f0062b45e55b9936, reversing
changes made to 677517132782b276ba1c4ba77456adf7540d99ba.
2024-02-07 02:02:02 +01:00
Bevan Kay
f0b8845ad6
Revert "Handle tap migrations in CaskLoader." 2024-02-06 20:16:03 +00:00
Markus Reiter
094761dcd9
Add tests for CaskLoader::for. 2024-02-06 19:56:09 +01:00
Markus Reiter
ed00dc0b95
Add type annotations for cask loaders. 2024-02-06 16:04:08 +01:00
Markus Reiter
5cab0c8a6e
Handle tap migrations in CaskLoader. 2024-02-06 01:08:23 +01:00
Douglas Eichelberger
f6c7eb7124 Add hash/keys to extend/ 2024-01-19 13:36:17 -08:00
apainintheneck
984dcf8c11 API: Load casks/formula from JSON with missing keys
We'd like to reduce the size of the API JSON and to do that we are
going to remove unused and/or blank elements from the cask/formula
definition. This will reduce the amount of data that has to go
over the wire and make it easier to load this data into memory.
2024-01-01 19:10:48 -08:00
Rylan Polster
472dd95b16
Fix cask loading from the API
Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-12-16 20:08:26 -05:00
Rylan Polster
641a80475e
Update cask logic to handle deprecations and disables 2023-12-16 20:01:47 -05:00
Bo Anderson
af7d744af0
Fixes for Ruby 3 2023-09-29 05:25:48 +01:00
Mike McQuaid
b7114651ac
utils/curl: include or use explicitly.
Include or use `Utils::Curl` explicitly everywhere it is used.
2023-09-04 22:17:57 -04:00