Honor --data-dir in shared CLI config path (fixes #611) #614
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!614
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-611"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every store-touching subcommand ignored --data-dir: config.Load derives paths from ResolveDataDir(env) only, and only serve repaired that. This change applies the serve-style flag sync in the shared resolveConfig (plus the --env-file twin loadWithEnvFiles), re-pointing ONLY flag-derived paths (DataDir, Store.Root, Cache.Dir) when they equal the env-default-derived paths. Explicit file values and WALHUB__* overlay preserved by construction (no FirstRunDefaults re-derivation). Serve's fixup kept as an idempotent no-op.
Verification:
Independent review: APPROVED (no fix commit needed — no defects found; all checks below verified directly in /tmp/walhub-611).
Method: read the full diff + config.go/serve.go/load.go/firstrun.go; ran gofmt, vet, full cmd/walhub suite, -race on the new tests, coverage profile; replayed the new matrix against origin/main config.go/serve.go (red, as expected); live-binary check (policy set under --data-dir A, get from A/nonexistent-X/default).
go test ./cmd/walhub/green incl. -race, internal/config green. Matrix is RED on origin/main (all flag subtests fail, DataDir unmoved) and green here — true regression coverage. Coverage gate covers internal/... only (Makefile:34), so cmd/ is ungated, but syncDataDirFlag itself measures 100%.c.dataDir == ""early return before any mutation.Live binary proof (WALHUB_DATA_DIR hermetic): policy set under --data-dir A reads back from A; nonexistent X returns {} (empty, no default leak); default dir returns {} (no cross-contamination); config dump under nonexistent X prints store.root/cache.dir under X.
Verdict: APPROVE / merge-ready. No changes requested, no fix commits made (worktree /tmp/walhub-611 left untouched on
1ed619d).