[llvm] workflows/commit-access-reivew: Use concurrency to speed up script (PR #181204)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 12 10:54:17 PST 2026
https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/181204
>From eee03cc56735350d265b649c41f103e534b4ce2a Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 12 Feb 2026 10:45:03 -0800
Subject: [PATCH 1/2] workflows/commit-access-reivew: Use concurrency to speed
up script
Making some of the graphql queries in parallel cuts the runtime of the
script from ~60 minutes to ~40 minutes.
---
.github/workflows/commit-access-review.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/.github/workflows/commit-access-review.py b/.github/workflows/commit-access-review.py
index 338bdcbca6607..a644928433096 100644
--- a/.github/workflows/commit-access-review.py
+++ b/.github/workflows/commit-access-review.py
@@ -9,6 +9,7 @@
#
# ===------------------------------------------------------------------------===#
+import concurrent.futures
import datetime
import github
import re
@@ -291,9 +292,10 @@ def main():
sys.exit(0)
# Step 2 check for reviews
- for user in list(triage_list.keys()):
- review_count = get_review_count(gh, user, one_year_ago)
- triage_list[user].add_reviewed(review_count)
+
+ # 4 because that's how many cores the default github runners have.
+ with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
+ executor.map(lambda user:triage_list[user].add_reviewed(get_review_count(gh, user, one_year_ago)), list(triage_list.keys()))
print("After Reviews:", len(triage_list), "triagers")
@@ -301,11 +303,10 @@ def main():
sys.exit(0)
# Step 3 check for number of commits
- for user in list(triage_list.keys()):
- num_commits = get_num_commits(gh, user, one_year_ago)
+ with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
# Override the total number of commits to not double count commits and
# authored PRs.
- triage_list[user].set_authored(num_commits)
+ executor.map(lambda user: triage_list[user].set_authored(get_num_commits(gh, user, one_year_ago)),list(triage_list.keys()))
print("After Commits:", len(triage_list), "triagers")
>From 1bcedb9f169a996d4802fcb5238485b6d813a25a Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Thu, 12 Feb 2026 10:53:51 -0800
Subject: [PATCH 2/2] Fix formatting
---
.github/workflows/commit-access-review.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/commit-access-review.py b/.github/workflows/commit-access-review.py
index a644928433096..22f3cf7869883 100644
--- a/.github/workflows/commit-access-review.py
+++ b/.github/workflows/commit-access-review.py
@@ -295,7 +295,12 @@ def main():
# 4 because that's how many cores the default github runners have.
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
- executor.map(lambda user:triage_list[user].add_reviewed(get_review_count(gh, user, one_year_ago)), list(triage_list.keys()))
+ executor.map(
+ lambda user: triage_list[user].add_reviewed(
+ get_review_count(gh, user, one_year_ago)
+ ),
+ list(triage_list.keys()),
+ )
print("After Reviews:", len(triage_list), "triagers")
@@ -306,7 +311,12 @@ def main():
with concurrent.futures.ThreadPoolExecutor(max_workers=4) as executor:
# Override the total number of commits to not double count commits and
# authored PRs.
- executor.map(lambda user: triage_list[user].set_authored(get_num_commits(gh, user, one_year_ago)),list(triage_list.keys()))
+ executor.map(
+ lambda user: triage_list[user].set_authored(
+ get_num_commits(gh, user, one_year_ago)
+ ),
+ list(triage_list.keys()),
+ )
print("After Commits:", len(triage_list), "triagers")
More information about the llvm-commits
mailing list