1602 Commits

Author SHA1 Message Date
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
Issy Long
45978435e7
rubocop: Use Sorbet/StrictSigil as it's better than comments
- Previously I thought that comments were fine to discourage people from
  wasting their time trying to bump things that used `undef` that Sorbet
  didn't support. But RuboCop is better at this since it'll complain if
  the comments are unnecessary.

- Suggested in https://github.com/Homebrew/brew/pull/18018#issuecomment-2283369501.

- I've gone for a mixture of `rubocop:disable` for the files that can't
  be `typed: strict` (use of undef, required before everything else, etc)
  and `rubocop:todo` for everything else that should be tried to make
  strictly typed. There's no functional difference between the two as
  `rubocop:todo` is `rubocop:disable` with a different name.

- And I entirely disabled the cop for the docs/ directory since
  `typed: strict` isn't going to gain us anything for some Markdown
  linting config files.

- This means that now it's easier to track what needs to be done rather
  than relying on checklists of files in our big Sorbet issue:

```shell
$ git grep 'typed: true # rubocop:todo Sorbet/StrictSigil' | wc -l
    268
```

- And this is confirmed working for new files:

```shell
$ git status
On branch use-rubocop-for-sorbet-strict-sigils
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Library/Homebrew/bad.rb
        Library/Homebrew/good.rb

nothing added to commit but untracked files present (use "git add" to track)

$ brew style
Offenses:

bad.rb:1:1: C: Sorbet/StrictSigil: Sorbet sigil should be at least strict got true.
^^^^^^^^^^^^^

1340 files inspected, 1 offense detected
```
2024-08-12 15:24:27 +01:00
Mike McQuaid
6105728c31
Merge pull request #18004 from Homebrew/more-srb-strict 2024-08-12 14:22:00 +01:00
Issy Long
0355f07e0d
utils/shared_audits: Bump to Sorbet typed: strict 2024-08-10 16:43:37 +01:00
Issy Long
e9cb08f431
utils/service: Bump to Sorbet typed: strict 2024-08-10 16:43:37 +01:00
Issy Long
ef9520cd6c
utils/svn: Bump to Sorbet typed: strict 2024-08-10 12:59:51 +01:00
Issy Long
29a3ede4b1
utils/user: Bump to Sorbet typed: strict 2024-08-10 00:31:58 +01:00
Issy Long
058688f239
utils/link: Bump to Sorbet typed: strict 2024-08-10 00:23:29 +01:00
なつき
2e2db25496 Use spawn to replace fork + exec 2024-08-09 14:16:36 -07:00