Skip to content

feat(configwatcher): add NewGroup/Fill for struct-based field watching#869

Merged
zeevdr merged 6 commits into
mainfrom
feat/18-configwatcher-field-groups
Jun 5, 2026
Merged

feat(configwatcher): add NewGroup/Fill for struct-based field watching#869
zeevdr merged 6 commits into
mainfrom
feat/18-configwatcher-field-groups

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented Jun 5, 2026

Summary

  • Registering multiple watched fields required one explicit w.String()/w.Bool() call per field and separate Get() calls to read them; there was no struct-oriented API.
  • Added Watcher.NewGroup(s *T) that introspects decree struct tags and registers each tagged field as a watched value in one call.
  • Added Group.Fill(s *T) that reads current values into any struct of the same type, providing a snapshot-style read API.

Test plan

  • go test ./... passes in sdk/configwatcher
  • NewGroup(&Config{}) registers all tagged fields, Fill(&cfg) populates them correctly
  • Type mismatch between NewGroup and Fill returns an error

Closes #18

@zeevdr zeevdr added enhancement New feature or request sdk SDK changes size: L Larger effort — multiple days, design decisions needed priority: P2 Nice-to-have labels Jun 5, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 5, 2026

Codecov Report

❌ Patch coverage is 70.96774% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/configwatcher/fieldgroups.go 70.96% 10 Missing and 8 partials ⚠️

📢 Thoughts on this report? Let us know!

zeevdr added 4 commits June 5, 2026 07:25
- The decree CLI had no Homebrew install path; users had to use go install or build from source.
- goreleaser.yaml was already configured to auto-push to opendecree/homebrew-tap on release; created initial formula stub in the tap repo (PR #1) with real checksums from v0.11.0-alpha.1.
- Updated docs/getting-started.md to list Homebrew as the primary install method above go install.

Closes #20
@zeevdr zeevdr merged commit c1d4e71 into main Jun 5, 2026
21 checks passed
@zeevdr zeevdr deleted the feat/18-configwatcher-field-groups branch June 5, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: P2 Nice-to-have sdk SDK changes size: L Larger effort — multiple days, design decisions needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configwatcher field groups (struct mapping)

1 participant