Repository navigation
feat(settings): importable settings model and in-memory validator - #839
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📚 Docs preview✅ Live: https://pr-839-wavehouse-docs.wave-rf.workers.dev (follows this PR)
Earlier commits (3)
|
Code coverage overviewLanguages: Go Go
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
|
@coderabbitai review |
|
Closes #834.
A program that writes settings directories (a control plane, a provisioning tool, a GitOps generator) can now check a directory with the server's own rules, at the server's own version, before anything reaches disk.
internal/{policy,pipes,tenant,chsql}move topkg/, and the pure half ofinternal/settings(document types,Finding,Files, the validator,Validate/Tree,Seedand the embedded seed) moves topkg/settings. The runtime half (Registry,Store,Watch,WriteSeed) stays ininternal/settings.settings.ValidateFiles(map[string][]byte)runs the whole pass over the four files' bytes.ValidateDiris that pass after the checks only a directory can fail (it exists, each file is a regular file,config.json's permission bits). In memory, names read as directory entries do: dot-prefixed skipped, any other stray name unexpected, an absent or nil file missing.wavehouse validate, boot and reload keep going through the one path.Seed()round-trips through the public types (pinned by a test);Findingkeeps the JSON shapePOST /v1/ops/settings/reloadreturns.pkg/free ofinternal/and of the server's runtime dependencies.go list -deps ./pkg/...shows only the standard library, go-humanize and yaml.v3.make devwatch list, the unit-test package list and the e2e coverage exclude that follows the validator.Most of the diff is import-path rewrites; the substantive files are
pkg/settings/{validate,tree,seed}.go,internal/settings/{registry,store,seed}.go,.golangci.ymland the docs.