Engine+Mongo: Target net8 and net9 instead of netstandard2.1#917
Merged
kennethmyhra merged 7 commits intoApr 27, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the target frameworks from netstandard2.1 to net8 and net9 while also refactoring header handling and related methods to use Append rather than Add. Key changes include:
- Parsing query strings using HttpUtility in FhirServiceExtensions.
- Changing header operations in various classes from Add to Append.
- Updating IServiceCollection extension methods to return IMvcBuilder instead of IMvcCoreBuilder, along with related documentation updates.
Reviewed Changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Spark.Engine/Service/FhirServiceExtensions/ResourceManipulationOperationFactory.cs | Replaces custom query string parsing with HttpUtility.ParseQueryString. |
| src/Spark.Engine/Handlers/FormatTypeHandler.cs | Updates header addition from Add to Append for proper header handling. |
| src/Spark.Engine/Formatters/BinaryOutputFormatter.cs | Similar header change to Append to avoid duplicate header registrations. |
| src/Spark.Engine/Extensions/IServiceCollectionExtensions.cs | Changes extension method return types from IMvcCoreBuilder to IMvcBuilder. |
| src/Spark.Engine/Extensions/HttpRequestFhirExtensions.cs | Alters header additions to use Append and replaces response.Body check with ContentLength. |
| src/Spark.Engine/ExceptionHandling/ErrorHandler.cs | Removes HttpResponseException handling branch. |
| src/Spark.Engine/Core/RequiredAttributeException.cs | Removes unused serialization constructor. |
| src/Spark.Engine.Test/Formatters/ResourceXmlInputFormatterTests.cs & ResourceJsonInputFormatterTests.cs | Updates tests expectations in line with new content type handling. |
| Documentation/MigrateFromv2Tov3.md | Updates migration docs to reflect new target frameworks and changes to extension methods. |
Files not reviewed (2)
- src/Spark.Engine/Spark.Engine.csproj: Language not supported
- src/Spark.Mongo/Spark.Mongo.csproj: Language not supported
Comments suppressed due to low confidence (2)
src/Spark.Engine/ExceptionHandling/ErrorHandler.cs:50
- The removal of the HttpResponseException handling branch could lead to unhandled exceptions if HttpResponseException is thrown; please confirm that alternative exception handling is in place.
else if (exception is HttpResponseException ex2)
src/Spark.Engine/Extensions/HttpRequestFhirExtensions.cs:173
- Replacing the null check on response.Body with a ContentLength check changes the semantics; verify that this condition correctly identifies cases where a response body exists and that no valid responses are missed when ContentLength is 0.
if (response.ContentLength > 0)
Also, removes HttpResponseException handling branch, replaces UriExtensions.ParseQueryString() with HttpUtility.ParseQueryString(). Adds a FramworkReference to Microsoft.AspNetCore.App and removes all other somewhat similar PackageReferences. This is in line with the assemblies we actually want to be referencing.
Using IHeaderDictionary.Add() gives warning suggesting to use IHeaderDictionary.Append(), so let's move to that.
HttpResponse.Body will never be null so check instead if ContentLength is above zero.
The AddControllers() should be a more lightweight and also more proper method for our library to call.
0fbd6e0 to
0891d85
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.