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

Document the config merge strategy #3136

Open
matrixbot opened this issue Sep 10, 2024 · 2 comments
Open

Document the config merge strategy #3136

matrixbot opened this issue Sep 10, 2024 · 2 comments
Labels
A-Configuration Related on what is configurable and how it can be configured

Comments

@matrixbot
Copy link
Collaborator

This issue was originally created by @HarHarLinks at matrix-org/matrix-authentication-service#3136.

https://github.com/matrix-org/matrix-authentication-service/blob/d3eb5be63ead3078f71f142785fc3768dcd7bcd8/docs/setup/general.md?plain=1#L50

but it's not explained how configs get merged in theory. will values from second.yaml overwrite those in first.yaml or reverse? or is it illegal to try this?

@matrixbot matrixbot added the A-Configuration Related on what is configurable and how it can be configured label Sep 10, 2024
@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @sandhose at matrix-org/matrix-authentication-service#3136 (comment).

We're using figment under the hood, with the merge strategy, meaning that later values are generally preferred. Not sure whether this is the right approach or not; it may make more sense to switch to the adjoin strategy, where the first config files take precedence, and arrays get merged?

https://docs.rs/figment/latest/figment/struct.Figment.html#conflict-resolution

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @HarHarLinks at matrix-org/matrix-authentication-service#3136 (comment).

merge strategy meets what I would have guessed but could not be sure. Whether you decide to change it or not, this issue is about documenting your approach so that the reader may create their config appropriately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Configuration Related on what is configurable and how it can be configured
Projects
None yet
Development

No branches or pull requests

1 participant