(
app_state: &AppState,
raw_path: &str,
)
| 78 | } |
| 79 | |
| 80 | async fn resolve_runtime_artifact_path( |
| 81 | app_state: &AppState, |
| 82 | raw_path: &str, |
| 83 | ) -> Result<Option<PathBuf>, String> { |
| 84 | if !is_bitfun_runtime_uri(raw_path) { |
| 85 | return Ok(None); |
| 86 | } |
| 87 | |
| 88 | let parsed = parse_bitfun_runtime_uri(raw_path).map_err(|e| e.to_string())?; |
| 89 | let workspace = if parsed.workspace_scope == "current" { |
| 90 | app_state.workspace_service.get_current_workspace().await |
| 91 | } else { |
| 92 | app_state |
| 93 | .workspace_service |
| 94 | .list_workspace_infos() |
| 95 | .await |
| 96 | .into_iter() |
| 97 | .find(|workspace| workspace.id == parsed.workspace_scope) |
| 98 | } |
| 99 | .ok_or_else(|| { |
| 100 | format!( |
| 101 | "Unable to resolve runtime URI scope '{}'", |
| 102 | parsed.workspace_scope |
| 103 | ) |
| 104 | })?; |
| 105 | |
| 106 | let mut resolved = runtime_root_for_workspace_info(&workspace)?; |
| 107 | for segment in parsed.relative_path.split('/') { |
| 108 | resolved.push(segment); |
| 109 | } |
| 110 | |
| 111 | Ok(Some(resolved)) |
| 112 | } |
| 113 | |
| 114 | async fn lookup_remote_entry_for_path( |
| 115 | app_state: &AppState, |
no test coverage detected