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

Issue #469 - Move book configuration to the existing ServiceConfiguration #470

Merged

Conversation

Robbware
Copy link
Contributor

@Robbware Robbware commented Oct 6, 2023

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the COMET-WEB code style guidelines
  • I have provided test coverage for my change (where applicable)

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.

…llow both the WASM and Server Configuration services to be able to parse complex objects and not just key value pairs.
@Robbware Robbware added the improvement an improvement to the COMET architectrure, not an enhancement to user experience label Oct 6, 2023
@Robbware Robbware self-assigned this Oct 6, 2023
@Robbware Robbware linked an issue Oct 6, 2023 that may be closed by this pull request
…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.
@antoineatstariongroup
Copy link
Contributor

I forgot to ask before, can you fix the 2 found Code Smells

Copy link
Contributor

@antoineatstariongroup antoineatstariongroup left a 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

@@ -64,13 +73,22 @@ public override Task InitializeService()
return Task.CompletedTask;
}

this.ServerConfiguration = new ServerConfiguration();
Copy link
Contributor

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 ?

Copy link
Contributor Author

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.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

93.5% 93.5% Coverage
0.0% 0.0% Duplication

warning 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.
Read more here

@Robbware Robbware merged commit c3c7838 into development Oct 6, 2023
7 checks passed
@Robbware Robbware deleted the Feat/move-bookconfiguration-to-configurationservices branch October 6, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement an improvement to the COMET architectrure, not an enhancement to user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move bookconfiguration settings to existing ConfigurationService
3 participants