Skip to content

feat: config defaults override poller key/values#152

Merged
cgrinds merged 2 commits into
mainfrom
cbg-defaults
Jun 16, 2026
Merged

feat: config defaults override poller key/values#152
cgrinds merged 2 commits into
mainfrom
cbg-defaults

Conversation

@cgrinds

@cgrinds cgrinds commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings June 15, 2026 18:32
@cla-bot cla-bot Bot added the cla-signed label Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces poller-level default configuration application during config loading, by vendoring a struct/map merge helper (Mergo) and using it to merge Defaults into each Poller (only filling zero-valued fields).

Changes:

  • Apply cfg.Defaults onto each poller during ReadConfig, while preserving explicitly-set poller values.
  • Add unit tests covering default inheritance and nested struct merging.
  • Vendor third_party/mergo and update Go indirect dependencies (golang.org/x/net, golang.org/x/sys).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
config/config.go Applies defaults to each poller via Poller.applyDefaults() during config load.
config/config_test.go Adds tests for default inheritance, overrides, nested merges, and integration via ReadConfig.
third_party/mergo/mergo.go Adds core shared helpers/errors for the vendored merge package.
third_party/mergo/merge.go Implements deep merge logic used by mergo.Merge.
third_party/mergo/map.go Implements mergo.Map mapping logic between map/struct.
third_party/mergo/doc.go Adds package documentation for vendored Mergo.
third_party/mergo/README.md Adds upstream README for vendored Mergo.
third_party/mergo/LICENSE Adds upstream BSD 3-Clause license for vendored Mergo.
go.mod Bumps indirect golang.org/x/net and golang.org/x/sys.
go.sum Updates sums to match dependency version bumps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread third_party/mergo/map.go
Comment thread third_party/mergo/merge.go
Comment thread third_party/mergo/doc.go
Comment thread config/config.go
Comment thread config/config.go Outdated
Comment thread config/config.go Outdated
@cgrinds cgrinds merged commit c126db2 into main Jun 16, 2026
16 of 23 checks passed
@cgrinds cgrinds deleted the cbg-defaults branch June 16, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants