6060 Commits

Author SHA1 Message Date
William Woodruff
83caa42876
attestation_spec: style fix
Signed-off-by: William Woodruff <william@yossarian.net>
2024-06-06 11:30:11 -04:00
William Woodruff
8d0e6eafc3
attestation: handle :all bottles
Signed-off-by: William Woodruff <william@yossarian.net>
2024-06-06 11:23:03 -04:00
Eric Knibbe
2d00e50071
cask: skip variations for inapplicable versions 2024-06-03 12:33:00 -04:00
Issy Long
808cfda92d
dev-cmd/contributions: Fix the date range behaviour
- This was broken (I did have a commit SHA for the breakage but I can't find it now) since `from` and `args.from` are different variables (one can be nil, the other has a default value).
- So it was reporting very high counts because, despite the message, the `from` restriction was not being passed to `count_repo_commits`.
2024-05-28 13:58:41 +01:00
Daiki Mizukami
b4dcb94ad6
Utils::Cp: Drop special case for coreutils cp
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#issuecomment-2132673915
2024-05-28 12:34:30 +09:00
Carlo Cabrera
ff83a4fd7f
Merge pull request #17280 from Homebrew/timeout-values 2024-05-27 21:38:07 +08:00
Daiki Mizukami
b8af1c546e
Utils::Cp: Fix tests 2024-05-27 17:48:32 +09:00
Aaron Ruan
10987270fa
remove unnecessary cask osdn-incorrect-url-format 2024-05-27 12:33:23 +08:00
Daiki Mizukami
deaac7ce47
Use Utils::Cp to copy files
This replaces `FileUtils.cp` and `system_command! "cp"` with the new
`Utils::Cp` utility where it is expected that the performance
improvement outweighs the cost of the system command invocation.
2024-05-27 12:11:41 +09:00
Patrick Linnane
7aa10a13a4
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-26 16:03:03 -07:00
Aaron Ruan
0778379501
change tests for auditing OSDN download urls 2024-05-27 00:34:08 +08:00
Mike McQuaid
6e9288470e
brew style --fix 2024-05-23 17:15:43 +01:00
William Woodruff
3319e9956d
attestation: drop workflow check on core attestation
Signed-off-by: William Woodruff <william@yossarian.net>
2024-05-18 10:04:53 -04:00
Bo Anderson
7452350919
test/cask/artifact/shared_examples/uninstall_zap: fix for Ruby 3.2+ 2024-05-17 01:31:47 +01:00
Patrick Linnane
773dbfa92a
docs: update for Homebrew/cask-fonts deprecation
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-16 09:21:14 -07:00
William Woodruff
f78a8882d9
attestation: redact secret in environment
Signed-off-by: William Woodruff <william@yossarian.net>
2024-05-14 14:32:23 -04:00
Caleb Xu
00ba3930d6
messages: enable strict typing 2024-05-13 08:48:41 -04:00
Carlo Cabrera
a9c8556b9d
github_runner_matrix: define timeout values in constants
This allows us to keep all information about timeout values here in
`brew` instead of both here and in Homebrew/core.

Will be needed after Homebrew/homebrew-core#171457.
2024-05-12 04:48:00 +08:00
Carlo Cabrera
71c4bfae79
Merge pull request #17222 from Homebrew/intel-runner-tag
github_runner_matrix: add `-x86_64` to Intel runner names
2024-05-12 02:19:47 +08:00
Carlo Cabrera
90c198fd5c
determine-test-runners: fix failing test 2024-05-12 02:09:37 +08:00
Mike McQuaid
16901a674f
extend/kernel: make opoo/odie/etc. print GitHub Actions notes.
We already do this for deprecations but these may make warnings
and errors from Homebrew easier to spot in GitHub Actions logs.

While we're here, cleanup other cases that should have used
`GitHub::Actions::Annotation` but didn't and provide some helpers and
tweaks there necessary for our use case here.
2024-05-09 14:43:53 +01:00
Mike McQuaid
442aa91704
SBOM improvements
- write a schema when installing formulae (if not already present)
- cache the schema on disk rather than downloading it every time
- make more methods/attributes `private`
- allow validation to be optional, only enable for Homebrew developers
  at installation time
- use the tab for more, correct information
- ensure that dependencies/bottles are written correctly
- use new SBOM 3 schema URL
- improve test coverage
2024-05-09 13:10:37 +01: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
d3746d55f2
Merge pull request #17248 from Homebrew/remove_plist_startup
caveats_spec: remove outdated plist_startup reference.
2024-05-07 19:54:25 +01:00
Sean Molenaar
a43b7464c2 feat: add generated SPDX file on bottling 2024-05-07 20:33:22 +02:00
Mike McQuaid
46c6571bd6
caveats_spec: remove outdated plist_startup reference.
This was removed a long time ago.
2024-05-07 19:31:28 +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
Mike McQuaid
d77dbe8b89
Merge pull request #17241 from Homebrew/cask-audit-sourceforge
cask/audit: tune sourceforge.net URL regex
2024-05-07 09:06:50 +01:00
Mike McQuaid
fc13eb83c8
Merge pull request #17213 from Homebrew/allowed-taps
env_config: add `HOMEBREW_ALLOWED_TAPS`
2024-05-07 08:47:57 +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
Eric Knibbe
4932fb7fd0
rubocops/urls: remove dead link 2024-05-06 22:57:23 -04:00
Carlo Cabrera
be29afa5f7
Fix brew style 2024-05-06 15:26:29 +01:00
Carlo Cabrera
3b794fc6e8
formula_installer, cask/installer: add tests for HOMEBREW_ALLOWED_TAPS 2024-05-06 15:22:48 +01:00
Carlo Cabrera
078a328e8e
tap: avoid class vars
Avoiding them also allows us to write proper tests.
2024-05-06 15:05:06 +01:00
Mike McQuaid
82c2e743a5
Merge pull request #17228 from Homebrew/replace-formula-text-audits-with-rubocops
Replace `FormulaTextAuditor` usage
2024-05-06 08:46:28 +01:00
Mike McQuaid
3d31594e39
Merge pull request #17220 from woodruffw-forks/ww/refine-gh-auth
attestations: improve authentication techniques
2024-05-06 08:38:07 +01:00
Carlo Cabrera
34387bfc8a
cask/installer: update to match formula_installer 2024-05-05 14:00:02 +01:00
Carlo Cabrera
3555d09c1d
formula_installer: fix failing test 2024-05-05 13:59:36 +01:00
Issy Long
9f915a6a62
Replace FormulaTextAuditor usage
- Only two audits were using this: `audit_keg_only_reason` and `audit_text`,
  and they weren't using any of its text processing methods, so there's little
  reason to keep it around.
- The "`keg_only_reason` shouldn't contain 'HOMEBREW_PREFIX'" audit can easily
  be replaced with a RuboCop since that's "just" text parsing.
- The "tests should invoke binaries with `bin/<command>`" audit had to stay as
  a FormulaAudit because it requires accessing attributes about the Formula
  like its name, aliases, which RuboCop can't get to, but it was easy to move the
  singular "read the text in the file" line from `FormulaTextAuditor`.
2024-05-04 22:14:55 +01:00
William Woodruff
7e43e5aafe
attestation_spec: another auth case
Signed-off-by: William Woodruff <william@yossarian.net>
2024-05-03 13:17:31 -04:00
William Woodruff
2aa3d77f72
attestation_spec: fixup
Signed-off-by: William Woodruff <william@yossarian.net>
2024-05-03 13:01:02 -04:00
Sam Ford
78c7ad747a
Pypi: Update strategy regex
livecheck is returning an `Unable to get versions` error for the
`ansible-lint`, `aws-sam-cli`, and `pyqt-builder` formulae. These use
the `Pypi` strategy without a `livecheck` block, so they use the
generated regex from the strategy. The `Pypi` strategy matches the
version from the tarball link on the pypi.org package page but this
fails for these packages because the formula's `stable` tarball uses
hyphens in the filename (e.g., `ansible-lint-...`) but the current
tarball filename uses underscores (e.g., `ansible_lint-...`).

This addresses the issue by updating the strategy regex to replace
[escaped] `-` or `_` characters in the package name with `[_-]`, so
the regex will match regardless of the delimiter used in the formula
filename.
2024-05-03 10:21:03 -04:00
Mike McQuaid
e944830b1f
Merge pull request #17212 from Homebrew/skip-tests-that-require-core-if-not-tapped
dev-cmd/tests: skip tests that require core if it's not tapped
2024-05-03 09:20:23 +01:00
apainintheneck
56ecd42ebd dev-cmd/tests: skip tests that require core if it's not tapped
There were a few tests which require core to be tapped and fail
if it isn't. This is annoying if someone is trying to contribute
to the project and they're using the JSON API instead of having
the core repo tapped locally.

I'm just skipping these because it's the simplest thing to do.
The tests that failed are mostly rubocop tests so it's fine
if they only run on CI.
2024-05-03 00:32:50 -07:00
Patrick Linnane
7fe4d2e42f
various: remove remaining Homebrew/cask-versions references
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-02 15:29:21 -07:00
Razvan Azamfirei
0b0fcdcdd2
homebrew/cask-versions: remove 2024-05-02 16:59:33 -04:00
apainintheneck
37cbfc40bf Fix internal formula json v3 frozen hash parsing bug
This caused formulae with uses from macos bounds to not load correctly
because they tried to modify a frozen hash. It wasn't obvious from
the tests because I didn't replicate the real world JSON parsing
conditions closely enough. I also had to modify `Cachable#clear_cache`
so that it can clear frozen hashes.

Error:
```
Error: can't modify frozen Hash: {"since"=>"catalina"}
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/usr/local/Homebrew/Library/Homebrew/extend/hash/keys.rb:123:in `delete'
/usr/local/Homebrew/Library/Homebrew/extend/hash/keys.rb:123:in `block in _deep_transform_keys_in_object!'
/usr/local/Homebrew/Library/Homebrew/extend/hash/keys.rb:122:in `each'
/usr/local/Homebrew/Library/Homebrew/extend/hash/keys.rb:122:in `_deep_transform_keys_in_object!'
/usr/local/Homebrew/Library/Homebrew/extend/hash/keys.rb:48:in `deep_transform_keys!'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:230:in `block (2 levels) in load_formula_from_api'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:218:in `each'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:218:in `block in load_formula_from_api'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:304:in `instance_exec'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:304:in `block (2 levels) in load_formula_from_api'
/usr/local/Homebrew/Library/Homebrew/formula.rb:3664:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/formula.rb:3664:in `stable'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:293:in `block in load_formula_from_api'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:283:in `initialize'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:283:in `new'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:283:in `load_formula_from_api'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:962:in `load_from_api'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:955:in `klass'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:569:in `get_formula'
/usr/local/Homebrew/Library/Homebrew/formulary.rb:1009:in `factory'
/usr/local/Homebrew/Library/Homebrew/dependency.rb:41:in `to_formula'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:46:in `block (2 levels) in formulae_with_no_formula_dependents'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:45:in `each'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:45:in `block in formulae_with_no_formula_dependents'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:39:in `each'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:39:in `formulae_with_no_formula_dependents'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:59:in `unused_formulae_with_no_formula_dependents'
/usr/local/Homebrew/Library/Homebrew/utils/autoremove.rb:16:in `removable_formulae'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:693:in `autoremove'
/usr/local/Homebrew/Library/Homebrew/cleanup.rb:291:in `clean!'
/usr/local/Homebrew/Library/Homebrew/cmd/cleanup.rb:52:in `run'
/usr/local/Homebrew/Library/Homebrew/brew.rb:92:in `<main>'
```
2024-05-01 21:36:37 -07:00
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
caf87c0336
Warn about undocumented non-private APIs. 2024-05-01 11:35:20 +02:00
Mike McQuaid
7c0b989740
Merge pull request #17153 from apainintheneck/new-formula-json-dependencies-format
New formula internal json v3 dependencies format
2024-05-01 08:45:18 +01:00