Skip to content

fix: register ini codec for config loading#211

Merged
wcollins merged 5 commits into
itential:mainfrom
wcollins:fix/viper-ini-codec-registry
Jul 14, 2026
Merged

fix: register ini codec for config loading#211
wcollins merged 5 commits into
itential:mainfrom
wcollins:fix/viper-ini-codec-registry

Conversation

@wcollins

Copy link
Copy Markdown
Contributor

Description

Unblocks #193. Viper 1.20 removed built-in INI support, and INI is the default config format for ipctl, so the Dependabot bump breaks all config loading (decoder not found for this format) and hangs TestConfigLoadingIsThreadSafe until the CI test timeout. This PR upgrades Viper to 1.21.0 and restores INI support by registering the codec Viper extracted (github.com/go-viper/encoding/ini).

Type of Change

  • Bug fix

Changes Made

  • Bump spf13/viper 1.19.0 -> 1.21.0 and vendor go-viper/encoding/ini
  • Register the INI codec via viper.NewCodecRegistry() in Loader.Load(); the registry falls back to built-in YAML, JSON, and TOML codecs for other formats
  • Fix TestConfigLoadingIsThreadSafe to count failed goroutines as completed, so config errors fail in seconds instead of deadlocking CI
  • Regenerate NOTICE for the changed dependency tree (drops hcl, magiconair/properties, slog-shim; adds go-viper packages, locafero, go.yaml.in/yaml/v3)

Testing

  • make test passes; internal/config completes in 0.3s (previously hung on Viper 1.21)
  • Verified with the built binary: INI configs load via --config, extensionless ~/.platform.d/config, and config.ini discovery; YAML configs still load through the codec-registry fallback; malformed INI returns a clear parse error
  • go-licenses report passes

Checklist

  • Code follows the project's style guidelines
  • Self-review of code has been performed
  • Commits follow conventional format
  • No secrets or credentials committed

@wcollins wcollins added the bug Something isn't working label Jul 14, 2026
@wcollins
wcollins merged commit 8651b00 into itential:main Jul 14, 2026
1 check passed
@wcollins
wcollins deleted the fix/viper-ini-codec-registry branch July 14, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant