5593 Commits

Author SHA1 Message Date
Douglas Eichelberger
777ee12258 Port Homebrew::DevCmd::Command 2024-03-20 10:36:19 -07:00
Douglas Eichelberger
55a0991902 Port Homebrew::DevCmd::Cat 2024-03-20 10:36:19 -07:00
Douglas Eichelberger
df42e9cfb3 Port Homebrew::DevCmd::Bump 2024-03-20 10:36:10 -07:00
Douglas Eichelberger
c70dc040c6 Port Homebrew::DevCmd::BumpUnversionedCask 2024-03-20 10:25:18 -07:00
Douglas Eichelberger
1097496a06 Port Homebrew::DevCmd::BumpRevision 2024-03-20 10:25:18 -07:00
Douglas Eichelberger
d873881c47 Port Homebrew::DevCmd::BumpFormulaPr 2024-03-20 10:25:17 -07:00
Douglas Eichelberger
ebc458a7fe Port Homebrew::DevCmd::BumpCaskPr 2024-03-20 10:16:17 -07:00
Douglas Eichelberger
ee0c967ce0 Port Homebrew::DevCmd::Bottle 2024-03-20 10:16:17 -07:00
Douglas Eichelberger
0f2efd3939 Port Homebrew::DevCmd::Audit 2024-03-20 10:16:17 -07:00
apainintheneck
74aea8e92d spec_helper: add :no_api test scope
This sets the HOMEBREW_NO_INSTALL_FROM_API environment variable
to prevent the selected tests from using the API. We will need
this as we transition to having the API be enabled by default
when running the tests but it's also nice as a sanity check
with the :needs_utils_curl scope in a few places.
2024-03-19 22:18:02 -07:00
Bo Anderson
326bc3f889
Fix cask source checksum handling 2024-03-19 21:21:37 +00:00
Michael Cho
d04c5ad4f8
test/utils/github_spec: filter further to fix test failure
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-19 17:01:04 -04:00
apainintheneck
ad35db4b24 tests: fix tests that make unexpected network calls
These were found with the Utils::Curl check and just turning
off the network on my computer and running the entire test suite.
2024-03-18 20:57:35 -07:00
apainintheneck
b66097fa3d spec_helper: add check for unexpected network calls
Any test that is not tagged as :needs_network and that makes
a call to an unapproved method in the `Utils::Curl` module
will raise an error unless that method gets mocked somehow.

tests: add exceptions for tests that use curl to download local files

These are acceptable ways to use curl in local, non-network tests.
For those edge cases we allow you to bypass the check with :needs_utils_curl.
2024-03-18 20:57:23 -07:00
Douglas Eichelberger
0c4c4a87a2 Fix flaky Tapioca::Compilers::Args test 2024-03-18 09:24:40 -07:00
Douglas Eichelberger
2cc3ce9bb4
Merge pull request #16815 from dduugg/abstract-command
Provide interface and individual namespaces for brew CLI commands
2024-03-18 08:11:52 -07:00
Bo Anderson
6cb0fd06c4
Merge pull request #16894 from Homebrew/cask-fix-app-remove
cask/artifact/moved: fix permission handling when removing directories
2024-03-18 14:42:29 +00:00
Douglas Eichelberger
468c7b32e0 Remove unused matcher 2024-03-17 23:08:33 -07:00
Douglas Eichelberger
820d320835 Remove and refactor rspec-its use 2024-03-17 22:47:37 -07:00
Douglas Eichelberger
131a5421a5 Make cmd_args block non-nilable 2024-03-16 11:14:39 -07:00
Bo Anderson
011dfc8f45
cask/artifact/moved: fix permission handling when removing directories 2024-03-15 21:31:37 +00:00
Douglas Eichelberger
23336aa316 Update tests 2024-03-15 12:58:59 -07:00
Douglas Eichelberger
cda2761504 Preseve args_parse test for new commands 2024-03-15 12:46:06 -07:00
Douglas Eichelberger
6fc99d9569 Add tests 2024-03-15 12:46:06 -07:00
Douglas Eichelberger
2dceb65b42 Port prof to use AbstractCommand 2024-03-15 12:46:05 -07:00
Douglas Eichelberger
cbcb221de6 Create AbstractCommand class 2024-03-15 12:46:05 -07:00
Douglas Eichelberger
a3e5e3f7a0
Merge pull request #16880 from dduugg/args-compiler
Add tapioca compiler for Homebrew::CLI::Args
2024-03-14 11:50:07 -07:00
Douglas Eichelberger
68cce23e15 Add tests 2024-03-13 22:02:03 -07:00
Kevin
7473e63f38
Merge pull request #16875 from Homebrew/fix-untap-cmd-bugs
Fix untap cmd bugs
2024-03-13 20:17:38 -07:00
apainintheneck
9ff0f85335 untap_spec: use builtin spec helpers to simplify tests 2024-03-12 22:07:14 -07:00
Mike McQuaid
b1990ed4b6
Merge pull request #16863 from apainintheneck/memoize-installed-tap-loading-v2
Memoize installed tap loading v2
2024-03-12 08:36:09 +00:00
Michael Cho
545b83095d
Merge pull request #16871 from cho-m/cleanup-dryrun-print-dirs
cleanup: track removed links & dirs during dry-run
2024-03-11 13:44:31 -04:00
Mike McQuaid
8215f3a283
Merge pull request #16855 from Homebrew/update_tweaks
Various `brew update` behaviour improvements
2024-03-11 16:59:13 +00:00
Michael Cho
a30f6c48f2
Merge pull request #16865 from cho-m/cask-audit-@
cask/audit: allow @ for versioned casks
2024-03-11 09:07:28 -04:00
apainintheneck
11b67e04c2 untap: add tests for finding formulae/casks in each tap
These are regression tests to make sure that this logic is reproducible.
If this logic is not working, it might mean that someone removes a tap
accidentally that still includes a formula or cask that they currently
have installed.

The tests are extravagant and over-engineered but I'm not sure that
there's an easier way to do this without massive integration tests.
2024-03-10 22:33:44 -07:00
Michael Cho
29175df63f
cleanup: track removed links & dirs during dry-run
This allows dry-run to display any directories that will be removed
as a result of previous removal steps.

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-10 19:02:49 -04:00
Michael Cho
74f310577f
cleaner: remove RECORD and modify INSTALLER
According to [Python specification][1], we should remove `RECORD` file
to prevent changes to installed formula files via other tools, e.g. pip.
This also improves chances of generating an `all` bottle as it avoids
diff due to checksums of HOMEBREW_PREFIX present files. Also modify
`INSTALLER` file to indicate that brew is managing the Python package.

[1]: https://packaging.python.org/en/latest/specifications/recording-installed-packages/#intentionally-preventing-changes-to-installed-packages

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-10 10:22:55 -04:00
apainintheneck
08442734ab s/Tap.reverse_tap_migrations_renames/Tap.tap_migration_oldnames/ 2024-03-09 10:27:22 -08:00
apainintheneck
e6a453a20d tap: add some tests
- Add tests for:
  - `Tap.each`
  - `Tap.installed`
  - `Tap.all`
  - `Tap#reverse_tap_migrations_renames`
  - `Tap.reverse_tap_migrations_renames`
2024-03-09 10:27:22 -08:00
Michael Cho
85a08bcdc4
cask/audit: allow @ for versioned casks
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-09 12:20:27 -05:00
apainintheneck
3834ef1b73 tap: cache more things at the Tap level
I added two new methods to cache both installed and all taps.
All taps includes core taps no matter if they're installed locally
since they're always provided by the API anyway.

This makes it easier to cache `Tap.each` while making the code
easier to reason about. It also will be useful because we'll
be able to avoid the `Tap.select(&:installed?` pattern that has
recently invaded the codebase.

Note: I also stopped clearing all tap instance caches before
tests. Running `Tap.each` would cache existing taps which would
lead to unexpected behavior since the only existing tap before
each test is the core tap. This is the only tap whose directory
is not cleaned up between tests so we just clear it's cache directly.
We also now clear all tap instances after tests as well regardless
of whether the API was used that time.
2024-03-08 23:22:00 -08:00
Mike McQuaid
9ac31827a0
Various brew update behaviour improvements
- Output a message every time auto-update is run rather than a 3 second
  timer. This makes it more obvious that Homebrew isn't just sitting
  doing nothing for 2.9 seconds.
- Output a message when running `brew update` so Homebrew doesn't just
  sit there silently doing nothing.
- Update all taps when `brew update` is run, not just those hosted on
  GitHub. This makes it more obvious that people don't need to explictly
  run `brew update` "just in case".
- As a result of this, remove `brew tap --force-auto-update` as it's no
  longer necessary.
2024-03-08 16:21:09 +00:00
Mike McQuaid
b70884a474
Merge pull request #16848 from Homebrew/rubocop_default_hash_syntax
rubocop: default hash syntax.
2024-03-08 07:55:33 +00:00
apainintheneck
e0cea903ec s/to_api_hash/to_internal_api_hash/ 2024-03-07 20:29:58 -08:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +00:00
Mike McQuaid
3802d113ae
Merge pull request #16846 from Homebrew/analytics_cleanup
utils/analytics: general cleanup.
2024-03-07 15:53:23 +00:00
Mike McQuaid
9259c345cc
utils/analytics: general cleanup.
We have plans to add analytics for commands and `brew test-bot`

This requires a certain amount of refactoring which I've done here.

There was also a bunch of legacy `*_influx_?` usage from when we used
both InfluxDB and Google Analytics that made sense to clean up and
excessive indirection.
2024-03-07 15:19:04 +00:00
Markus Reiter
be9c0b8787
Simplify TapConfig. 2024-03-07 15:31:37 +01:00
Markus Reiter
a24da6b072
Remove FromDefaultNameLoader to avoid warning twice. 2024-03-06 23:14:28 +01:00
Mike McQuaid
03e583e746
cask: read bundle version from Info.plist when sensible.
If you're trying to use `brew info --json=v2` to get an installed
version and figure out if it is outdated: you're going to have a bad
time with `auto_updates` casks because `installed_version` alone is not
enough to get the actually currently installed version of the app.

Instead, in these cases, try to read from `Info.plist` if there is one
and use that version.

While we're here, add a `blank?` method to `Version` so we can use it
for `present?` checks (making a `null?` `Version` object `blank?`).

Co-authored-by: Markus Reiter <me@reitermark.us>
2024-03-06 15:52:16 +00:00