31 Commits

Author SHA1 Message Date
Bo Anderson
04f6f53b58
dev-cmd/pr-pull: avoid expensive search API calls 2022-09-03 21:19:37 +01:00
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
Michael Cho
d304c84f2a
test/utils/github_spec: fix artifact number 2021-06-25 11:36:13 -07:00
Alexander Bayandin
d55cbeac78
github_spec: Update PR number with unexpired artifacts 2021-06-24 13:29:44 +01:00
John Bampton
1691e615fe Fix spelling 2021-05-08 11:20:01 +10:00
hyuraku
178ae750b9 utils/github: set default args to search_code 2021-02-26 21:31:30 +09:00
nandahkrishna
0474fe6093
dev-cmd/update-maintainers: add tests 2021-02-08 23:33:25 +05:30
Seeker
022bcbb269 test/utils/*: use described_class or named subject 2021-01-11 12:31:39 -08: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
Markus Reiter
f87c9c5dc4 Fix tests failing locally. 2020-11-18 05:54:42 +01:00
Jonathan Chang
4a5f1a8477 utils/github: paginate pull request commits API 2020-10-21 00:17:02 +11:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Jonathan Chang
415c36041a dev-cmd/pr-pull: use GitHub API to get PR commits 2020-09-20 13:21:27 +10:00
Jonathan Chang
c6e9cff125 dev-cmd: add brew-sponsors.rb 2020-07-05 15:45:36 +10:00
Jonathan Chang
90309e5f42 github: fetch approved reviews for a pull request 2020-06-29 12:53:03 +10:00
Jonathan Chang
7d63f0b506 github: improve tests 2020-04-14 13:41:35 +10:00
Jonathan Chang
0d3a4d98c0 utils/github: add test for fetch_artifact 2020-03-30 22:41:17 +11:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
737b84b54b
brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Mike McQuaid
4def45f499
utils/github_spec: use author that exists. 2018-10-15 14:15:08 -07:00
Josh Soref
b9a33b03a4 spelling: parameters 2017-09-10 16:39:18 +00:00
Ben Muschol
564a06dfbb Fix typo in spec 2017-08-17 13:44:18 -04:00
Ben Muschol
e096836b7b Improve rspec readability 2017-08-17 11:57:58 -04:00
Ben Muschol
7a93638105 Make test more resilient 2017-08-17 11:40:32 -04:00
Ben Muschol
5f8d212ccc Unify vocabulary in github module, remove unnecessary logic
Fix duplication bug
2017-08-14 14:45:24 -04:00
Ben Muschol
68cdb550f7 Spec for issues search 2017-08-14 12:06:12 -04:00
Ben Muschol
603bdd01a8 Implement PR feedback 2017-08-14 11:08:56 -04:00
Ben Muschol
24da1ecd3d Fix url encoded in expected values 2017-08-13 17:16:45 -04:00
Ben Muschol
e93ec12b32 Remove duplicate url generation logic in Github module 2017-08-13 15:03:44 -04:00
Markus Reiter
4b804389e1 Add test for GitHub::search_code. 2017-04-25 12:29:01 +02:00