45 Commits

Author SHA1 Message Date
Mike McQuaid
2131d70265
workflows/pkg-installer: fix release upload.
- Get the release tag from the installer path.
- Remove unnecessary `gh` installation.
- Remove failing test that I can't fix.
2025-05-27 11:47:00 +01:00
Ruoyu Zhong
5a6203a285
test/utils/github_spec: fix artifact URL test
This does the same as dcba7f356d (#15619) and unblocks CI.
2024-10-15 03:01:45 +08:00
Issy Long
808cfda92d
dev-cmd/contributions: Fix the date range behaviour
- This was broken (I did have a commit SHA for the breakage but I can't find it now) since `from` and `args.from` are different variables (one can be nil, the other has a default value).
- So it was reporting very high counts because, despite the message, the `from` restriction was not being passed to `count_repo_commits`.
2024-05-28 13:58:41 +01:00
Ruoyu Zhong
0df71ea6a3
utils/github: support globbing artifacts 2024-04-17 03:34:42 +08:00
Michael Cho
d04c5ad4f8
test/utils/github_spec: filter further to fix test failure
Signed-off-by: Michael Cho <michael@michaelcho.dev>
2024-03-19 17:01:04 -04:00
Douglas Eichelberger
26eda5a303
git grep -l '^describe' | xargs gsed -i 's|^describe|RSpec.describe|g' 2024-02-19 13:57:27 +00:00
Mike McQuaid
d357607b2c
dev-cmd/contributions: usability/performance improvements.
- more sensible/performant defaults: default to primary repositories
  only for the last year rather than all repositories forever
- allow specifying more than one user at a time
- output the breakdown of contributions without needing `--csv`
- add a space before the `--csv` output
- consolidate some code
- avoid counting authored commits twice, to improve performance
- retry failed GitHub API calls (this happens often when querying all
  maintainers)
- stop counting after we find 1000 commits for a given user to avoid
  excessive API queries/pagination
2023-08-30 15:08:50 +01:00
Bo Anderson
dcba7f356d
test/utils/github_spec: fix artifact URL test 2023-07-03 03:31:01 +01:00
Douglas Eichelberger
9075cbae62 brew style --fix 2023-04-21 09:58:50 -07:00
Douglas Eichelberger
ac1e6ded9a git grep -l '# typed: false' | xargs gsed -i 's|# typed: false||g' 2023-04-21 09:57:47 -07:00
Bo Anderson
3697825784
search: remove remote searching 2023-04-12 13:16:19 +01:00
Issy Long
3a83b5492c
rubocop: Clean up Style/BlockDelimiters excludes and autofix offenses
- The defaults of using "do ... end" for multi-line blocks everywhere is
  good, better than switching everything to braces everywhere.
2023-03-08 23:54:22 +00:00
Issy Long
edeefebf61
utils/github: Fix double counting of author/committer numbers
- The usage of this in `brew contributions` wasn't correct for a user
  with 5 authored commits to homebrew/cask that had been committed by
  other people, the numbers would turn out as 5 authored, 5 committed.
- I decided to do this properly by getting the SHAs for author and
  committer and determine the differences between the two arrays.
  This also accounts for when authored commits are 0, or committed
  commits, or both.
- Add tests, because I don't want to fix this a third time!
2023-03-05 14:41:04 +00:00
Mike McQuaid
bc295f7947
update-sponsors: don't require admin token.
Instead, use a different API to query these with a lower scope.

This should be usable by GitHub Actions.
2022-09-07 16:49:41 +01:00
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