Skip to content

feat(activity-api): upgrade to .NET 10#161

Merged
willvelida merged 3 commits intomainfrom
feature/activity-api-dotnet10-upgrade
Mar 6, 2026
Merged

feat(activity-api): upgrade to .NET 10#161
willvelida merged 3 commits intomainfrom
feature/activity-api-dotnet10-upgrade

Conversation

@willvelida
Copy link
Owner

📝 Description

Upgrades the Biotrackr.Activity.Api project (and its test projects) from .NET 9 to .NET 10.

🔗 Related Issues

N/A

🚀 Changes

✨ feat(TFM & NuGet packages)
What: Updated target framework from net9.0 to net10.0 and bumped all NuGet packages to latest versions across all 3 projects.
Why: Keep the project on the latest supported .NET version.
📁 Files: Biotrackr.Activity.Api.csproj, Biotrackr.Activity.Api.UnitTests.csproj, Biotrackr.Activity.Api.IntegrationTests.csproj

✨ feat(Built-in OpenAPI)
What: Replaced Swashbuckle with native AddOpenApi() / MapOpenApi(). Removed Swashbuckle.AspNetCore package and using Microsoft.OpenApi.Models.
Why: Microsoft.OpenApi 2.x (bundled with .NET 10) has breaking namespace changes. Built-in OpenAPI support makes Swashbuckle unnecessary.
📁 Files: Program.cs (AddOpenApi, MapOpenApi), Biotrackr.Activity.Api.csproj (removed Swashbuckle)

🔧 config(Dockerfile)
What: Updated base and SDK image tags from 9.0 to 10.0.
Why: Match the new target framework.
📁 Files: Dockerfile

🔧 config(CI/CD)
What: Updated DOTNET_VERSION from 9.0.x to 10.0.x.
Why: CI pipeline must use the matching SDK version.
📁 Files: deploy-activity-api.yml

🧹 refactor(Program.cs)
What: Removed public partial class Program { } and Microsoft.Extensions.Options package reference.
Why: .NET 10 source generator auto-generates the partial class. Microsoft.Extensions.Options is now included transitively (NU1510 warning).
📁 Files: Program.cs, Biotrackr.Activity.Api.csproj

🙏 Additional Context

  • All 74 unit tests pass on .NET 10.
  • Pre-existing warnings (nullability, deprecated WithOpenApi, ManagedIdentityCredential constructor) remain unchanged — out of scope for this PR.
  • xunit v2 deprecation is a separate migration effort.

Signed-off-by: Will Velida <willvelida@hotmail.co.uk>
Replace Swagger endpoint tests with native OpenAPI endpoint tests.
- /swagger -> /openapi/v1.json
- /swagger/v1/swagger.json -> /openapi/v1.json

agent: github-copilot
model: Claude Opus 4.6
contribution: code-generation
Signed-off-by: Will Velida <willvelida@hotmail.co.uk>
Add coverage.runsettings to exclude Microsoft.AspNetCore.OpenApi.Generated
namespace from coverlet instrumentation. The .NET 10 OpenAPI source generator
emits classes that are not unit-testable, dropping coverage from 84% to 33%.

- Add runsettings-path input to template-dotnet-run-unit-tests.yml
- Point deploy-activity-api.yml at branch template temporarily

agent: github-copilot
model: Claude Opus 4.6
contribution: code-generation
Signed-off-by: Will Velida <willvelida@hotmail.co.uk>
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Code Coverage

Package Line Rate Branch Rate Health
Biotrackr.Activity.Api 84% 86%
Summary 84% (214 / 254) 86% (24 / 28)

Minimum allowed line rate is 70%

@willvelida willvelida merged commit 033476d into main Mar 6, 2026
11 checks passed
@willvelida willvelida deleted the feature/activity-api-dotnet10-upgrade branch March 6, 2026 23:50
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.

1 participant