Skip to content

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
mainfrom
devin/1789402367-net8-problem-details
Open

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1789402367-net8-problem-details

Conversation

@devin-ai-integration

Copy link
Copy Markdown

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@v4 with 8.0.x (was pinned to 6.0.x) and collects XPlat coverage.

Request validation: EducationDto gets DataAnnotations mirroring the EF config (Degree ≤50, FieldOfStudy/School ≤250 required, Description ≤1000). The required C# modifier was dropped (= string.Empty) so a missing field yields a 400 ValidationProblemDetails keyed by property instead of a System.Text.Json deserialization error.

RFC 7807 everywhere:

  • AddProblemDetails() with traceId extension; new GlobalExceptionHandler : IExceptionHandler (.NET 8) returns a 500 application/problem+json without leaking the exception message; UseExceptionHandler() + UseStatusCodePages().
  • EducationsController drops all try/catch and uses Problem(...)/ValidationProblem(ModelState).

Controller contract changes (behavioral, please review):

Endpoint Before After
GET /{id} missing 204 404 problem
POST ok 200 201 + Location
PUT/DELETE ok 200 204
PUT/DELETE missing 400 (empty) 404 problem
PUT id mismatch 400 (empty) 400 problem
any exception 500 (empty) 500 problem+json

Health check registration is skipped when no connection string is configured (needed for WebApplicationFactory tests).

Tests: controller unit tests rewritten (real HttpContext so Problem() resolves ProblemDetailsFactory) plus EducationsApiIntegrationTests over HTTP via WebApplicationFactory<Program> asserting application/problem+json, error keys, traceId, Location header. EducationsController line 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.

devin-ai-integration Bot and others added 2 commits September 14, 2026 16:19
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
Co-Authored-By: Rush Cromer II <rush.cromerii@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants