fix(provisioner): fix type mismatch in checkTool seam
Some checks failed
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been skipped
publish-runtime-autobump / bump-and-tag (pull_request) Has been skipped
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 11s
Harness Replays / detect-changes (pull_request) Successful in 15s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 16s
Harness Replays / Harness Replays (pull_request) Successful in 6s
sop-tier-check / tier-check (pull_request) Successful in 16s
gate-check-v3 / gate-check (pull_request) Failing after 23s
CI / Detect changes (pull_request) Successful in 37s
E2E API Smoke Test / detect-changes (pull_request) Successful in 40s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 44s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 45s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 42s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 7s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 45s
CI / Canvas (Next.js) (pull_request) Successful in 7s
publish-runtime-autobump / pr-validate (pull_request) Successful in 49s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 7s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 7s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Failing after 3m8s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 2m23s
CI / Platform (Go) (pull_request) Failing after 5m38s
CI / Python Lint & Test (pull_request) Successful in 7m14s

checkToolOnPath must match the checkTool func(tool string) error
signature in LocalBuildOptions — Go does not allow assigning a function
with (string, error) returns to a func(string) error variable.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Molecule AI · infra-sre 2026-05-11 18:45:39 +00:00
parent 6f0001d04c
commit b95a20bb9e

View File

@ -185,18 +185,19 @@ func EnsureLocalImage(ctx context.Context, runtime string) (string, error) {
// production code.
var ensureLocalImageHook = EnsureLocalImage
// checkToolOnPath verifies tool is on PATH and returns its absolute path,
// or a descriptive error. Used for pre-flight validation before the
// checkToolOnPath verifies tool is on PATH and returns an error with a
// descriptive message if missing. Used for pre-flight validation before the
// clone/build cold path.
func checkToolOnPath(tool string) (string, error) {
func checkToolOnPath(tool string) error {
path, err := exec.LookPath(tool)
if err != nil {
if errors.Is(err, exec.ErrNotFound) {
return "", fmt.Errorf("local-build: %q not found on PATH — local-build mode requires both docker and git; either install them, or set MOLECULE_IMAGE_REGISTRY so local-build is bypassed", tool)
return fmt.Errorf("%q not found on PATH — local-build mode requires both docker and git; either install them, or set MOLECULE_IMAGE_REGISTRY so local-build is bypassed", tool)
}
return "", fmt.Errorf("local-build: LookPath(%q) failed: %w", tool, err)
return fmt.Errorf("LookPath(%q) failed: %w", tool, err)
}
return path, nil
log.Printf("local-build: pre-flight OK (%s=%s)", tool, path)
return nil
}
func ensureLocalImageWithOpts(ctx context.Context, runtime string, opts *LocalBuildOptions) (string, error) {