From b8b7e6350da41eb88e026af3376f8f07aa560017 Mon Sep 17 00:00:00 2001 From: Issy Long Date: Mon, 27 Feb 2023 13:03:56 +0000 Subject: [PATCH] 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. --- Library/Homebrew/dev-cmd/contributions.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index 43496336b28f6..d7fbf333f00f3 100755 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -172,7 +172,14 @@ def scan_repositories(repos, person, args) data[repo] = { commits: GitHub.repo_commit_count_for_user(repo_full_name, person, args), coauthorships: git_log_trailers_cmd(T.must(repo_path), person, "Co-authored-by", args), - reviews: GitHub.count_issues("", is: "pr", repo: repo_full_name, reviewed_by: person, args: args), + reviews: GitHub.count_issues( + "", + is: "pr", + repo: repo_full_name, + reviewed_by: person, + review: "approved", + args: args, + ), } end