@@ -67,39 +67,47 @@ def check_manual_requests(
6767) -> list [str ]:
6868 """
6969 Return a list of users who have been asked since ``start_date`` if they
70- want to keep their commit access.
70+ want to keep their commit access or if they have applied for commit
71+ access since ``start_date``
7172 """
73+
7274 query = """
73- query ($query: String!) {
74- search(query: $query, type: ISSUE, first: 100) {
75+ query ($query: String!, $after: String ) {
76+ search(query: $query, type: ISSUE, first: 100, after: $after ) {
7577 nodes {
7678 ... on Issue {
77- body
78- comments (first: 100) {
79- nodes {
80- author {
81- login
82- }
83- }
79+ author {
80+ login
8481 }
82+ body
8583 }
8684 }
85+ pageInfo {
86+ hasNextPage
87+ endCursor
88+ }
8789 }
8890 }
8991 """
9092 formatted_start_date = start_date .strftime ("%Y-%m-%dT%H:%M:%S" )
9193 variables = {
92- "query" : f"type:issue created:>{ formatted_start_date } org:llvm repo:llvm-project label:infra:commit-access"
94+ "query" : f"type:issue created:>{ formatted_start_date } org:llvm repo:llvm-project label:infra:commit-access,infra:commit-access-request "
9395 }
9496
95- res_header , res_data = gh ._Github__requester .graphql_query (
96- query = query , variables = variables
97- )
98- data = res_data ["data" ]
97+ has_next_page = True
9998 users = []
100- for issue in data ["search" ]["nodes" ]:
101- users .extend ([user [1 :] for user in re .findall ("@[^ ,\n ]+" , issue ["body" ])])
102-
99+ while has_next_page :
100+ res_header , res_data = gh ._Github__requester .graphql_query (
101+ query = query , variables = variables
102+ )
103+ data = res_data ["data" ]
104+ for issue in data ["search" ]["nodes" ]:
105+ users .extend ([user [1 :] for user in re .findall ("@[^ ,\n ]+" , issue ["body" ])])
106+ if issue ["author" ]:
107+ users .append (issue ["author" ]["login" ])
108+ has_next_page = data ["search" ]["pageInfo" ]["hasNextPage" ]
109+ if has_next_page :
110+ variables ["after" ] = data ["search" ]["pageInfo" ]["endCursor" ]
103111 return users
104112
105113
0 commit comments