1467 Commits

Author SHA1 Message Date
Mike McQuaid
28c3215dba
analytics: support command and test-bot analytics.
These are used to analyse which commands are used and the
success/failure rate of official taps using `brew test-bot`.
2024-04-25 17:38:04 +01:00
Ruoyu Zhong
b1207f50bd
Merge pull request #17136 from Homebrew/revert-17091-revert-16941-elf-avoid-ldd
Revert "Revert "os/linux/elf: avoid using ldd for listing dynamic dependencies""
2024-04-24 07:22:46 +08:00
Bo Anderson
04fc95bfdb
Merge pull request #17138 from Homebrew/artifacts-pagination
utils/github: paginate artifact API result
2024-04-23 23:27:26 +01:00
Ruoyu Zhong
84abc628aa
utils/github: paginate artifact API result
There can be too many artifacts in a workflow run to fit in a single API
response, so we need to paginate the result.
2024-04-24 04:20:02 +08:00
Ruoyu Zhong
f4f8a12509
utils/github/api: support passing scopes in paginate_rest 2024-04-24 04:06:08 +08:00
Ruoyu Zhong
916b37388d
Revert "Revert "os/linux/elf: avoid using ldd for listing dynamic dependencies"" 2024-04-24 02:23:13 +08:00
Markus Reiter
5e636174e8
Explicitly mark non-public APIs. 2024-04-23 19:10:45 +02:00
Mike McQuaid
b5f857b627
Merge pull request #17081 from alebcay/formula-offline-phases
Support for opt-in network isolation in build/test sandboxes
2024-04-23 08:30:10 +01:00
Mike McQuaid
5ad4e6e293
Merge pull request #17128 from reitermarkus/docs-api-public
Explicitly mark non-private APIs.
2024-04-23 08:28:27 +01:00
Caleb Xu
aac156ccdf
fork: pass error_pipe path to yielded block 2024-04-22 22:39:45 -04:00
Markus Reiter
4b432c7ea4
Explicitly mark non-private APIs. 2024-04-22 21:16:49 +02:00
Douglas Eichelberger
cb71938fff Enable strict typing in CLI::Parser 2024-04-21 14:16:25 -07:00
Ruoyu Zhong
9ad60fe437
utils/github: avoid returning artifacts with the same name 2024-04-17 07:35:40 +08:00
Ruoyu Zhong
dd92ad8e1b
Update default artifact pattern to avoid migration problems 2024-04-17 06:15:14 +08:00
Ruoyu Zhong
0df71ea6a3
utils/github: support globbing artifacts 2024-04-17 03:34:42 +08:00
Ruoyu Zhong
852c5acb65
Revert "os/linux/elf: avoid using ldd for listing dynamic dependencies" 2024-04-16 02:50:12 +08:00
Caleb Xu
4b0e950736
utils/path: add child_of? method 2024-04-13 19:35:29 -04:00
Mike McQuaid
21d99c5e89
brew.rb: tell more people to not report issues.
- We should tell people to not report issues if they are running in an
  unsupported configuration.
- We should tell people to run `brew update` before reporting issues if
  they have `HOMEBREW_NO_AUTO_UPDATE` set.
- We should tell people to not report issues in more types of
  exceptions.
- Warn people in `HOMEBREW_NO_AUTO_UPDATE` documentation.
- DRY up `brew.rb` exception handling.

Co-authored-by: Colin Dean <colindean@users.noreply.github.com>
2024-04-03 08:16:01 +01:00
PikachuEXE
5f6cd3ed77
make more token types work as $HOMEBREW_GITHUB_API_TOKEN
Tokens of different token type(s) can be generated in GitHub Workflows by GitHub Apps

See doc & blog about token types
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github#githubs-token-formats
https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/
2024-04-02 16:18:59 +08:00
apainintheneck
226239da4c tests: remove unnecessary cache clearing
This PR removes all remaining unnecessary cache clearing in tests
from the codebase since we now clear all cachable classes between
tests making this functionally unnecessary.

Original PR to automatically clear caches:
- https://github.com/Homebrew/brew/pull/16746

I also moved the `Utils::Analytics` module to use cachable so
that we don't have to clear caches specifically in tests anymore.
2024-03-31 18:38:03 -07:00
Bo Anderson
da456da315
Merge pull request #16977 from Homebrew/cleanup-fixes
cleanup: fix various cases where cache wasn't being removed properly
2024-03-31 19:27:56 +01:00
Bartek Pacia
1aa2565cd0
make fine-grained PATs work as $HOMEBREW_GITHUB_API_TOKEN 2024-03-30 22:56:48 +01:00
Issy Long
a3932b44c0
Merge pull request #16899 from Homebrew/tapioca-compiler-for-tty-rbi
Convert the `utils/tty` RBI generator to a Tapioca compiler
2024-03-30 18:10:41 +00:00
Bo Anderson
bb0252875e
utils/bottles: fix outdated bottle check 2024-03-30 03:29:51 +00:00
Issy Long
05b716613b
Convert the utils/tty RBI generator to a Tapioca compiler
- The preferred way of doing RBI generation is via Tapioca. So I am
  trying to stop being intimidated by it, by learning how it works.
- This is very WIP still, currently failing with the following message
  because the `module` name is missing in the generated RBI file.

```
There are parse errors in the generated RBI files.

Errors:
  sorbet/rbi/dsl/tty.rbi:8: unexpected token tNL (2001)
  sorbet/rbi/dsl/tty.rbi:64: unexpected token "end" (2001)
```
2024-03-29 00:41:56 +00:00
Mike McQuaid
b3bf91acec
utils/github: fix tap logic.
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-03-28 12:30:01 +00:00
Mike McQuaid
fe16b14479
dev-cmd/bump*: limit the number of open PRs to 15.
Don't let users open more than 15 PRs at a time. We have other tooling
to nudge them to not do this but let's put it in the worst offenders:
the `bump*` commands.
2024-03-28 11:56:25 +00:00
Bo Anderson
636d883008
Support bash in privileged mode 2024-03-27 04:40:44 +00:00
Gibson Fahnestock
e11f797f25
bump-*-pr: handle HOMEBREW_NO_GITHUB_API=1 being set
We early return here
92a4311868/Library/Homebrew/utils/github/api.rb (L220)
, but don't then handle that through the stack.

Repro:

```console
❯ HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_GITHUB_API=1 brew bump-formula-pr --write-only --version 1.2.3 --no-audit jq
Error: undefined method `[]' for nil:NilClass
Do not report this issue until you've run `brew update` and tried again.
Warning: Removed Sorbet lines from backtrace!
/opt/homebrew/Library/Homebrew/utils/github.rb:565:in `block in fetch_pull_requests'
/opt/homebrew/Library/Homebrew/utils/github/api.rb:334:in `paginate_graphql'
/opt/homebrew/Library/Homebrew/utils/github.rb:564:in `fetch_pull_requests'
/opt/homebrew/Library/Homebrew/utils/github.rb:628:in `check_for_duplicate_pull_requests'
/opt/homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:456:in `check_open_pull_requests'
/opt/homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:135:in `run'
/opt/homebrew/Library/Homebrew/brew.rb:89:in `<main>'
Rerun with `--verbose` to see the original backtrace
```
2024-03-25 11:11:01 +00:00
Michael Cho
393a97f868
utils/pypi: allow overwriting resource patches
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-16 13:55:19 -04:00
Bo Anderson
e6f64767c5
utils/github: fix variable scope 2024-03-16 03:25:44 +00:00
Bo Anderson
7b0c3d54f1
utils/github: use GraphQL PR searching 2024-03-15 21:27:05 +00:00
Mike McQuaid
ea2892f8ee
brew.rb: handle missing args. 2024-03-07 16:20:20 +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
Mike McQuaid
5a68dea2d6
Merge pull request #16771 from cho-m/pypi-package_name-version
utils/pypi: default to formula version when using package_name
2024-03-06 15:21:37 +00:00
Mike McQuaid
c3d18113c3
Merge pull request #16790 from cho-m/pypi-ignore-test-resources
utils/pypi: ignore test resources when counting matches
2024-03-04 14:41:18 +00:00
Mike McQuaid
8d463b1f4b
Merge pull request #16772 from cho-m/pypi-specify-dependencies
utils/pypi: specify dependencies needed to update resources
2024-03-04 09:24:51 +00:00
Michael Cho
7303d642dd
utils/pypi: specify dependencies needed to update resources
Also allow optionally installing these dependencies. By default, only
`python@3.y` formulae will be automatically installed.

Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-02 22:01:25 -05:00
Michael Cho
408c8e806f
utils/pypi: ignore test resources when counting matches
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-01 16:26:34 -05:00
Kevin
4ea6a8ccbb Remove ability to skip the duplicate PR check in autobump
This simply removes the environment variable check. The code was disabled in core around two weeks ago in https://github.com/Homebrew/homebrew-core/pull/163023. We need this PR to land first as explained in https://github.com/Homebrew/actions/pull/506#issuecomment-1972489707 to unblock other PRs.
2024-02-29 20:47:28 -08:00
Michael Cho
79bbad9b38
utils/pypi: default to formula version when using package_name
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-02-29 13:48:43 -05:00
Mike McQuaid
136c50a52a
Merge pull request #16753 from cho-m/pypi-only-resources
utils/pypi: allow only updating `extra_packages`
2024-02-29 10:42:42 +00:00
Michael Cho
b59921d174
utils/pypi: improve style
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-02-27 13:32:52 -05:00
Issy Long
c2507fdc6d
formula_audit: Check the license(s) of the specific release
- Some repositories occasionally change their licenses. For example they
  release a version of the software with one license and then decide to change
  the license later.
- Now that `?ref=` is a parameter to the GitHub Repositories License API,
  we can use that in the license audit to check if the license of the specific
  release matches the one declared in the formula.
2024-02-27 16:53:54 +00:00
Michael Cho
31533cff05
utils/pypi: allow only updating extra_packages 2024-02-27 10:40:42 -05:00
Bo Anderson
913c46d994
utils/github: support HOMEBREW_GITHUB_API_TOKEN with --no-fork 2024-02-26 23:43:58 +00: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
Michael Cho
53bb72548a
utils/pypi: use python from formula for non-pypi url metadata
This fixes the resource detection when formula has Python packages that
are not compatible with current aliased python formula, e.g. `awscli`

Also switch to `opt_libexec` path to ignore Python formula patch version
and revision bump differences.
2024-02-22 09:42:41 -05:00
Mike McQuaid
7df07b991b
dev-cmd/bump*: do not allow forcing multiple PRs.
If there are duplicate PRs: we shouldn't suggest and allow a trivial
override. Instead, they should be created manually.

An undocumented override exists for BrewTestBot to do autobumps.
2024-02-15 17:02:31 +00:00
Sean Molenaar
71123a07fd
Merge pull request #16603 from SMillerDev/fix/pypy_bump/fail_superfluous_excludes
fix: fail if superfluous packages are excluded
2024-02-12 16:37:05 +01:00