1610 Commits

Author SHA1 Message Date
Michael Cho
43ee408793
utils/curl: workaround curl bug for --head --request GET
The `curl --head --request GET` causes a full download to happen on
`curl` from 8.7.0 to 8.9.1[^1] which causes poor UX due to slow
Cask downloads that can take almost twice as long as they should.

[^1]: https://github.com/Homebrew/brew/issues/18213
2024-10-05 14:05:59 -04:00
Patrick Linnane
c2e2b23c50
brew style --fix
Signed-off-by: Patrick Linnane <patrick@linnane.io>
2024-10-02 10:03:12 -07:00
Bevan Kay
53e8739d24
utils/shared_audits: audit deprecate/disable reasons 2024-09-30 23:11:44 +10:00
Bob Lail
c752c00ac6 brew vendor-gems: commit updates. 2024-09-27 14:44:40 -07:00
Bo Anderson
567f5eb4be
Allow sockets to use longer paths on macOS 2024-09-27 04:37:03 +01:00
Mike McQuaid
94416e82f0
Add new odeprecated, odisabled, remove disabled code.
Prepare the usual deprecation cycle for Homebrew 4.4.0.
2024-09-24 10:15:34 +01:00
Mike McQuaid
1c390093f8
Revert "Limit usage of GitHub Actions Annotations" 2024-09-16 16:52:03 +01:00
Carlo Cabrera
c6e2cd9037
Limit usage of GitHub Actions Annotations
- only use annotations for `opoo` and `onoe` if
  `HOMEBREW_GITHUB_ACTIONS` is set. This will make using `brew` less
  noisy in GitHub Actions for third parties. See
  Homebrew/discussions#5602.
- if we've already called `puts_annotation_if_env_set`, then we no
  longer need to print the message to `$stderr`. The message from the
  annotation already show up in the GitHub Actions log, so printing to
  `$stderr` just leads to duplicate messages in the log.

While we're here, let's make sure to forward the `file:` and `line:`
kwargs of `puts_annotation_if_env_set` to the `Annotation` constructor.
2024-09-15 11:31:54 +08:00
Mike McQuaid
c8e8aa5600
Merge pull request #17756 from reitermarkus/concurrent-downloads
Implement concurrent downloads in `brew fetch`.
2024-09-09 08:41:11 +01:00
Bo Anderson
d8d9151c8c
Merge pull request #18283 from Homebrew/annotation-titles
github/actions: fix annotation title handling
2024-09-09 02:55:16 +01:00
Carlo Cabrera
54383d1c5f
github/actions: fix annotation title handling
We currently generate invalid workflow commands when we create
annotations with a `title` but no `file`. Let's fix that.

While we're here, let's improve handling of `title`s with `:`s. We
cannot use `title`s with `::` since GitHub Actions uses this as a
separator for different fields between a workflow command.

Let's also make sure `metadata` never ends in a `:` to avoid confusing
the GitHub Actions command parser about where the `::` separator is
meant to be.
2024-09-08 17:56:04 +08:00
Sam Ford
c2f0bacec8
Curl#curl_headers: Work with 56 exit_status
I previously added the 8 curl exit code (weird server reply) to the
list of non-success exit codes that `#curl_headers` will handle.
We're now seeing failures with a 56 exit code (failure in receiving
network data), where the server returns a 4xx response for a `HEAD`
request but the same request using `GET` works as expected (e.g.,
casks like `beeper`, `get-api`, `odrive`, `ui`, etc.).

This adds 56 to the list of exit codes in `#curl_headers`, so a
response with a 4xx HTTP status will be automatically retried using
`GET`.
2024-09-07 10:25:47 -04:00
Markus Reiter
9fd4c97fac
Add method for moving cursor up and to the beginning. 2024-09-04 22:54:29 +02:00
Markus Reiter
984cde114a
Move escape codes to Tty. 2024-09-04 22:54:28 +02:00
Markus Reiter
0cafa83f8a
Simplify Tty methods. 2024-09-04 22:54:26 +02:00
Markus Reiter
a114575663
Fix wrong terminal size. 2024-09-04 22:54:25 +02:00
Markus Reiter
6434533ff5
Remove Whirly and show concurrent downloads. 2024-09-04 22:54:24 +02:00
Bo Anderson
176ec0c6aa
utils/github: use x-access-token 2024-09-04 06:14:32 +01:00
Bo Anderson
e4896f3440
list.sh: support column output 2024-09-03 04:11:29 +01:00
Carlo Cabrera
cd5cf4e2c8
Merge pull request #18214 from Homebrew/audit-result-keyword 2024-09-02 16:14:30 +08:00
Carlo Cabrera
c73d08c75b
Update comment re #nil? vs #blank? 2024-09-02 16:02:35 +08:00
Adam Blazczak
245c93785a Fix SyntaxError introduced by a refactor in bc0f5ee
$ brew update
==> Updating Homebrew...
To restore the stashed changes to /usr/local/Homebrew, run:
  cd /usr/local/Homebrew && git stash pop
  File "<string>", line 1
    import fcntl; fcntl.flock(, fcntl.LOCK_EX | fcntl.LOCK_NB)
                              ^
SyntaxError: invalid syntax

Introduced on May 2, 2024 with bc0f5ee62a
2024-09-01 10:40:23 -07:00
Carlo Cabrera
654a58237e
formula: make audit_result a kwarg in inreplace
This allows us to get rid of a RuboCop disable, and will make formulae
easier to read.
2024-09-01 05:05:13 +08:00
Sam Ford
24ac6967ba
Adjust typing around #check_pull_requests
`brew bump-formula-pr` is encountering a type error, as the inferred
return type of `GitHub#check_for_duplicate_pull_requests` doesn't
align with the explicit return type of `#check_pull_requests`:

```
Error: Return value: Expected type T.nilable(T::Array[String]), got
  type Module with value T::Private::Types::Void::VOID
Caller: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/
  bump-formula-pr.rb:137
Definition: /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/
  dev-cmd/bump-formula-pr.rb:472 (Homebrew::DevCmd::BumpFormulaPr
  #check_pull_requests)
```

This addresses the issue by adding a type signature with a `void`
return type to `#check_for_duplicate_pull_requests` and setting the
return type of `#check_pull_requests` to `void` as well. The return
type from `#check_pull_requests` isn't used, so a `void` return type
is arguably a better reflection of the method's behavior. The
`#check_pull_requests` method in `BumpCaskPr` has a `void` return
type, so this change brings the `BumpFormulaPr` method in line.
2024-08-31 16:42:43 -04:00
Mike McQuaid
fe909c41b8
Improve duplicate pull request handling
- change the messaging depending on how confident we are that we're
  actually looking at duplicates i.e. we're not confident without a
  version number supplied
- similarly, just warn instead of failing with an error (and no
  override) if we're not confident that we're looking at duplicates
  because a version wasn't supplied
- change `bump-cask-pr` and `bump-formula-pr` to always check for all
  pull requests with the new version number (to allow failing on this)
  rather than only checking closed pull requests with a version number
- change `bump` to check for definite/maybe duplicate PRs and only
  exit if they are definitely duplicates
- cleanup some variable usage to DRY things up a bit
2024-08-30 14:21:42 +01:00
Carlo Cabrera
e3d295ae12
Merge pull request #18203 from Homebrew/sponsorships-error 2024-08-30 11:13:29 +08:00
Carlo Cabrera
ed589c0a19
Merge pull request #18202 from Homebrew/fix-sponsorships-query 2024-08-30 11:02:28 +08:00
Carlo Cabrera
c740bef176
utils/github: improve sponsorships error handling
Let's make sure we get the opportunity to print the errors if the query
response doesn't have the form we expected it to take.
2024-08-30 11:00:53 +08:00
Carlo Cabrera
5897ed80d9
utils/github: fix sponsorships GraphQL query
This fixes the failure in our sponsorships workflow.
2024-08-30 10:50:59 +08:00
Carlo Cabrera
cabbb0b8e3
Remove GraphQL debug output
Let's get this ready to go since we don't want to accidentally leak
private information.
2024-08-30 10:45:19 +08:00
Carlo Cabrera
7645484ac3
utils/github/api: add debug output for open_graphql
Our updating sponsors/maintainers/etc workflow is broken.

Let's add some debug output to help me fix it.
2024-08-30 10:15:56 +08:00
Michael Cho
06fc2247c7
Merge pull request #18178 from cho-m/github-tag
utils/shared_audits: GitHub urls can have '.' in repo and '/' in tag
2024-08-28 21:55:29 -04:00
Bo Anderson
6a0db5035f
Fix misuse of fork in sandbox causing crashes 2024-08-28 13:53:01 +01:00
Michael Cho
d1dc3b2206
utils/shared_audits: GitHub urls can have '.' in repo and '/' in tag 2024-08-27 11:39:50 -04:00
Mike McQuaid
81d26f8059
Merge pull request #18169 from cho-m/spdx-case-sensitive 2024-08-27 09:28:55 +01:00
Michael Cho
cccab0d9a9
utils/shared_audits: allow subgroups in gitlab url 2024-08-26 23:07:31 -04:00
Michael Cho
82fbbcc88b
utils/spdx: fix invalid SPDX syntax for symbols
Also use more common uppercase operators for backwards compatibility
2024-08-26 13:55:37 -04:00
Mike McQuaid
d58302ef6b
Merge pull request #18147 from Homebrew/shellcheck-helpers.sh 2024-08-26 09:17:24 +01:00
Carlo Cabrera
43ec1fc38a
utils/github: a few more simplifications
Follow-up to #18150.
2024-08-25 04:33:42 +08:00
Bo Anderson
0408c184ac
Merge pull request #18152 from Homebrew/more-paginate-graphql
utils/github: use `paginate_graphql` in `sponsorships`
2024-08-24 20:17:02 +01:00
Carlo Cabrera
4a7579c693
utils/github: use paginate_graphql in sponsorships
`sponsorships` has its own implementation of GraphQL pagination. We can
simplify this by using `paginate_graphql` instead.
2024-08-25 01:34:36 +08:00
Carlo Cabrera
03d9a3dda5
utils/github: use #fetch
Co-authored-by: Markus Reiter <me@reitermark.us>
2024-08-24 23:10:39 +08:00
Carlo Cabrera
f873835b97
utils/github: fix too_many_open_prs?
This doesn't count PRs from forks, so it only works correctly for
maintainers (and only if they use non-fork branches).

Let's fix that, and:
- simplify the logic by using `paginate_graphql`
- return early if it's impossible for them to have too many open PRs
2024-08-24 22:51:23 +08:00
Carlo Cabrera
ca0639998a
utils/helpers.sh: remove a shellcheck disable
I don't think we need this.
2024-08-24 08:54:01 +08:00
Bo Anderson
092dcdbeac
shared_audits: remove module_function 2024-08-23 03:34:48 +01:00
Bo Anderson
6db4ed2793
Replace some include Kernel usages with requires_ancestor 2024-08-20 19:10:14 +01:00
Mike McQuaid
954f24077e
Merge pull request #18094 from Homebrew/include-kernel 2024-08-20 09:08:43 +01:00
Bo Anderson
3627cca066
Remove some unnecessary include Kernel 2024-08-20 04:16:18 +01:00
Bo Anderson
561cc17a74
utils/gems: remove module_function 2024-08-20 03:57:23 +01:00
Rui Chen
1270eb37b1
formula_auditor: fix eol check
Co-authored-by: Ruoyu Zhong <zhongruoyu@outlook.com>
2024-08-13 16:36:38 +08:00