fix(provisioner): fix collectCPConfigFiles return values
Some checks failed
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 7s
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been skipped
CI / Detect changes (pull_request) Successful in 16s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 19s
E2E API Smoke Test / detect-changes (pull_request) Successful in 19s
Harness Replays / detect-changes (pull_request) Successful in 14s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 22s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 27s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 51s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 37s
qa-review / approved (pull_request) Failing after 28s
gate-check-v3 / gate-check (pull_request) Failing after 39s
sop-checklist / na-declarations (pull_request) awaiting /sop-n/a declaration for: qa-review, security-review
security-review / approved (pull_request) Failing after 30s
sop-tier-check / tier-check (pull_request) Successful in 20s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m21s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 18s
CI / Python Lint & Test (pull_request) Successful in 28s
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Successful in 18s
E2E Staging External Runtime / E2E Staging External Runtime (pull_request) Successful in 5m25s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 7m4s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Failing after 11m53s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Failing after 11m41s
Harness Replays / Harness Replays (pull_request) Failing after 11m36s
CI / Canvas (Next.js) (pull_request) Successful in 18m30s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
CI / Platform (Go) (pull_request) Successful in 19m52s
CI / all-required (pull_request) Successful in 6s
sop-checklist / all-items-acked (pull_request) acked: 7/7
audit-force-merge / audit (pull_request) Has been skipped

Lines 273 and 276 inside the `if cfg.TemplatePath != ""` block were
returning a bare `error` instead of `(nil, error)`. The enclosing
`collectCPConfigFiles` function returns `(map[string]string, error)`,
so both error returns were missing the `nil` first value — causing
compile failures:

    cp_provisioner.go:273: not enough return values
    cp_provisioner.go:276: not enough return values

Fix: prefix both with `nil, `.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Molecule AI · core-be 2026-05-14 19:27:40 +00:00
parent d4b4ff03f8
commit ce542cb265

View File

@ -270,10 +270,10 @@ func collectCPConfigFiles(cfg WorkspaceConfig) (map[string]string, error) {
// would bypass the subsequent path-relativization checks below.
rootInfo, err := os.Lstat(cfg.TemplatePath)
if err != nil {
return fmt.Errorf("collectCPConfigFiles: lstat template path: %w", err)
return nil, fmt.Errorf("collectCPConfigFiles: lstat template path: %w", err)
}
if rootInfo.Mode()&os.ModeSymlink != 0 {
return fmt.Errorf("collectCPConfigFiles: template path must not be a symlink")
return nil, fmt.Errorf("collectCPConfigFiles: template path must not be a symlink")
}
err = filepath.WalkDir(cfg.TemplatePath, func(path string, d os.DirEntry, walkErr error) error {
if walkErr != nil {