@@ -198,18 +198,30 @@ def create_issue(self, title_date: date) -> None:
198198 # therefore need to verify those.
199199 issue = json .loads (process .stdout )
200200 url = issue ['html_url' ]
201- log .info ('… created %r, verifying labels and assignees …' , url )
202- path = urllib .parse .urlparse (url ).path .removeprefix ('/' )
203- actual_repository , dir , issue_number = path .rsplit ('/' , maxsplit = 2 )
204- assert dir == 'issues' , dir
205- assert repository == actual_repository , (repository , actual_repository )
206- actual_assignees = set (map (itemgetter ('login' ), issue ['assignees' ]))
207- assert set (assignees ) == actual_assignees , (assignees , actual_assignees )
208- actual_labels = set (map (itemgetter ('name' ), issue ['labels' ]))
209- assert set (labels ) <= actual_labels , (labels , actual_labels )
210- actual_type = issue ['type' ]['name' ]
211- assert type == actual_type , (type , actual_type )
212- log .info ('Successfully created and verfied issue #%s' , issue_number )
201+ self .verify_issue (assignees , issue , labels , repository , type , url )
202+ project_number = '3' # Azul is project 3 in the DataBiosphere organization
203+ command = [
204+ 'gh' , 'project' ,
205+ 'item-add' , project_number ,
206+ '--owner' , 'DataBiosphere' ,
207+ url
208+ ]
209+ log .info ('Running %r …' , command )
210+ process = subprocess .run (command , check = True , stdout = subprocess .PIPE )
211+
212+ def verify_issue (self , assignees , issue , labels , repository , type , url ):
213+ log .info ('… created %r, verifying labels and assignees …' , url )
214+ path = urllib .parse .urlparse (url ).path .removeprefix ('/' )
215+ actual_repository , dir , issue_number = path .rsplit ('/' , maxsplit = 2 )
216+ assert dir == 'issues' , dir
217+ assert repository == actual_repository , (repository , actual_repository )
218+ actual_assignees = set (map (itemgetter ('login' ), issue ['assignees' ]))
219+ assert set (assignees ) == actual_assignees , (assignees , actual_assignees )
220+ actual_labels = set (map (itemgetter ('name' ), issue ['labels' ]))
221+ assert set (labels ) <= actual_labels , (labels , actual_labels )
222+ actual_type = issue ['type' ]['name' ]
223+ assert type == actual_type , (type , actual_type )
224+ log .info ('Successfully created and verfied issue #%s' , issue_number )
213225
214226
215227def main (args ):
0 commit comments