6
6
from typing import Dict , Any , List , Set , Tuple , Optional
7
7
import json
8
8
9
- from agithub import Issue , GitHub , Comment , GitHubError , IssueStateReason
9
+ from agithub import (
10
+ Issue , GitHub , Comment , GitHubError , IssueStateReason ,
11
+ GitHubLogin ,
12
+ )
10
13
11
14
from . import config
12
15
from . import lilac
@@ -105,12 +108,12 @@ async def find_affecting_deps(
105
108
106
109
async def process_orphaning (
107
110
author : str , edited : bool ,
108
- packages : Set [str ], assignees : Set [str ],
111
+ packages : Set [str ], assignees : Set [GitHubLogin ],
109
112
maintainers : List [Maintainer ],
110
113
) -> str :
111
114
if author != config .MY_GITHUB :
112
115
try :
113
- assignees .remove (author )
116
+ assignees .remove (GitHubLogin ( author ) )
114
117
except KeyError :
115
118
pass
116
119
@@ -131,7 +134,7 @@ async def process_orphaning(
131
134
comment_parts .append (c )
132
135
comment += '\n ' .join (comment_parts ) + '\n \n '
133
136
assignees .update (
134
- m for x in affected_maints .values () for m in x
137
+ GitHubLogin ( m ) for x in affected_maints .values () for m in x
135
138
)
136
139
137
140
if not edited and author not in maintainers and author != config .ADMIN_GH :
@@ -195,10 +198,10 @@ async def process_issue(gh: GitHub, issue_dict: Dict[str, Any],
195
198
labels = ['out-of-date' ]
196
199
elif issuetype == IssueType .Orphaning :
197
200
labels = ['orphaning' ]
198
- assignees .add (config .MY_GITHUB )
201
+ assignees .add (GitHubLogin ( config .MY_GITHUB ) )
199
202
elif issuetype == IssueType .Official :
200
203
labels = ['in-official-repos' ]
201
- assignees .add (config .MY_GITHUB )
204
+ assignees .add (GitHubLogin ( config .MY_GITHUB ) )
202
205
else :
203
206
labels = []
204
207
@@ -216,7 +219,7 @@ async def process_issue(gh: GitHub, issue_dict: Dict[str, Any],
216
219
if not maintainers :
217
220
unmaintained .append (pkg )
218
221
219
- assignees .update (x for x in maintainers )
222
+ assignees .update (GitHubLogin ( x ) for x in maintainers )
220
223
221
224
if issuetype == IssueType .Orphaning :
222
225
comment = await process_orphaning (
@@ -245,7 +248,7 @@ async def process_issue(gh: GitHub, issue_dict: Dict[str, Any],
245
248
await issue .add_labels (labels )
246
249
if assignees :
247
250
r = await issue .assign (list (assignees ))
248
- assigned = {x ['login' ] for x in r ['assignees' ]}
251
+ assigned = {GitHubLogin ( x ['login' ]) for x in r ['assignees' ]}
249
252
failed = assignees - assigned
250
253
if failed :
251
254
if comment :
0 commit comments