Mount host repositories for Docker execution with host user ownership
This commit is contained in:
@@ -63,11 +63,11 @@ func (r *runner) start(request protocol.Message, retryOf ...int64) (*protocol.Ru
|
||||
}
|
||||
selected, err := filepath.EvalSymlinks(request.Workspace)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("run workspace is unavailable")
|
||||
return nil, fmt.Errorf("run workspace is unavailable on the execution server: %q: %w; for Docker, mount this host directory at the same absolute path and use its owner's UID/GID", request.Workspace, err)
|
||||
}
|
||||
info, err := os.Stat(selected)
|
||||
if err != nil || !info.IsDir() {
|
||||
return nil, fmt.Errorf("run workspace must be a directory")
|
||||
return nil, fmt.Errorf("run workspace %q must be an accessible directory on the execution server", request.Workspace)
|
||||
}
|
||||
workspace = selected
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"git.a-wan.net/alan/pipelines/internal/stage"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -60,4 +61,8 @@ func TestClientSelectedRepositoryWorkspaceAndAudit(t *testing.T) {
|
||||
t.Fatal("invalid run directory accepted", path)
|
||||
}
|
||||
}
|
||||
missing := filepath.Join(root, "missing")
|
||||
if _, err := r.start(protocol.Message{PipelineID: items[0].ID, Version: 1, RequestKey: "missing-diagnostic", Input: map[string]any{"prompt": "task"}, Workspace: missing}); err == nil || !strings.Contains(err.Error(), missing) || !strings.Contains(err.Error(), "mount this host directory") {
|
||||
t.Fatal("missing workspace error hid requested path or Docker remedy", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,7 +545,7 @@ func (m Model) runsDetailsView(height int) string {
|
||||
}
|
||||
}
|
||||
if m.runError != "" {
|
||||
rows = append(rows, m.runError)
|
||||
rows = append(rows, strings.Split(ansi.Wrap(lipgloss.NewStyle().Foreground(themeError).Render(m.runError), max(1, m.width-4), ""), "\n")...)
|
||||
}
|
||||
footer := "/ fuzzy search · j/k select · Enter inspect · " + m.runActions()
|
||||
if m.runSearchOpen {
|
||||
|
||||
Reference in New Issue
Block a user