@@ -202,6 +202,7 @@ def stop_extension_runner_sync(runner: runner_info.ExtensionRunnerInfo) -> None:
202202async def start_runners_with_presets (
203203 projects : list [domain .Project ], ws_context : context .WorkspaceContext
204204) -> None :
205+ # start runners with presets in projects, resolve presets and read project actions
205206 new_runners_tasks : list [asyncio .Task ] = []
206207 try :
207208 # first start runner in 'dev_workspace' env to be able to resolve presets for
@@ -236,6 +237,35 @@ async def start_runners_with_presets(
236237 raise RunnerFailedToStart (
237238 "Failed to initialize runner(s). See previous logs for more details"
238239 )
240+
241+ for project in projects :
242+ try :
243+ await read_configs .read_project_config (
244+ project = project , ws_context = ws_context
245+ )
246+ collect_actions .collect_actions (
247+ project_path = project .dir_path , ws_context = ws_context
248+ )
249+ except config_models .ConfigurationError as exception :
250+ raise RunnerFailedToStart (
251+ f"Reading project config with presets and collecting actions in { project .dir_path } failed: { exception .message } "
252+ )
253+
254+
255+ async def get_or_start_runners_with_presets (project_dir_path : Path , ws_context : context .WorkspaceContext ) -> runner_info .ExtensionRunnerInfo :
256+ # project is expected to have status `ProjectStatus.CONFIG_VALID`
257+ has_dev_workspace_runner = 'dev_workspace' in ws_context .ws_projects_extension_runners [project_dir_path ]
258+ if not has_dev_workspace_runner :
259+ project = ws_context .ws_projects [project_dir_path ]
260+ await start_runners_with_presets ([project ], ws_context )
261+ dev_workspace_runner = ws_context .ws_projects_extension_runners [project_dir_path ]['dev_workspace' ]
262+ if dev_workspace_runner .status == runner_info .RunnerStatus .RUNNING :
263+ return dev_workspace_runner
264+ elif dev_workspace_runner .status == runner_info .RunnerStatus .INITIALIZING :
265+ await dev_workspace_runner .initialized_event .wait ()
266+ return dev_workspace_runner
267+ else :
268+ raise RunnerFailedToStart (f'Status of dev_workspace runner: { dev_workspace_runner .status } , logs: { dev_workspace_runner .logs_path } ' )
239269
240270
241271async def start_runner (
0 commit comments