feat: config defaults override poller key/values#152
Merged
Conversation
There was a problem hiding this comment.
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.Defaultsonto each poller duringReadConfig, while preserving explicitly-set poller values. - Add unit tests covering default inheritance and nested struct merging.
- Vendor
third_party/mergoand 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.
rahulguptajss
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.