2804 Commits

Author SHA1 Message Date
Bo Anderson
f4067ac5fe
dev-cmd/tests: better output for BuildPulse failures 2023-03-01 20:42:50 +00:00
Mike McQuaid
7c15dce285
Merge pull request #14798 from MikeMcQuaid/deprecate_shell
Deprecate `preferred_shell` and `shell_profile`.
2023-02-28 15:18:00 +00:00
Mike McQuaid
32463227ac
Deprecate preferred_shell and shell_profile.
I know that we're outside our normal deprecation cycle but: these are
totally broken with the API and it doesn't make sense to support them
only for non-core formulae.
2023-02-28 15:02:06 +00:00
Issy Long
b8b7e6350d
dev-cmd/contributions: Only count approving reviews
- The `reviewed-by` filter retrieved all reviews for a user, including
  those they'd added to their own PRs. Since it's impossible to click
  the "approve" button on one's own PR, filter this to `review:approved`
  to get "further project goals" kinds of reviews.
- Suggested in https://github.com/Homebrew/brew/pull/14813#discussion_r1118696385.
2023-02-28 12:58:21 +00:00
Rylan Polster
f6af334397
Merge pull request #14825 from MikeMcQuaid/more_sharding_fixes
More Formula/Casks sharding fixes
2023-02-28 07:08:29 -05:00
Mike McQuaid
0406279ad3
More Formula/Casks sharding fixes
- Stop `brew style` from complaining
- Fix message reference in `brew edit`
2023-02-28 11:52:38 +00:00
Issy Long
0f2270e9ef
Merge pull request #14819 from issyl0/signoffs-were-just-a-stepping-stone-to-reviews
dev-cmd/contributions: Stop counting signoffs now we have "real" reviews
2023-02-28 11:37:14 +00:00
Issy Long
6b76e5e66f
dev-cmd/contributions: Stop counting signoffs now we have "real" reviews
- Signoffs were just a stopgap until we implemented getting "real"
  reviews for a user via the GitHub API. They were a suboptimal way of getting
  reviews because they only really exist in Homebrew/homebrew-core where
  BrewTestBot adds signoffs for each maintainer who reviewed the PR.
2023-02-28 11:12:51 +00:00
Douglas Eichelberger
f9f73f3ef6 Tidy up 2023-02-27 21:42:47 -08:00
Douglas Eichelberger
1ab278f74c Fix style/type violations 2023-02-27 20:34:07 -08:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
3da68651e5 Port more call sites 2023-02-27 20:18:08 -08:00
Mike McQuaid
6db7732fa3
Merge pull request #14821 from issyl0/support-date-ranges-in-pr-reviews-query
dev-cmd/contributions: Support date ranges in PR reviews query
2023-02-28 00:06:41 +00:00
Mike McQuaid
d6ba3878ab
dev-cmd/cat: improve error message.
Fixes #14815.

Co-authored-by: Adrian Ho <the.gromgit@gmail.com>
2023-02-27 17:34:29 +00:00
Issy Long
a2d31faa72
dev-cmd/contributions: Support date ranges in PR reviews query
- Now `brew contributions --from=2023-02-23 --to=2023-02-26` works to limit the
  results for reviews. I forgot this in the original implementation, again,
  ugh.
2023-02-26 23:34:53 +00:00
Issy Long
a13556a1a6
Merge pull request #14813 from issyl0/contributions-approvals 2023-02-26 15:23:11 +00:00
Issy Long
8c75eab88a
dev-cmd/contributions: Count PR reviews since they're super important
- The search APIs don't have that high a rate limit but we shouldn't need to
  worry about that too much because, to get counts, the JSON response comes
  with a `total_count` number.
2023-02-25 19:10:17 +00:00
Issy Long
7b8f1c8714
dev-cmd/contributions: Order the CSV by highest contributions total 2023-02-25 18:04:01 +00:00
Issy Long
428193aa29
Merge pull request #14789 from issyl0/contributions-maintainers-csv
dev-cmd/contributions: CSV output of totals per maintainer
2023-02-25 17:51:59 +00:00
Issy Long
e68379f5df
dev-cmd/contributions: Fill in the "total" CSV row
- Using the new "total across commits/coauthors/signoffs" data per-user,
  this also generates a more complete maintainers CSV.
2023-02-25 01:05:41 +00:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
51e0c685f8
Merge pull request #14801 from Bo98/generate-errors
generate-*-api: better errors
2023-02-24 17:15:32 +00:00
Bo Anderson
1dd3d5cc03
generate-*-api: better errors 2023-02-24 16:57:20 +00:00
Bo Anderson
559bec95bc
Scope HOMEBREW_NO_INSTALL_FROM_API to core formulae in brew audit 2023-02-24 13:33:46 +00:00
Issy Long
8d4bdbafc4
dev-cmd/contributions: CSV output of totals per maintainer
- Turns out in my head a few days ago I was overcomplicating this. I had a
  brainwave while in the shower.
- Some refactoring so that we call `totals` to sum up the hash of hashes less,
  since the grand total numbers are now used in multiple places.
2023-02-23 23:35:45 +00:00
Mike McQuaid
2f47403f8c
dev-cmd/generate-*-api: don't use same constant name.
Otherwise Ruby warns.
2023-02-23 09:09:54 +00:00
Mike McQuaid
236208ff79
Merge pull request #14756 from apainintheneck/clean-up-extend-os-requires
extend/os: clean up requires
2023-02-23 09:07:59 +00:00
Mike McQuaid
f6d1fa62f1
Merge pull request #14762 from MikeMcQuaid/generate_api
Add generate-{cask,formula}-api commands
2023-02-23 09:02:15 +00:00
Mike McQuaid
9c9213aabd
Apply suggestions from code review
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-02-23 08:45:56 +00:00
apainintheneck
8de625e0e2 extend/os: clean up requires
These need to be after the original module/class definitions
for the monkey-patching to work correctly.
2023-02-22 21:21:24 -08:00
Issy Long
c7b06df72e
dev-cmd/contributions: One --verbose sentence per user is enough 2023-02-22 23:05:02 +00:00
Issy Long
28a2a6ea43
utils/github: Add date filtering to the commit author API query
- I missed this off the original implementation - oops. This gives parity with
  the `git log` implementation.
2023-02-22 23:01:38 +00:00
Issy Long
1b3fa0bef7
Merge pull request #14768 from issyl0/contributions-fix-trailers-args
dev-cmd/contributions: Correctly order the trailers method args
2023-02-22 17:41:23 +00:00
Issy Long
0d345c4257
dev-cmd/contributions: Correctly order the trailers method args
- Was this a bad merge conflict resolution, or me not paying enough
  attention another time?
2023-02-22 17:24:13 +00:00
Issy Long
3d3369c542
dev-cmd/contributions.rb: odie
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-22 17:02:22 +00:00
Issy Long
d40bd0ae3e
dev-cmd/contributions: Fix single-user handling; be more verbose
- `brew contributions --user=issyl0` was taking forever because it went
  through all maintainers first, because the conditionals were in the
  wrong order.
- This was too quiet, far too quiet, for something that takes so long.
- Now verbose mode tells you what repos it's scanning for a user.
2023-02-22 16:48:31 +00:00
Issy Long
214110f665
dev-cmd/contributions: Stats for all maintainers
- With `brew contributions`, this will output a list of stats
  (across the specified time period, or all time) for people in the
  "maintainers" team on GitHub.
- Add a `--user` flag for getting stats for a specific user (either
  username, name or email address).
- This assumes that their Git committer details are the same as their name is
  set to on GitHub.
- Show an error message if trying to generate a CSV for the full maintainer
  list, since I haven't worked out how to best show all of that info yet (or
  even how best to show only the totals across everything for every user) in
  that format.
2023-02-22 16:05:58 +00:00
Mike McQuaid
8d02143c2b
Add generate-{cask,formula}-api commands
These replace the similar scripts in formulae.brew.sh.

Part of #14730.
2023-02-22 15:33:16 +00:00
Issy Long
93ce211ebd
Merge pull request #14737 from issyl0/api-commits-for-person
dev-cmd/contributions: Use GitHub APIs for commit author info
2023-02-22 14:12:16 +00:00
Markus Reiter
fbf85b7530
Ignore discontinued casks in bump-unversioned-casks. 2023-02-21 12:43:09 +01:00
Issy Long
0a6c59c0b3
dev-cmd/contributions: Less disgusting way to determine brew's NWO 2023-02-21 00:51:32 +00:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Issy Long
d3827b12f2
dev-cmd/contributions: Use GitHub APIs for commit author info
- Using `git log` was brittle with name changes and email address changes for
  contributors over the years unless we made a Git `mailmap` file which brings
  with it its own updatedness overhead.
- Let's use the GitHub commits API (importantly _not_ the search API) so that
  we can give it a username and it will return contributions associated with
  every email address on that user's account:
  https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits--parameters.
- This is quite significantly slower, but it's worth it for correctness
  especially when we get to all maintainers' contributions (in a separate PR).
- The commits API does not (yet?) support trailers or commit "committer"s, just
  authors.
2023-02-20 23:24:54 +00:00
Mike McQuaid
37b4780037
dev-cmd/contributions: fix spacing.
Otherwise this fails the documentation lint.
2023-02-20 16:16:08 +00:00
Mike McQuaid
315e10cbc4
Merge pull request #14712 from issyl0/contributions-primary-repos
dev-cmd/contributions: Add `--repositories=primary` to scan only `brew,core,cask`
2023-02-20 09:53:50 +00:00
Issy Long
04e476eb84
dev-cmd/contributions: Add --repositories=brew,core,cask shorthand
- For annual "has this person contributed enough", we focus on the main
  Homebrew repos: brew, core and cask. Let's make that easier than
  `--repositories=brew,core,cask`.
2023-02-19 18:36:13 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
Mike McQuaid
80232af31d
More tweaks to testing output and speed
- Never bother to do `brew cleanup` after `brew install`
- Skip `brew test-bot --only-cleanup-before` in more places it's not
  needed
- Move `brew config`/`brew doctor` into the default formula run
  (through `brew test-bot --only-setup`)
- Install `buildpulse-test-reporter` rather than letting `brew tests`
  do it
- Improve the formatting of the `brew tests` step
- Further shorten the code coverage filenames
- Don't output BuildPulse results upload status unless failed
2023-02-17 16:17:45 +00:00
Mike McQuaid
a743e9277f
workflows/tests: faster, more reliable tests.
- Extract update tests into separate tests.
- Make `brew tests --online` run only once in its own job. This job
  could be made non-required to fight flakiness.
- Split up the various macOS runs into several steps now that we have
  more parallel macOS workers available.
- Cleanup some flaky tests.
2023-02-17 15:26:18 +00:00
Kevin
8ff2e29aad
Merge pull request #14652 from apainintheneck/improve-prof-errors
cmd/prof: improve error messages
2023-02-16 22:39:05 -08:00