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 config loading #334

Merged
merged 2 commits into from
Aug 21, 2023
Merged

Fix config loading #334

merged 2 commits into from
Aug 21, 2023

Conversation

benjben
Copy link
Contributor

@benjben benjben commented Aug 17, 2023

No description provided.

@benjben benjben requested a review from spenes August 17, 2023 15:35
Copy link
Contributor

@spenes spenes left a comment

Choose a reason for hiding this comment

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

I think this is okay but it would be good to get @istreeter's opinion as well since original design was his and there might be reason to use ConfigFactory.load in there.

@@ -67,7 +67,7 @@ object ConfigParser {
}

private def loadAll(config: TypesafeConfig): TypesafeConfig =
namespaced(ConfigFactory.load(namespaced(config.withFallback(namespaced(ConfigFactory.load())))))
namespaced(config.withFallback(namespaced(ConfigFactory.load())))
Copy link
Contributor

Choose a reason for hiding this comment

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

If you do it this way, then config precedence goes in this order:

  1. The config file
  2. System properties passed on the command line (e.g. -Dcollector.port=8888)
  3. Application defaults

It is more common to have this kind of precedence:

  1. System properties
  2. The config file
  3. Application defaults.

All of our other applications have the extra ConfigFactory.load so I would prefer to keep it if we can find a way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for this change is that we observed that the config file was not overriding the default parameters. Do you know why ?

Copy link
Contributor

Choose a reason for hiding this comment

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

#336 seems to fix it.

We might need to look more closely at namespaced to check it's reliable and to check whether it is overall helpful for us. But for now I suggest merge in #336 because that's roughly what we do in other apps. And we can revisit it later when we have more time.

@benjben benjben mentioned this pull request Aug 18, 2023
@pondzix pondzix merged commit bf461b5 into feature/http4s Aug 21, 2023
2 of 3 checks passed
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.

4 participants