diff options
| author | Tom Stellard <tstellar@redhat.com> | 2025-11-19 12:39:14 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-19 12:39:14 -0800 |
| commit | c34927ab5ac9f359616657c3f5e05f868db901f6 (patch) | |
| tree | cfb1add97e30c10df7ee1461592fa081dd87eed5 /.github/workflows/commit-access-review.py | |
| parent | f85942728fe2edfc681831abf8ecd2f245e1aaaa (diff) | |
commit-access-review.py: Remove new contributor check (#168629)
We don't need this anymore since all new contributors in the last year
have applied for commit access using GitHub issues. There is already
code in the script that removes anyone who submitted a request, so we
don't need the old code any more (which was way too conservitave and
very slow).
Diffstat (limited to '.github/workflows/commit-access-review.py')
| -rw-r--r-- | .github/workflows/commit-access-review.py | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/.github/workflows/commit-access-review.py b/.github/workflows/commit-access-review.py index 4f539fe98004..52b9fd35290e 100644 --- a/.github/workflows/commit-access-review.py +++ b/.github/workflows/commit-access-review.py @@ -170,80 +170,6 @@ def get_num_commits(gh: github.Github, user: str, start_date: datetime.datetime) return count -def is_new_committer_query_repo( - gh: github.Github, user: str, start_date: datetime.datetime -) -> bool: - """ - Determine if ``user`` is a new committer. A new committer can keep their - commit access even if they don't meet the criteria. - """ - variables = { - "user": user, - } - - user_query = """ - query ($user: String!) { - user(login: $user) { - id - } - } - """ - - res_header, res_data = gh._Github__requester.graphql_query( - query=user_query, variables=variables - ) - data = res_data["data"] - variables["owner"] = "llvm" - variables["user_id"] = data["user"]["id"] - variables["start_date"] = start_date.strftime("%Y-%m-%dT%H:%M:%S") - - query = """ - query ($owner: String!, $user_id: ID!){ - organization(login: $owner) { - repository(name: "llvm-project") { - ref(qualifiedName: "main") { - target { - ... on Commit { - history(author: {id: $user_id }, first: 5) { - nodes { - committedDate - } - } - } - } - } - } - } - } - """ - - res_header, res_data = gh._Github__requester.graphql_query( - query=query, variables=variables - ) - data = res_data["data"] - repo = data["organization"]["repository"] - commits = repo["ref"]["target"]["history"]["nodes"] - if len(commits) == 0: - return True - committed_date = commits[-1]["committedDate"] - if datetime.datetime.strptime(committed_date, "%Y-%m-%dT%H:%M:%SZ") < start_date: - return False - return True - - -def is_new_committer( - gh: github.Github, user: str, start_date: datetime.datetime -) -> bool: - """ - Wrapper around is_new_commiter_query_repo to handle exceptions. - """ - try: - return is_new_committer_query_repo(gh, user, start_date) - except: - pass - return True - - def get_review_count( gh: github.Github, user: str, start_date: datetime.datetime ) -> int: @@ -383,13 +309,6 @@ def main(): print("After Commits:", len(triage_list), "triagers") - # Step 4 check for new committers - for user in list(triage_list.keys()): - print("Checking", user) - if is_new_committer(gh, user, one_year_ago): - print("Removing new committer: ", user) - del triage_list[user] - print("Complete:", len(triage_list), "triagers") with open("triagers.log", "w") as triagers_log: |
