-
-
Notifications
You must be signed in to change notification settings - Fork 36
upgrade of viper and mapstructure libraries #507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update the configuration system to use the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant Config
participant Viper
participant CodecRegistry
participant HCLCodec
Caller->>Config: newConfig(format)
Config->>CodecRegistry: Create registry
Config->>HCLCodec: Register HCL codec in registry
Config->>Viper: Initialise with key delimiter and codec registry
Viper-->>Config: Viper instance ready (with HCL support)
Config-->>Caller: Return Config instance
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
📒 Files selected for processing (5)
config/config.go
(2 hunks)config/config_mixins.go
(1 hunks)config/config_v1.go
(1 hunks)config/profile.go
(1 hunks)go.mod
(1 hunks)
🧰 Additional context used
🪛 golangci-lint (1.64.8)
config/config.go
66-66: Error return value of codecRegistry.RegisterCodec
is not checked
(errcheck)
🪛 GitHub Check: Build and test (1.24, macos-latest)
config/config.go
[failure] 66-66:
Error return value of codecRegistry.RegisterCodec
is not checked (errcheck)
🪛 GitHub Check: Build and test (1.24, ubuntu-latest)
config/config.go
[failure] 66-66:
Error return value of codecRegistry.RegisterCodec
is not checked (errcheck)
🪛 GitHub Actions: Build
config/config.go
[error] 66-66: golangci-lint: Error return value of codecRegistry.RegisterCodec
is not checked (errcheck)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (go)
🔇 Additional comments (7)
config/profile.go (1)
20-20
: Library migration looks good.The dependency migration from
github.com/mitchellh/mapstructure
togithub.com/go-viper/mapstructure/v2
is the right approach. This is part of the overall improvement to use the more actively maintained fork of mapstructure.config/config_v1.go (1)
10-10
: Library update looks correct.This import change aligns with the overall migration to the
go-viper
maintained fork of mapstructure.config/config_mixins.go (1)
11-11
: Import update is consistent with project changes.The import path update maintains consistency across the codebase in migrating to the go-viper fork.
go.mod (2)
13-14
: Good dependency updates.Adding
github.com/go-viper/encoding/hcl
and upgrading togithub.com/go-viper/mapstructure/v2
are appropriate changes that align with the PR objectives.
25-25
: Viper version update is necessary.Upgrading to viper v1.20.1 is needed to properly support the new dependencies and ensure compatibility with the codec registry changes.
config/config.go (2)
23-24
: Library migration looks good.The import changes properly introduce the HCL codec support and upgrade to the newer mapstructure package.
73-76
: Viper initialization looks good with the codec registry.The viper initialization properly sets up the codec registry through options. This enables HCL codec support which was the main objective of the PR.
@jkellerer do you remember why we created this test? The |
Upgrading the
viper
library comes with a new fork ofmapstructure