feature: upgrade to .NET 8, add request validation and RFC 7807 problem details - #77
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
.NET 8 upgrade: all projects →
net8.0; EF Core / Npgsql / ASP.NET packages → 8.0.x; test stack → xunit 2.9.2, FakeItEasy 8.3, coverlet 6.0.2; Dockerfile →aspnet:8.0/sdk:8.0; CI workflow →setup-dotnet@v4with8.0.x(was pinned to 6.0.x) and collects XPlat coverage.Request validation:
EducationDtogets DataAnnotations mirroring the EF config (Degree≤50,FieldOfStudy/School≤250 required,Description≤1000). TherequiredC# modifier was dropped (= string.Empty) so a missing field yields a400 ValidationProblemDetailskeyed by property instead of a System.Text.Json deserialization error.RFC 7807 everywhere:
AddProblemDetails()withtraceIdextension; newGlobalExceptionHandler : IExceptionHandler(.NET 8) returns a500 application/problem+jsonwithout leaking the exception message;UseExceptionHandler()+UseStatusCodePages().EducationsControllerdrops alltry/catchand usesProblem(...)/ValidationProblem(ModelState).Controller contract changes (behavioral, please review):
Health check registration is skipped when no connection string is configured (needed for
WebApplicationFactorytests).Tests: controller unit tests rewritten (real
HttpContextsoProblem()resolvesProblemDetailsFactory) plusEducationsApiIntegrationTestsover HTTP viaWebApplicationFactory<Program>assertingapplication/problem+json, error keys,traceId, Location header.EducationsControllerline coverage: 100% (WebApi assembly 96%). 22 tests pass.Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/5974d55e53804be082172182ac4a9283
Open in Devin Desktop: https://app.devin.ai/desktop/session/5974d55e53804be082172182ac4a9283?variant=devin
Requested by: @rushcromer
Note
Devin errored when opening this Pull Request as rushcromer.
As a fallback, Devin opened this PR as itself.