1602 Commits

Author SHA1 Message Date
Daiki Mizukami
7cfcc596b9
Utils::Cp: Move macOS-specific code to extend/os/mac 2024-06-07 19:03:48 +09:00
Daiki Mizukami
58852106c1
Utils::Cp: Rename copy* methods to copy*_with_attributes
As per review feedback:

https://github.com/Homebrew/brew/pull/17373#pullrequestreview-2103870774
2024-06-07 19:03:33 +09:00
Daiki Mizukami
a5500aa7f2
Utils::Cp: Fix Linux tests 2024-06-06 21:45:28 +09:00
Sam Ford
8236a70771
Curl: Add constants for used curl errors
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2024-06-04 11:58:02 -04:00
Sam Ford
d3eac3848e
Curl#curl_headers: Work with 8 exit_status
I recently noticed that ~23 `livecheck` blocks using the `HeaderMatch`
strategy were failing. Looking into it, these fail when using a `HEAD`
request and retry with `GET` but the resulting response with the
headers we want is simply discarded because the `exit_status` from
curl is 8 ("weird server reply").

This resolves the issue by adding a special case for this exit status,
so `#curl_headers` will return the headers in this scenario.
2024-06-04 11:48:41 -04:00
Issy Long
a23dad737f
Fix constructing search query strings with date ranges
- Both `from` and `to` are now separate keyword arguments
  in a bunch of places, not part of `args`.
- When we switched this around, we didn't realize this
  method needed updating to correctly construct the time
  range query.
- This led to further inaccurate counts in `brew contributions`
  for reviews, since `from` and `to` are not valid search qualifiers
  for the GitHub PR search APIs.
2024-06-02 14:31:18 +01:00
Mike McQuaid
e573a53868
Output GitHub warning/error annotations to stderr
This will mean e.g. `opoo` etc. will output to stdout and not end up
being in the stdout of `brew deps` etc.

While we're here, remove a duplicate annotation output I noticed in
`extend/kernel.rb`.

Inspired by conversation in:
https://github.com/Homebrew/homebrew-test-bot/issues/1082
2024-05-31 09:31:44 +01: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
Daiki Mizukami
942906b74a
Utils::Cp: Use cp from macOS 2024-05-27 18:10:46 +09:00
Daiki Mizukami
b905959a99
Add Utils::Cp for interacting with cp command
This module determines the `cp` command to use based on availability of
the `coreutils` formula and optimizes the command invocation to prefer a
lightweight copy-on-write clone, which is significantly faster than a
full file copy and helps to reduce the risk of exhausting the storage
during the operation.
2024-05-27 12:11:38 +09:00
Eric Knibbe
07e69b0ff2
livecheck/strategy: verify fail-with-body support 2024-05-23 13:08:25 -04:00
Carlo Cabrera
6b59c032a7
utils/shell: add + to safe shell characters
`+` does not require escaping in the shell. (Not for Bash and Zsh, at
least.)
2024-05-18 16:01:07 +08:00
Mike McQuaid
0c1766510a
env_config: add HOMEBREW_BUNDLE_USER_CACHE.
Used to configure `BUNDLE_USER_CACHE`.
2024-05-18 00:08:42 +09:00
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