-
-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
Malformed configuration files are silently overwritten during startup paths. If ~/.ggcconfig.yaml contains invalid YAML, ggc logs a parse error but then rewrites the file with generated defaults.
Steps to Reproduce
- Create a malformed config file:
MOD=$(go env GOMODCACHE); CCH=$(go env GOCACHE); TMP=$(mktemp -d) printf 'broken: [yaml\n' > "$TMP/.ggcconfig.yaml"
- Run ggc with that HOME:
HOME="$TMP" GOMODCACHE="$MOD" GOCACHE="$CCH" go run . version >/dev/null 2>/tmp/err.txt
- Inspect stderr and config file:
head -n1 /tmp/err.txt sed -n '1,6p' "$TMP/.ggcconfig.yaml"
Expected Behavior
If config parsing fails, ggc should report the error and leave the existing config file untouched.
Screenshots
N/A
Environment
- OS: macOS 26.2
- Go Version: go version go1.25.7 darwin/arm64
- ggc Version: ggc version v1.0.0 (commit: abc123)
- git Version (run
git --version): git version 2.39.5 (Apple Git-154)
Additional Context
Root cause was two startup write paths after parse failure:
pkg/config.Manager.LoadConfig()always calledSave().cmd/versionproceeded with metadata updates that callSet()(which persists config).
closes #343
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working