1738 Commits

Author SHA1 Message Date
Mike McQuaid
1eb99cdb0e
utils/gems: use BUNDLE_USER_CACHE instead of BUNDLE_CACHE_PATH.
Take two at https://github.com/Homebrew/brew/pull/17304 with the correct
variable name this time.

Fixes #17276.
2024-05-17 23:00:12 +09:00
Mike McQuaid
bde9afa70e
Portable Ruby 3.3.1
Use the latest version of Portable Ruby.
2024-05-17 00:23:36 +01:00
Mike McQuaid
03bf6db08c
utils/gems: handle undefined HOMEBREW_CACHE.
Some call paths can result in this not being defined so let's handle
that better.
2024-05-16 11:08:51 +09:00
Mike McQuaid
cb86847d95
utils/gems: use HOMEBREW_CACHE for bundler cache.
Fixes #17276
2024-05-15 22:17:02 +09:00
Patrick Linnane
8ec44f279b
github.rb: fix grammar
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-13 14:57:08 -07:00
Patrick Linnane
992b50a413
various: fix minor typos
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-05-13 14:30:06 -07: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
Bo Anderson
b790c7fe8c
utils/github/api: use real UID for auth fetching 2024-05-09 11:55:14 +01:00
Mike McQuaid
b5b37d8c80
Merge pull request #17204 from Homebrew/ruby_scripts_to_utils_files
Library/Homebrew: move stdin ruby scripts to files under `utils`.
2024-05-02 10:44:00 +01:00
Mike McQuaid
bc0f5ee62a
Library/Homebrew: move stdin ruby scripts to files under utils.
This avoids can avoid UID/EUID related issues with Ruby scripts passed
over `stdin` clashing with Ruby security features.

It's also just a bit nicer to have Ruby scripts in files instead.

While we're here:
- refactor some shared logic into a new `setup-gem-home-bundle-gemfile`
  function in `ruby.sh`
- do some general cleanup of `lock.sh`
- prioritise `flock` over `python` in `lock.sh`
2024-05-02 10:33:42 +01: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
Markus Reiter
0b56d0be4a
Document Tab.for_keg and use Keg#tab where possible. 2024-04-28 20:50:13 +02:00
Markus Reiter
c26d10e4cb
Merge pull request #17170 from alebcay/backtrace-strict-typing 2024-04-28 20:33:54 +02:00
Caleb Xu
985cc83008
utils/gzip: enable strict typing 2024-04-28 02:37:18 -04:00
Caleb Xu
783e72dc59
utils/backtrace: enable strict typing 2024-04-28 02:36:19 -04:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Mike McQuaid
ecd96a2c51
utils/analytics: revert a test-bot analytics change.
https://github.com/Homebrew/brew/pull/17154#discussion_r1581102553 was
ignored by auto-merge, whoops.
2024-04-26 15:24:12 +01:00
Mike McQuaid
af0f115a23
Merge pull request #17154 from Homebrew/cleanup_test_bot_analytics
utils/analytics: cleanup test-bot analytics.
2024-04-26 15:16:14 +01:00
Mike McQuaid
414e221990
utils/analytics: cleanup test-bot analytics.
Sort options to ensure consistent ordering and improve readability.

Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2024-04-26 14:57:52 +01:00
Markus Reiter
c76170a456
Hide #to_s in docs. 2024-04-26 14:04:55 +02:00
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