402 Commits

Author SHA1 Message Date
Markus Reiter
1a13097a86
Actually cache Tap#pypi_formula_mappings. 2024-03-04 16:57:39 +01:00
Markus Reiter
34af31a05d
Actually cache Tap#style_exceptions. 2024-03-04 16:51:38 +01:00
Markus Reiter
9e8acb6312
Actually cache Tap#audit_exceptions. 2024-03-04 16:51:35 +01:00
Markus Reiter
890bec6515
Simplify Tap#alias_reverse_table. 2024-03-04 16:49:33 +01:00
Markus Reiter
0592f7ac07
Simplify Tap#alias_table. 2024-03-04 16:47:48 +01:00
Mike McQuaid
8d4e841965
Merge pull request #16778 from reitermarkus/tap-sig-4
Simplify `Tap#custom_remote?`.
2024-03-04 14:42:52 +00:00
Markus Reiter
abc591e702
Simplify Tap#custom_remote?. 2024-03-04 14:30:06 +01:00
Markus Reiter
b4167f97d6
Simplify Tap#remote_repo. 2024-03-04 14:27:55 +01: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
apainintheneck
fb055f7aaf tap: revert caching Tap.reverse_tap_migrations_renames
This could cause problems if a tap is installed during the lifetime
of the program which happens occasionally with `Tap#ensure_installed!`.

It also seems to be slow mainly because of intermediate arrays and
Pathname objects that get created in `Tap.each`. Maybe that should
be optimized instead.
2024-03-02 11:31:04 -08:00
apainintheneck
2da1c93df7 tap: memoize Tap.reverse_tap_migrations_renames
This should be a relatively small hash but it gets recalculated
every time we call Cask#oldnames or Formula#oldnames which ends
up being a lot if you run certain commands with --eval-all.

For example, when running the following, it took 10% of the total
runtime.

```
brew deps --casks --eval-all
```
2024-03-01 20:14:42 -08:00
apainintheneck
99d5200db3 tap: fix performance regression in *_files_by_name
We essentially stopped caching these accidentally and they get
called every time we try to load a cask or formula from the API.
It gets really, really, really slow.

I ran `brew deps --casks --eval-all` before and after the changes.

I let it run for 3 minutes before killing it. No output had been
printed to the screen.

It finished printing all output (pages and pages of it) in less
than a minute.

---

This should match the caching behavior we had before the
recent changes in these two PRs.

- https://github.com/Homebrew/brew/pull/16777
- https://github.com/Homebrew/brew/pull/16775
2024-03-01 19:30:53 -08:00
Ruoyu Zhong
38b671d8bb
Merge pull request #16750 from iMichka/autobump
bump-formula|cask-pr: do not allow to bump autobumped packages
2024-03-02 00:33:06 +08:00
Mike McQuaid
387332ab68
Merge pull request #16782 from reitermarkus/tap-sig-5
Rename `Tap#reverse_cask_renames` to `Tap#cask_reverse_renames`.
2024-03-01 15:41:39 +00:00
Mike McQuaid
6c6c418dff
Merge pull request #16785 from reitermarkus/tap-sig-remote
Actually return `super` in `CoreTap#remote`.
2024-03-01 13:46:39 +00:00
Mike McQuaid
56b3982e7a
Merge pull request #16784 from reitermarkus/tap-sig-7
Add signature for `Tap#config`.
2024-03-01 13:46:20 +00:00
Markus Reiter
567ea44c99
Actually return super in CoreTap#remote. 2024-03-01 13:22:03 +01:00
Markus Reiter
0966d2cd8f
Add signature for Tap#config. 2024-03-01 13:16:56 +01:00
Markus Reiter
01133769ba
Clear cache for Tap#formula_reverse_renames. 2024-03-01 12:58:05 +01:00
Markus Reiter
c3c5437c4f
Rename Tap#reverse_cask_renames to Tap#cask_reverse_renames. 2024-03-01 12:57:37 +01: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
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
Mike McQuaid
0e1c1e3435
Merge pull request #16777 from reitermarkus/tap-sig-3
Simplify `Tap#formula_files_by_name`.
2024-03-01 08:41:33 +00:00
Markus Reiter
3da0f8c4a6
Fix loading casks/formulae from relative paths. 2024-03-01 04:05:15 +01:00
Markus Reiter
2a78eba1ad
Simplify Tap#formula_files_by_name. 2024-02-29 22:48:50 +01:00
Markus Reiter
755c8aecad
Simplify Tap#cask_files_by_name. 2024-02-29 22:47:43 +01:00
Mike McQuaid
8a846fb1c2
Merge pull request #16766 from reitermarkus/tap-installed
Only show installed taps in `brew tap` output.
2024-02-29 10:35:19 +00:00
Markus Reiter
e08e873921
Only show installed taps in brew tap output. 2024-02-28 20:18:55 +01:00
apainintheneck
bfe5e43ff4 api/formula: Fix failing specs
- clear the formula API cache
- make the API cache directory
- fix stubbed return values (thanks Sorbet!)
2024-02-27 20:55:16 -08:00
apainintheneck
cefd3273cc tap: Add helper to generate core formula API hash
This abstracts away this helper to make it easier to test and
reason about.
2024-02-27 20:55:16 -08:00
apainintheneck
d64de40e52 Update api code to load internal JSON v3 file 2024-02-27 20:55:16 -08:00
Markus Reiter
132a87aff5
Rename Tap#repo_var to Tap#repo_var_suffix. 2024-02-23 16:02:29 +01:00
Markus Reiter
ab27efbd9d
Make Tap::each respect the API. 2024-02-22 17:56:47 +01:00
Mike McQuaid
89fd6964f9
Merge pull request #16715 from reitermarkus/tap-ensure-installed
Clean up `Tap#ensure_installed!` usage.
2024-02-22 08:47:48 +00:00
Mike McQuaid
689b76cbad
Merge pull request #16714 from reitermarkus/tap-cask-files
Support `Tap#cask_files` when using API.
2024-02-22 08:47:18 +00:00
Markus Reiter
9f5e1f2870
Clean up Tap#ensure_installed! usage. 2024-02-21 03:21:02 +01:00
Markus Reiter
2d41fe8feb
Support Tap#formula_files when using API. 2024-02-20 20:44:13 +01:00
Markus Reiter
4cf0f79368
Support Tap#cask_files when using API. 2024-02-20 20:44:02 +01:00
apainintheneck
e96313f6ed formulary_spec: update API tests to avoid mocking
Stop mocking the formulary loader method. We just need to set the
environment variable so that it knows to load things from the API.

Fix spec that doesn't work with the `CoreTap.formula_names`.
That method assumes that we always have a valid `ruby_source_path`
in the API JSON even though that was optional for a while after
launching the API if my memory serves me. It's probably fine
to assume this should always be set though and I changed it to use
`Hash#fetch` to give use better error messages if something goes wrong in the future.

Remove unused `allow(x).to receive(y).and_call_original` in tap spec.
2024-02-17 13:00:50 -08:00
Markus Reiter
aaf39aa90b
Fix Tap#alias_table when using the API. 2024-02-16 22:39:16 +01:00
Markus Reiter
a3a1b4c253
Check tap migrations for renames. 2024-02-13 06:03:10 +01:00
Patrick Linnane
3fdba532a2
various: fix miscellaneous typos
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-01-12 10:56:49 -08:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Bo Anderson
5f95ca7259
tap: don't display file info for uninstalled taps 2023-11-25 13:38:37 +00:00
Bo Anderson
b1ddb056db
tap: optimise CoreTap#formula_files_by_name 2023-11-18 01:01:41 +00:00
Bo Anderson
34e4ec2460
tap: fix repair not working in some cases 2023-11-05 00:44:50 +00:00
Bo Anderson
0c08a3cccb
Improve performance of Formula#to_hash 2023-09-28 14:07:25 +01:00
apainintheneck
5760ae4fb2 cmd/readall: Cleanup todos
- keep running the command against all os/arch combinations
  as the default
- remove todos and deprecations related to changing the behavior
- create constants for os/arch combinations
2023-09-19 21:33:13 -07:00
apainintheneck
7e05a9b574 cmd/audit: improve performance of versioned formula names
There is a check for other versioned formula with the same name
in the file audit. This just memoizes all of the versioned
formulae in a tap during the first call and then uses that much
shorter list everytime it checks for things.
2023-09-16 09:18:13 -07:00
Eric Knibbe
931f762598
docs+rubydoc: various grammar/wording fixes 2023-09-11 02:26:37 -04:00