From 9e153c2177607399bde61da94130212b1edf1402 Mon Sep 17 00:00:00 2001 From: Molecule AI Core-BE Date: Wed, 13 May 2026 09:09:01 +0000 Subject: [PATCH 1/2] fix(staging): resolve 3 go vet failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three pre-existing go vet errors introduced by staging-branch divergence from main: 1. internal/bundle/importer_test.go:80 — undefined 'files' variable. TestBuildBundleConfigFiles_Skills creates b := &Bundle{...} but never calls buildBundleConfigFiles(b), leaving 'files' undefined. Added files := buildBundleConfigFiles(b). 2. internal/provisioner/localbuild_test.go — unknown field preflightLocalBuild. Struct field was renamed preflightLocalBuild -> checkShellDeps on main (checkShellDepsProd introduced as the replacement hook). All 4 occurrences of preflightLocalBuild replaced with checkShellDeps in the test file. 3. internal/handlers/org_external.go:349 — append with no values. cloneAndConfig := append(gitArgs(...)) is a pointless wrapper; main has cloneAndConfig := gitArgs(...) directly. Removed the append(). Fixes issue #820. Co-Authored-By: Claude Opus 4.7 --- workspace-server/internal/bundle/importer_test.go | 1 + workspace-server/internal/handlers/org_external.go | 2 +- workspace-server/internal/provisioner/localbuild_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/workspace-server/internal/bundle/importer_test.go b/workspace-server/internal/bundle/importer_test.go index 51c1c8f4e..a999aa380 100644 --- a/workspace-server/internal/bundle/importer_test.go +++ b/workspace-server/internal/bundle/importer_test.go @@ -76,6 +76,7 @@ func TestBuildBundleConfigFiles_Skills(t *testing.T) { }, }, } + files := buildBundleConfigFiles(b) // 2 skills × 1 file each = 2 files if n := len(files); n != 2 { t.Fatalf("skills: want 2 files, got %d", n) diff --git a/workspace-server/internal/handlers/org_external.go b/workspace-server/internal/handlers/org_external.go index c964782df..0bebe73c4 100644 --- a/workspace-server/internal/handlers/org_external.go +++ b/workspace-server/internal/handlers/org_external.go @@ -346,7 +346,7 @@ func (g *gitFetcher) Fetch(ctx context.Context, rootDir, host, repoPath, ref str // MkdirTemp creates the dir; git clone refuses to clone into a // non-empty dir. Remove + recreate empty. os.RemoveAll(tmpDir) - cloneAndConfig := append(gitArgs("clone", "--quiet", "--depth=1", "-b", ref, cloneURL, tmpDir)) + cloneAndConfig := gitArgs("clone", "--quiet", "--depth=1", "-b", ref, cloneURL, tmpDir) cmd := exec.CommandContext(ctx, "git", cloneAndConfig...) cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0") if out, err := cmd.CombinedOutput(); err != nil { diff --git a/workspace-server/internal/provisioner/localbuild_test.go b/workspace-server/internal/provisioner/localbuild_test.go index 6bb717b1a..d654d5f35 100644 --- a/workspace-server/internal/provisioner/localbuild_test.go +++ b/workspace-server/internal/provisioner/localbuild_test.go @@ -24,7 +24,7 @@ func makeTestOpts(t *testing.T) *LocalBuildOptions { RepoPrefix: "https://git.test/molecule-ai/molecule-ai-workspace-template-", Platform: "linux/amd64", HTTPClient: &http.Client{}, - preflightLocalBuild: func() error { + checkShellDeps: func() error { return nil // tests bypass the real PATH check }, remoteHeadSha: func(ctx context.Context, opts *LocalBuildOptions, runtime string) (string, error) { @@ -677,10 +677,10 @@ func TestProvisionerStartUsesLocalBuild_LocalMode(t *testing.T) { // caught by this test. } -// TestEnsureLocalImage_Hooks preflightLocalBuild — when preflight fails, +// TestEnsureLocalImage_Hooks checkShellDeps — when preflight fails, func TestEnsureLocalImage_PreflightFailsIfDockerMissing(t *testing.T) { opts := makeTestOpts(t) - opts.preflightLocalBuild = func() error { + opts.checkShellDeps = func() error { return fmt.Errorf( "local-build mode requires `docker` and `git` on PATH in the platform container; " + "found: docker=, git=. " + @@ -702,7 +702,7 @@ func TestEnsureLocalImage_PreflightFailsIfDockerMissing(t *testing.T) { // nil, execution proceeds normally. func TestEnsureLocalImage_PreflightOKPassesThrough(t *testing.T) { opts := makeTestOpts(t) - opts.preflightLocalBuild = func() error { return nil } + opts.checkShellDeps = func() error { return nil } tag, err := ensureLocalImageWithOpts(context.Background(), "claude-code", opts) if err != nil { t.Fatalf("unexpected error: %v", err) -- 2.52.0 From bf1b4eb1f2ea5dee5f405e87cf3c9619500c9c3c Mon Sep 17 00:00:00 2001 From: core-be Date: Wed, 13 May 2026 09:44:39 +0000 Subject: [PATCH 2/2] fix(provisioner test): remove duplicate checkShellDeps field in struct literal (vet) --- workspace-server/internal/provisioner/localbuild_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/workspace-server/internal/provisioner/localbuild_test.go b/workspace-server/internal/provisioner/localbuild_test.go index d654d5f35..7882cfc13 100644 --- a/workspace-server/internal/provisioner/localbuild_test.go +++ b/workspace-server/internal/provisioner/localbuild_test.go @@ -46,10 +46,7 @@ func makeTestOpts(t *testing.T) *LocalBuildOptions { dockerTag: func(ctx context.Context, src, dst string) error { return nil }, - // Stub the shell-dep pre-flight so tests run without docker/git on PATH. - checkShellDeps: func() error { - return nil - }, + } } -- 2.52.0