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

Fix bug in config set when flag --config is provided #274

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Conversation

jlewi
Copy link
Owner

@jlewi jlewi commented Oct 4, 2024

  • config set agent.model wasn't working when you use "--config" to specify a non default config file
  • The break occured because of
    globalV = viper.New()
  • That change meant InitViper was no longer operating on the global instance.
  • However this line
    viper.Set(cfgName, cfgValue)
    which was modifying the configuration was using the global instance
  • This PR fixes this by being explicit about the instance of viper used.
  • The unittest verifies we correctly modify the configuration

* config set agent.model wasn't working
* add a unittest
Copy link

netlify bot commented Oct 4, 2024

Deploy Preview for foyle canceled.

Name Link
🔨 Latest commit bf5d76e
🔍 Latest deploy log https://app.netlify.com/sites/foyle/deploys/66ff3590b657a50008f5cef7

@jlewi jlewi merged commit e2feb99 into main Oct 4, 2024
5 checks passed
@jlewi jlewi deleted the jlewi/cfgset branch October 4, 2024 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant