@@ -67,39 +67,47 @@ def check_manual_requests(
67
67
) -> list [str ]:
68
68
"""
69
69
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``
71
72
"""
73
+
72
74
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 ) {
75
77
nodes {
76
78
... on Issue {
77
- body
78
- comments (first: 100) {
79
- nodes {
80
- author {
81
- login
82
- }
83
- }
79
+ author {
80
+ login
84
81
}
82
+ body
85
83
}
86
84
}
85
+ pageInfo {
86
+ hasNextPage
87
+ endCursor
88
+ }
87
89
}
88
90
}
89
91
"""
90
92
formatted_start_date = start_date .strftime ("%Y-%m-%dT%H:%M:%S" )
91
93
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 "
93
95
}
94
96
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
99
98
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" ]
103
111
return users
104
112
105
113
0 commit comments