Skip to content

Commit 974e8fe

Browse files
authored
[CI] Stop counting commit authors are reviewers (#545)
When a pull request author comments on their own pull request, it counts as a review and is captured when we query the GraphQL API for reviewers of a pull request. We shouldn't be counting self-reviews when collecting LLVM metrics, so this change removes the author of a commit from the set of reviewers.
1 parent 3af5a7c commit 974e8fe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm-ops-metrics/ops-container/process_llvm_commits.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ def query_for_reviews(
192192
for review in pull_request["reviews"]["nodes"]
193193
])
194194

195+
# There are cases where the commit author is counted as a reviewer. This is
196+
# against what we want to measure, so remove them from the set of reviewers.
197+
commit_info.reviewers.discard(commit_info.commit_author)
198+
195199
return list(new_commits.values())
196200

197201

0 commit comments

Comments
 (0)