(ctx context.Context, rawWorkspace string)
| 2147 | } |
| 2148 | |
| 2149 | func (h *HostAPIHandler) resolveAutomationWorkspaceID(ctx context.Context, rawWorkspace string) (string, error) { |
| 2150 | trimmed := strings.TrimSpace(rawWorkspace) |
| 2151 | if trimmed == "" { |
| 2152 | return "", nil |
| 2153 | } |
| 2154 | if h.workspaces == nil { |
| 2155 | return trimmed, nil |
| 2156 | } |
| 2157 | resolved, err := h.workspaces.Resolve(ctx, trimmed) |
| 2158 | if err != nil { |
| 2159 | return "", err |
| 2160 | } |
| 2161 | return hostAPIResolvedWorkspaceID(&resolved) |
| 2162 | } |
| 2163 | |
| 2164 | func hostAPIResolvedWorkspaceID(resolved *workspacepkg.ResolvedWorkspace) (string, error) { |
| 2165 | if resolved == nil { |
no test coverage detected