(ctx context.Context, workspaceRef string)
| 823 | } |
| 824 | |
| 825 | func (h *HostAPIHandler) resolveTaskWorkspaceID(ctx context.Context, workspaceRef string) (string, error) { |
| 826 | trimmed := strings.TrimSpace(workspaceRef) |
| 827 | if trimmed == "" { |
| 828 | return "", nil |
| 829 | } |
| 830 | if h.workspaces == nil { |
| 831 | return trimmed, nil |
| 832 | } |
| 833 | |
| 834 | resolved, err := h.workspaces.Resolve(ctx, trimmed) |
| 835 | if err != nil { |
| 836 | if errors.Is(err, workspacepkg.ErrWorkspaceNotFound) { |
| 837 | return "", notFoundRPCError("workspace", trimmed, err) |
| 838 | } |
| 839 | return "", err |
| 840 | } |
| 841 | return hostAPIResolvedWorkspaceID(&resolved) |
| 842 | } |
| 843 | |
| 844 | func validateTaskChannel(path string, channel string) error { |
| 845 | trimmed := strings.TrimSpace(channel) |
no test coverage detected