153 Commits

Author SHA1 Message Date
Rylan Polster
4e61f61a20
utils/github: handle non-standard tap remotes 2021-03-21 12:35:45 -04:00
Bo Anderson
20ff68a425
Fix brew style. 2021-03-17 20:45:44 +00:00
nandahkrishna
7b0352f167
utils/github/api: simplify pagination 2021-03-11 14:50:19 +05:30
hyuraku
178ae750b9 utils/github: set default args to search_code 2021-02-26 21:31:30 +09:00
nandahkrishna
f7c8810214
utils/github/api: remove 'api' from method names 2021-02-17 23:47:05 +05:30
nandahkrishna
6d948bf6ab
utils/github: add wrapper for GitHub API method 2021-02-17 23:04:15 +05:30
nandahkrishna
56e0c3d9e8
Update GitHub API usage 2021-02-15 22:38:27 +05:30
nandahkrishna
9d8a5827a3
utils/github: split module 2021-02-15 21:08:10 +05:30
nandahkrishna
15f936a22a
dev-cmd/update-maintainers: implement suggestions from code review 2021-02-08 23:33:26 +05:30
nandahkrishna
6026c7c74d
brew update-maintainers: dev-cmd to update maintainers in README 2021-02-08 23:33:25 +05:30
Marcus Maxwell
f1ef1afd21
Add workflow scope to github.rb 2021-02-08 12:30:19 +00:00
Issy Long
f71ea65ee0
utils/github: Say "macOS keychain" in MissingAuthenticationError
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-02-05 13:52:32 +00:00
Issy Long
9394fe2b52
utils/github: Use constant everywhere for "create a PAT" message
- This way if we ever change this messaging, we only have to do so once.
2021-02-05 12:45:11 +00:00
Issy Long
ccb6d5e834
utils/github: Handle users not having any GitHub credentials
- When running `brew request-bottle`, users who don't have credentials
  in the macOS keychain (ie, Linux users) or `HOMEBREW_GITHUB_API_TOKEN`
  receive "Error: Not Found" from the GitHub API returning a 404.
- This is cryptic and confusing for newcomers to Linux maintenance, and
  potentially confusing to other folks using `open_api` where
  credentials are expected yet unset.
- This adds a new `MissingAuthenticationError` to handle the case where
  the GitHub API returns 404 and there are no creds yet API scopes are
  required.

Before:

```
issyl0@sky:/home/linuxbrew/.linuxbrew/Homebrew$ brew request-bottle hello
==> Dispatching request to Homebrew/linuxbrew-core for hello
Error: Not Found
```

After:

```
issyl0@sky:/home/linuxbrew/.linuxbrew/Homebrew$ brew request-bottle hello
==> Dispatching request to Homebrew/linuxbrew-core for hello
Error: No GitHub credentials found in Keychain or environment.
Create a GitHub personal access token:
    https://github.com/settings/tokens/new?scopes=gist,public_repo&description=Homebrew
  echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.profile
```
2021-02-05 12:44:46 +00:00
nandahkrishna
f15681ccd9
utils/github: fix false positive API credential error 2021-02-03 01:37:57 +05:30
Seeker
cded62333e bump-formula-pr: improvements 2021-01-24 11:23:43 -08:00
Rylan Polster
be02591cb6
Add brew release command 2021-01-21 18:29:43 -05:00
Seeker
f113f78ae2
Merge pull request #10283 from SeekingMeaning/github-util-cleanup
utils/github: cleanup
2021-01-11 16:21:19 -08:00
Seeker
b29c27b9a8
Merge pull request #10251 from SeekingMeaning/bump-pr-match
bump-*-pr: check existing PRs for exact file match
2021-01-11 08:40:47 -08:00
Seeker
86a7895115 utils/github: cleanup 2021-01-10 10:42:17 -08:00
Seeker
2901d2058a bump-*-pr: check for valid tap 2021-01-08 11:42:37 -08:00
Seeker
4886b3b138 github: check token scopes even if authorized 2021-01-07 17:47:08 -08:00
Seeker
1395259ad6 bump-*-pr: check existing PRs for exact file match 2021-01-07 09:15:42 -08:00
hyuraku
0b574eff90 search: add two options 2020-12-23 23:06:02 +09:00
Mike McQuaid
74fb058c7e
More deprecations
More deprecations, disabling and removal for Homebrew 2.7.0.
2020-12-18 14:17:37 +00:00
Mike McQuaid
3f2afc0eb2
utils/github: tweak search_code style.
As suggested by reitermarkus in
https://github.com/Homebrew/brew/pull/10055#discussion_r545829663
2020-12-18 13:47:57 +00:00
Mike McQuaid
48c0c673f8
Fix GitHub search behaviour change
Handle the case where paths are now returned with preceding `/`.
2020-12-18 13:21:06 +00:00
Jonathan Chang
09c3058618 Remove basic authentication support for GitHub.
Since we (and GitHub) no longer support password authentication
using non-token passwords, always set the Authorization header,
rather than needlessly checking for a (possibly incorrect) username.
2020-12-17 23:09:22 +11:00
Markus Reiter
b57a448f2a Add bump-unversioned-casks command. 2020-12-07 23:03:47 +01:00
Jonathan Chang
92d3eda914 git_extensions: move origin_branch from utils/git 2020-12-06 14:33:23 +11:00
Mike McQuaid
9216d8abe6
rubocop-rails: make fixes. 2020-12-02 10:43:04 +00:00
Mike McQuaid
db33c9a2a0
Merge pull request #9209 from MikeMcQuaid/deprecations
Deprecations for Homebrew 2.6.0
2020-11-25 08:49:52 +00:00
Mike McQuaid
d496f5c121
Deprecations for Homebrew 2.6.0
Do the usual deprecate/disable dance for the Homebrew 2.6.0 release.

Not to be merged until the next release will definitely be 2.6.0.
2020-11-24 16:44:02 +00:00
Michka Popoff
1fc3d22ab4 pr-pull: allow to pull from multiple workflows
and allow to skip missing workflows

Can be used like this:
brew pr-pull --workflows=tests.yml,wheezy_tests.yml --ignore-missing-artifacts=wheezy_tests.yml PRNUMBER
2020-11-24 15:46:44 +01:00
Rylan Polster
e14ce96f22 pr-pull: skip bottles for CI-syntax-only PRs 2020-11-14 02:52:43 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Jonathan Chang
500908ee6f rubocop: fix Lint/NoReturnInBeginEndBlocks 2020-11-10 23:28:31 +11:00
Jonathan Chang
4a5f1a8477 utils/github: paginate pull request commits API 2020-10-21 00:17:02 +11:00
William Ma
e9e63db825 search: Raise exception when no formulae/casks are found; Add --pull-request switch 2020-10-14 14:40:24 -04:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Jonathan Chang
6fb72f4d71 Deprecate GitHub basic authentication.
This API authentication path will be disabled on Nov 13 2020.
2020-10-01 17:18:11 +10:00
Jonathan Chang
415c36041a dev-cmd/pr-pull: use GitHub API to get PR commits 2020-09-20 13:21:27 +10:00
Dawid Dziurla
14741e3681
Merge pull request #8410 from dawidd6/github-releases
Support bottle uploads to GitHub Releases
2020-09-15 11:59:35 +02:00
Dawid Dziurla
f6601cee10
Support bottle uploads to GitHub Releases
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-09-12 13:03:39 +02:00
Mike McQuaid
fb4d08a49a Fix brew style 2020-09-11 10:29:22 +01:00
Seeker
51d167c122 utils/github: add create_bump_pr 2020-09-04 13:39:15 -07:00
Issy Long
c92ba20be3
utils/github: Fix 'uninitialized constant Utils::Shell'
- I tried `brew pr-publish` on Linux (as we don't have an auto-merge
  Action over there) and it failed with the following error:

```
Error: uninitialized constant Utils::Shell
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:69:in `initialize'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:278:in `exception'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:278:in `raise'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:278:in `raise_api_error'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:228:in `open_api'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/github.rb:464:in `workflow_dispatch_event'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-publish.rb:43:in `block in pr_publish'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-publish.rb:33:in `each'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/pr-publish.rb:33:in `pr_publish'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:119:in `<main>'
```
2020-09-03 10:24:09 +01:00
Markus Reiter
ebd4ce467c Output GitHub Actions annotations for brew style. 2020-09-02 16:44:16 +02:00
Markus Reiter
6e6e01a71f Document GitHub. 2020-08-26 03:13:59 +02:00
Seeker
ffcf06867a Use rescue instead of yield 2020-08-18 23:06:42 -07:00