diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:50:40 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 17:50:40 +0900 |
commit | fea7da1b00cc97d742faede2df96c7d327950f49 (patch) | |
tree | 4de1d6b4ddc69f4f32daabb11ad5c71ab0cf895e /.github/workflows/commit-access-review.py | |
parent | 9b99dde0d47102625d93c5d1cbbc04951025a6c9 (diff) | |
parent | 0aa930a41f2d1ebf1fa90ec42da8f96d15a4dcbb (diff) | |
download | llvm-users/chapuni/cov/single/nextcount.zip llvm-users/chapuni/cov/single/nextcount.tar.gz llvm-users/chapuni/cov/single/nextcount.tar.bz2 |
Merge branch 'users/chapuni/cov/single/nextcount-base' into users/chapuni/cov/single/nextcountusers/chapuni/cov/single/nextcount
Diffstat (limited to '.github/workflows/commit-access-review.py')
-rw-r--r-- | .github/workflows/commit-access-review.py | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/.github/workflows/commit-access-review.py b/.github/workflows/commit-access-review.py index 91d3a61..4f539fe 100644 --- a/.github/workflows/commit-access-review.py +++ b/.github/workflows/commit-access-review.py @@ -67,39 +67,47 @@ def check_manual_requests( ) -> list[str]: """ Return a list of users who have been asked since ``start_date`` if they - want to keep their commit access. + want to keep their commit access or if they have applied for commit + access since ``start_date`` """ + query = """ - query ($query: String!) { - search(query: $query, type: ISSUE, first: 100) { + query ($query: String!, $after: String) { + search(query: $query, type: ISSUE, first: 100, after: $after) { nodes { ... on Issue { - body - comments (first: 100) { - nodes { - author { - login - } - } + author { + login } + body } } + pageInfo { + hasNextPage + endCursor + } } } """ formatted_start_date = start_date.strftime("%Y-%m-%dT%H:%M:%S") variables = { - "query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access" + "query": f"type:issue created:>{formatted_start_date} org:llvm repo:llvm-project label:infra:commit-access,infra:commit-access-request" } - res_header, res_data = gh._Github__requester.graphql_query( - query=query, variables=variables - ) - data = res_data["data"] + has_next_page = True users = [] - for issue in data["search"]["nodes"]: - users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])]) - + while has_next_page: + res_header, res_data = gh._Github__requester.graphql_query( + query=query, variables=variables + ) + data = res_data["data"] + for issue in data["search"]["nodes"]: + users.extend([user[1:] for user in re.findall("@[^ ,\n]+", issue["body"])]) + if issue["author"]: + users.append(issue["author"]["login"]) + has_next_page = data["search"]["pageInfo"]["hasNextPage"] + if has_next_page: + variables["after"] = data["search"]["pageInfo"]["endCursor"] return users |