@@ -198,18 +198,32 @@ 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' , 'item-add' , project_number ,
205+ '--owner' , 'DataBiosphere' ,
206+ '--url' , url ,
207+ '--format' , 'json'
208+ ]
209+ log .info ('Running %r …' , command )
210+ process = subprocess .run (command , check = True , stdout = subprocess .PIPE )
211+ project = json .loads (process .stdout )
212+ assert project ['id' ], project
213+
214+ def verify_issue (self , assignees , issue , labels , repository , type , url ):
215+ log .info ('… created %r, verifying labels and assignees …' , url )
216+ path = urllib .parse .urlparse (url ).path .removeprefix ('/' )
217+ actual_repository , dir , issue_number = path .rsplit ('/' , maxsplit = 2 )
218+ assert dir == 'issues' , dir
219+ assert repository == actual_repository , (repository , actual_repository )
220+ actual_assignees = set (map (itemgetter ('login' ), issue ['assignees' ]))
221+ assert set (assignees ) == actual_assignees , (assignees , actual_assignees )
222+ actual_labels = set (map (itemgetter ('name' ), issue ['labels' ]))
223+ assert set (labels ) <= actual_labels , (labels , actual_labels )
224+ actual_type = issue ['type' ]['name' ]
225+ assert type == actual_type , (type , actual_type )
226+ log .info ('Successfully created and verfied issue #%s' , issue_number )
213227
214228
215229def main (args ):
0 commit comments