Skip to content
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

Replace viper with koanf #4845

Merged
merged 12 commits into from
May 21, 2024
Merged

Conversation

WithoutPants
Copy link
Collaborator

@WithoutPants WithoutPants commented May 16, 2024

Viper has long been a pain to deal with, particularly around its handling of camelCase field keys. Investigation of #4740 also determined that viper was the root cause.

This PR replaces viper with koanf. koanf handles camel case fields correctly. This means that all of the camel case to snake case conversion hacks can be removed.

Since the field keys are changed, a (non-schema) migration is required to convert existing config files. The migration backs up the existing config file in the same directory to config.yml.57.<datetime>. The migrated config file will not be compatible with older stash versions.

Fixes #4740
Fixes #4575

@WithoutPants WithoutPants added bug Something isn't working chore Pull requests for refactoring and admin work labels May 16, 2024
@WithoutPants WithoutPants added this to the Version 0.26.0 milestone May 16, 2024
Copy link
Sponsor Contributor

@Maista6969 Maista6969 left a comment

Choose a reason for hiding this comment

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

Tested this on my Windows system and I could not find any issues after migrating my config: tried toggling some settings, generating new API keys, changing some filters around, etc. and everything works fine 👍

internal/manager/config/init.go Outdated Show resolved Hide resolved
@WithoutPants WithoutPants merged commit bfc60bb into stashapp:develop May 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working chore Pull requests for refactoring and admin work
Projects
None yet
2 participants