@@ -303,39 +303,39 @@ class PipelineResult:
303303 tasks : list = field (default_factory = list )
304304 benchmark_metrics : object = None
305305
306- gh_client = GitHubClient (token = token )
307- gh_archive_client = GhArchiveClient (token = token ) if not repo_filter else None
308-
309- tasks : list [SweTask ] = []
310- metrics = None
311-
312- with Progress (
313- SpinnerColumn (),
314- TextColumn ("[progress.description]{task.description}" ),
315- BarColumn (),
316- TaskProgressColumn (),
317- TimeElapsedColumn (),
318- console = console ,
319- ) as progress :
320- task_id = progress .add_task ("Mining tasks..." , total = config .max_tasks )
321-
322- async with SwePipeline (
323- gh_client , gh_archive_client = gh_archive_client , config = config
324- ) as pipeline :
325- async for event in pipeline .run_with_progress ():
326- if event .event_type == SwePipelineEventType .TASK_EXTRACTED :
327- task = event .data .get ("task" )
328- if task and isinstance (task , SweTask ):
329- tasks .append (task )
330- progress .update (
331- task_id , advance = 1 , description = f"Mined { len (tasks )} tasks"
332- )
333-
334- elif event .event_type == SwePipelineEventType .PIPELINE_COMPLETED :
335- metrics = event .data .get ("metrics" )
336- progress .update (task_id , completed = len (tasks ))
337-
338- return PipelineResult (tasks = tasks , benchmark_metrics = metrics )
306+ async with GitHubClient (token = token ) as gh_client :
307+ gh_archive_client = GhArchiveClient (token = token ) if not repo_filter else None
308+
309+ tasks : list [SweTask ] = []
310+ metrics = None
311+
312+ with Progress (
313+ SpinnerColumn (),
314+ TextColumn ("[progress.description]{task.description}" ),
315+ BarColumn (),
316+ TaskProgressColumn (),
317+ TimeElapsedColumn (),
318+ console = console ,
319+ ) as progress :
320+ task_id = progress .add_task ("Mining tasks..." , total = config .max_tasks )
321+
322+ async with SwePipeline (
323+ gh_client , gh_archive_client = gh_archive_client , config = config
324+ ) as pipeline :
325+ async for event in pipeline .run_with_progress ():
326+ if event .event_type == SwePipelineEventType .TASK_EXTRACTED :
327+ task = event .data .get ("task" )
328+ if task and isinstance (task , SweTask ):
329+ tasks .append (task )
330+ progress .update (
331+ task_id , advance = 1 , description = f"Mined { len (tasks )} tasks"
332+ )
333+
334+ elif event .event_type == SwePipelineEventType .PIPELINE_COMPLETED :
335+ metrics = event .data .get ("metrics" )
336+ progress .update (task_id , completed = len (tasks ))
337+
338+ return PipelineResult (tasks = tasks , benchmark_metrics = metrics )
339339
340340
341341@app .command ("complete" )
0 commit comments