-
Notifications
You must be signed in to change notification settings - Fork 1
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
Issue #469 - Move book configuration to the existing ServiceConfiguration #470
Issue #469 - Move book configuration to the existing ServiceConfiguration #470
Conversation
…llow both the WASM and Server Configuration services to be able to parse complex objects and not just key value pairs.
COMET.Web.Common.Tests/Server/Services/ConfigurationService/ConfigurationServiceTestFixture.cs
Outdated
Show resolved
Hide resolved
COMET.Web.Common.Tests/Server/Services/ConfigurationService/ConfigurationServiceTestFixture.cs
Outdated
Show resolved
Hide resolved
COMET.Web.Common.Tests/Server/Services/ConfigurationService/ConfigurationServiceTestFixture.cs
Outdated
Show resolved
Hide resolved
…Configuration object for all configuration needs. Fix all tests and components that were using the deleted properties from the ConfigurationService. Parse feedback and add documentation.
I forgot to ask before, can you fix the 2 found Code Smells |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small editorial requests and a small possible, not mandatory, improvement
COMET.Web.Common.Tests/Server/Services/ConfigurationService/ConfigurationServiceTestFixture.cs
Outdated
Show resolved
Hide resolved
COMET.Web.Common/Services/ConfigurationService/IConfigurationService.cs
Outdated
Show resolved
Hide resolved
@@ -64,13 +73,22 @@ public override Task InitializeService() | |||
return Task.CompletedTask; | |||
} | |||
|
|||
this.ServerConfiguration = new ServerConfiguration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A small improvement that could be done there (I just think about that now) : Could it be possible to have a complete ServerConfiguration inside the app.settings.json file? We could then use only one JsonSerializer call instead of querying each properties of the IConfiguration ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great suggestion. I've done that on my latest commit - for this to work, I had to modify our server_configuration.json a bit, so that we could have a ServerConfiguration object. This way I could just get the ServerConfiguration section, which then retrieves all of the properties within that object.
I had to do it this way because IConfiguration doesn't offer an easy way for us to just read the whole file - only section by section. Should work as what we want 😉
… the whole settings object once. Add more documentation. Fix the tests due to the refactor.
Kudos, SonarCloud Quality Gate passed! 0 Bugs 93.5% Coverage The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
Prerequisites
Description
This change moves the need to use an HttpClient when we're required to access the BookInputConfiguration files.
The changes made here also allow for us to leverage the full power of .NET's IConfiguration implementation and interpret complex JSON objects and not only KeyValuePairs, which allows for some better organization of our setting files.
The changes here affect both WASM and Server modes, where as WASM will read the data from the server_configuration.json file (as it had been doing) and Server should be looking at the appsettings.json file.