1094 Commits

Author SHA1 Message Date
Michka Popoff
a5c29fff2d
utils/github.rb: convert pr to integer
Follow up adter #13124

I made the choice to convert the pr variable to an integer
at the very end and adjust the tests.

It would be maybe more consistent to work with an integer
everywhere, but this needs a more careful analysis and we
are in a hurry to fix the homberew-core upload CI

Fixes:
2022-04-11T20:19:34.1395885Z [31mError:[0m : Variable $pr of type Int! was provided invalid value
2022-04-11T20:19:34.1398279Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github/api.rb:261:in `open_graphql'
2022-04-11T20:19:34.1399774Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:310:in `get_workflow_run'
2022-04-11T20:19:34.1403699Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:418:in `block (4 levels) in pr_pull'
2022-04-11T20:19:34.1405233Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:417:in `each'
2022-04-11T20:19:34.1406723Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:417:in `block (3 levels) in pr_pull'
2022-04-11T20:19:34.1408112Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/lib/ruby/2.6.0/fileutils.rb:128:in `chdir'
2022-04-11T20:19:34.1408986Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/lib/ruby/2.6.0/fileutils.rb:128:in `cd'
2022-04-11T20:19:34.1409813Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:400:in `block (2 levels) in pr_pull'
2022-04-11T20:19:34.1410671Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
2022-04-11T20:19:34.1411495Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:399:in `block in pr_pull'
2022-04-11T20:19:34.1412250Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:388:in `each'
2022-04-11T20:19:34.1413056Z /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-pull.rb:388:in `pr_pull'
2022-04-11 22:38:42 +02:00
Bo Anderson
3e75b165ae
utils/github: rewrite get_workflow_run using GraphQL 2022-04-11 20:35:03 +01:00
Adrian Ho
f5f4d5b082 github_api: fix recommended PAT URL
Closes #13030.
2022-03-24 10:18:02 +08:00
Issy Long
84632598a0
utils/github: Add a branch_exists? method
- I wrote this as part of
  https://github.com/issyl0/homebrew-maintenance-utils/blob/main/cmd/find-invalid-head-branches.rb,
  as I needed to check if a branch exists on a repo, and thought I'd properly add
  it in case it's useful to others.
2022-03-05 21:29:19 +00:00
Niklas Higi
00f209e16e
Recommend interactive usage of fish_add_path
Since the `fish_add_path` command modifies a universal Fish variable
(which is automatically persisted to a file) it's unnecessary to run it
again every time a new shell is opened.
2022-02-05 16:29:09 +01:00
Carlo Cabrera
2b60a99d4a
Revert "shebang: raise error if no rewriting"
This is causing failures when attempting to rewrite shebangs during the
cleanup stage of `brew install`.

See, for example, Homebrew/homebrew-core#94323,
Homebrew/homebrew-core#94321.

This reverts commit 7e6be5eb4474ed9eaa4b8e9a5a45e3340186840c.
2022-02-02 20:44:03 +08:00
Branch Vincent
7e6be5eb44
shebang: raise error if no rewriting 2022-02-01 00:17:50 -05:00
Nanda H Krishna
a7271f8900
brew style --fix 2022-01-18 21:13:39 -05:00
Mike McQuaid
af6d995de8
dev-cmd/bump: add switch to open pull requests.
This enables the simplification of
https://github.com/Homebrew/actions/blob/master/bump-formulae/main.rb
and exposing this workflow to more Homebrew users.
2022-01-12 17:31:55 +00:00
Mike McQuaid
a9e348ce14
utils/pypi: ensure pipgrip is installed.
Rather than failing if it isn't installed: install it if needed.
2022-01-11 17:12:04 +00:00
Rylan Polster
feb93167ad
Rename and fix Formatter:wrap to Formatter.format_help_text 2022-01-08 23:13:08 -05:00
Mike McQuaid
b09f421027
repology: always use Homebrew curl.
This seems to be required even with TLSv1.3 support now.

Also, while we're here, improve the error handling/output.
2022-01-03 13:17:12 +00:00
Steve Peters
d53dab62c9
bump-revision: add --remove-bottle-block option
This removes a bottle block for the specified formulae
while bumping the revision.
2021-12-26 03:42:39 -08:00
Rylan Polster
2e4185a525
Fix brew typecheck 2021-12-24 21:15:21 -05:00
Rylan Polster
2e6b6ab3a2
Fix style 2021-12-24 21:15:21 -05:00
Bob Lail
31a831ae11 Bypass searching for open Issues when failing to install a formula without a tap
Given a formula with a broken build, if you install it locally with `brew install path/to/formula.rb`, when the build fails, Homebrew will attempt to [search for open issues on the tap](073c4177b5/Library/Homebrew/exceptions.rb (L489)); but in this case `formula.tap` is `nil` and `tap.full_name` would raise a `NoMethodError` yielding this output:

```
$ brew install ./erg.rb
Error: Failed to load cask: ./erg.rb
Cask 'erg' is unreadable: wrong constant name #<Class:0x00007fd89b246cd0>
Warning: Treating ./erg.rb as a formula.
==> Downloading https://github.com/square/erg/archive/v1.1.1.tar.gz
Already downloaded: /Users/lail/Library/Caches/Homebrew/downloads/54e3fce84302901d76d50b53aa7fe760cfcf81c9842a232d6b29e771de6ec9c5--erg-1.1.1.tar.gz
Warning: Cannot verify integrity of '54e3fce84302901d76d50b53aa7fe760cfcf81c9842a232d6b29e771de6ec9c5--erg-1.1.1.tar.gz'.
No checksum was provided for this resource.
For your reference, the checksum is:
  sha256 "8dbcff3dfd67b8f6e8f2dfd4f57cf818ce0cd6ce4b52566611e698fc8778507f"
==> go get github.com/square/erg
Last 15 lines from /Users/lail/Library/Logs/Homebrew/erg/01.go:
2021-12-02 16:45:31 +0000

go
get
github.com/square/erg

go: downloading github.com/square/erg v1.2.1
go: downloading vbom.ml/util v0.0.3
go: downloading vbom.ml/util/sortorder v1.0.2
go: downloading github.com/square/grange v0.0.0-20201015231752-48d66acdd125
go: downloading github.com/deckarep/golang-set v0.0.0-20170202203032-fc8930a5e645
go: downloading github.com/fvbommel/sortorder v1.0.1
go: downloading github.com/orcaman/concurrent-map v0.0.0-20160823150647-8bf1e9bacbf6
github.com/square/erg imports
	vbom.ml/util/sortorder: cannot find module providing package vbom.ml/util/sortorder

Do not report this issue to Homebrew/brew or Homebrew/core!

/usr/local/Homebrew/Library/Homebrew/utils/github.rb:64:in `issues_for_formula': undefined method `full_name' for nil:NilClass (NoMethodError)
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:489:in `fetch_issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:485:in `issues'
	from /usr/local/Homebrew/Library/Homebrew/exceptions.rb:539:in `dump'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:155:in `rescue in <main>'
	from /usr/local/Homebrew/Library/Homebrew/brew.rb:143:in `<main>'
/usr/local/Homebrew/Library/Homebrew/formula.rb:2306:in `block in system': Failed executing: go get github.com/square/erg (BuildError)
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:2242:in `open'
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:2242:in `system'
	from /Users/lail/Code/homebrew-formulas/erg.rb:13:in `install'
	from /usr/local/Homebrew/Library/Homebrew/build.rb:172:in `block (3 levels) in install'
	from /usr/local/Homebrew/Library/Homebrew/utils.rb:588:in `with_env'
	from /usr/local/Homebrew/Library/Homebrew/build.rb:134:in `block (2 levels) in install'
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:1297:in `block in brew'
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:2472:in `block (2 levels) in stage'
	from /usr/local/Homebrew/Library/Homebrew/utils.rb:588:in `with_env'
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:2471:in `block in stage'
	from /usr/local/Homebrew/Library/Homebrew/resource.rb:126:in `block (2 levels) in unpack'
	from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:115:in `chdir'
	from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:115:in `chdir'
	from /usr/local/Homebrew/Library/Homebrew/download_strategy.rb:102:in `stage'
	from /usr/local/Homebrew/Library/Homebrew/resource.rb:122:in `block in unpack'
	from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
	from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
	from /usr/local/Homebrew/Library/Homebrew/mktemp.rb:63:in `run'
	from /usr/local/Homebrew/Library/Homebrew/resource.rb:208:in `mktemp'
	from /usr/local/Homebrew/Library/Homebrew/resource.rb:121:in `unpack'
	from /usr/local/Homebrew/Library/Homebrew/resource.rb:96:in `stage'
	from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/lib/ruby/2.6.0/forwardable.rb:230:in `stage'
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:2451:in `stage'
	from /usr/local/Homebrew/Library/Homebrew/formula.rb:1290:in `brew'
	from /usr/local/Homebrew/Library/Homebrew/build.rb:129:in `block in install'
	from /usr/local/Homebrew/Library/Homebrew/utils.rb:588:in `with_env'
	from /usr/local/Homebrew/Library/Homebrew/build.rb:124:in `install'
	from /usr/local/Homebrew/Library/Homebrew/build.rb:224:in `<main>'
```
2021-12-02 10:56:44 -06:00
Bo Anderson
c6ca375d5a
utils/ruby.sh: fix error with older Bash
Fixes #12472.
2021-12-02 02:14:11 +00:00
XuehaiPan
d1aac8857a tests/utils/git_spec: update tests for ensure_formula_installed! 2021-11-24 00:30:26 +08:00
XuehaiPan
3376479e95 utils: add method ensure_formula_installed! 2021-11-23 22:48:39 +08:00
Mike McQuaid
07f14c32e9
Merge pull request #12423 from FnControlOption/deps
deps: add `--graph` and `--dot` switches
2021-11-17 10:49:19 +00:00
fn ⌃ ⌥
a188215d69 deps: minor refactoring 2021-11-16 08:45:59 -08:00
Carlo Cabrera
105d1f9cfc
utils/github/actions: make file a mandatory argument
An annotation is pretty useless if you don't specify a file to place the
annotation on, so let's just require it.
2021-11-16 23:42:03 +08:00
Mike McQuaid
762b35bbc8
Merge pull request #12438 from carlocab/actions-annotations
utils/github/actions: support notices and new annotation parameters
2021-11-16 12:10:30 +00:00
Carlo Cabrera
6795a88520
utils/github/actions: support notices and new annotation parameters
GitHub Actions annotations also suport a "notice" annotation type. You
can also set the title of an annotion, and the set `endLine` and
`endColumn` parameters.

See https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions
2021-11-16 14:44:43 +08:00
fn ⌃ ⌥
dddce0de74 Style fixes 2021-11-15 10:49:07 -08:00
fn ⌃ ⌥
e6e730f49d update-python-resources: skip dependencies of excluded packages 2021-11-14 03:52:44 -08:00
XuehaiPan
50cde98fd3 utils/shfmt.sh: allow single line if blocks 2021-11-12 19:57:32 +08:00
XuehaiPan
391e7e22f8 utils/shfmt.sh: add != and =~ to within test regex 2021-11-12 19:57:28 +08:00
XuehaiPan
2345a34095 utils/shfmt.sh: rename regex variables 2021-11-12 19:29:09 +08:00
Caleb Xu
333f44f84e
github: use system_command when pushing bump PR 2021-11-10 12:42:14 -05:00
EricFromCanada
093e6e11da
svn: add flags if needed for :trust_cert or remote_exists? 2021-11-09 13:56:40 -05:00
Bo Anderson
d0f6f7d52b
Require Ruby 2.6.8 2021-11-08 18:39:21 +00:00
XuehaiPan
0331cbeda3 utils/shfmt.sh: use utils/shfmt.sh as shell script formmatter 2021-11-08 20:57:52 +08:00
EricFromCanada
c952ea7358
bump: fix tests 2021-10-25 15:55:11 -04:00
Rylan Polster
fa4bb7d74a
Refactor audit exception handling 2021-10-21 21:11:05 -04:00
Bo Anderson
2d539bc6af
utils/curl: don't use --cookie-jar to enable cookie engine
Fixes #12293.
2021-10-21 22:52:20 +01:00
Bevan Kay
55d9e88a14
Mirror --write-only behaviour to cask, fix incorrect arg reference 2021-10-20 22:40:08 +11:00
Mike McQuaid
9b5f191db1
Merge pull request #12236 from knksmith57/support-custom-google-analytics-id-override
feat: support user-configured Google Analytics reporting
2021-10-20 10:42:03 +01:00
EricFromCanada
811d0fa0bd
bump: add option to retrieve a subset of results
Plus a few fixes for output.
2021-10-19 20:14:39 -04:00
Kyle Smith
7866a4b586 feat: support user-configured Google Analytics reporting
Allow users to set a custom Google Analytics tracking ID to report user behaviour
via new environment variable: $HOMEBREW_ADDITIONAL_GOOGLE_ANALYTICS_ID.

If provided, this tracking ID will be used _in addition to_ the default tracking
ID used by <https://brew.sh/analytics/>.
2021-10-19 10:49:43 -05:00
Bevan Kay
70ac4d70d2
audit: extend cloudflare https audit exception regex 2021-10-11 15:52:37 +11:00
Bo Anderson
c6d27823ea
Merge pull request #12206 from Bo98/vendor-gems-fix
utils/git: remove external dependency loading
2021-10-07 17:41:22 +01:00
Xuehai Pan
2d89e7d24e
utils/shfmt.sh: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-07 22:16:57 +08:00
Bo Anderson
36a57aa738
utils/git: remove external dependency loading 2021-10-07 14:51:52 +01:00
XuehaiPan
3113bf7158 utils/shfmt.sh: redirect differences to stderr 2021-10-07 19:48:53 +08:00
XuehaiPan
735eb78601 utils/shfmt.sh: success with auto-fixable changes on brew style --fix 2021-10-07 19:43:03 +08:00
Mike McQuaid
7ec024e090
utils/git: require formula.
This is currently causing `brew vendor-gems` to fail.
2021-10-07 11:23:55 +01:00
Mike McQuaid
96e060056f
Merge pull request #12196 from Rylan12/release-notes-api
Use GitHub API to generate release notes
2021-10-07 11:22:21 +01:00
Carlo Cabrera
7dabb465b3
system_config: don't print path to curl shim
See discussion at #12191.
2021-10-06 23:58:04 +08:00
Rylan Polster
4f1bbf003a
Use GitHub API to generate release notes 2021-10-05 14:43:17 -04:00