Skip to content

OPS-157454: Migrate to .NET 10 and upload test coverage to Codacy - #1

Merged
davidnmbond merged 1 commit into
mainfrom
ci/codacy-coverage
Sep 28, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
ci/codacy-coverage

Conversation

@davidnmbond

Copy link
Copy Markdown

Tracks OPS-157454.

Why

main has not built since the 16 Sep NuGet governance remediation commit. The library .csproj declared both <TargetFrameworks>netstandard2.0</TargetFrameworks> and a stray <TargetFramework>net10.0</TargetFramework>, which fails with NETSDK1005.

.NET 10 migration

  • Library targets net10.0 only. netstandard2.0 is dropped. ⚠️ This is a breaking change for consumers: .NET Framework projects, and projects on .NET versions earlier than 10, can no longer consume new releases of this package and should stay on the last .NET Standard 2.0 release.
  • One real diagnostic surfaced: CS8601 on Uri.TryCreate(..., out _webhookUri), because net10.0 annotates the out parameter as nullable. Fixed by assigning through a local after the success check. No new suppressions were added.
  • Tests moved from xunit v2 to xunit.v3 on Microsoft.Testing.Platform (UseMicrosoftTestingPlatformRunner). Nullable is now enabled for the tests too, and the 8 warnings that caused were fixed with real null checks rather than suppressions. The legacy net45 packages.config and VS Service item were removed, and the unused xunit v2 version was removed from Directory.Packages.props.
  • global.json pins SDK 10.0.401 with rollForward: disable. Because of that, the CI jobs now install the SDK with global-json-file: global.json rather than 10.0.x.
  • The README and CONTRIBUTING were updated. The README drops the .NET Framework TLS 1.2 workaround and the "older .NET framework" install instructions.

Coverage job

This follows PanoramicData.NugetManagement and the merged PanoramicData.Mapper example:

  • It runs on runs-on: [pdl-public], and setup-dotnet uses DOTNET_INSTALL_DIR: ${{ runner.temp }}/dotnet. All steps are bash.
  • It runs the xunit v3 test executable with --coverage --coverage-settings coverage.config --coverage-output-format cobertura. coverage.config is added and ports the estate's generated-code exclusions.
  • It uploads to Codacy with codacy/codacy-coverage-reporter-action@v1 (continue-on-error: true), and uploads the Cobertura file as a 7-day artifact.
  • It runs only tests that need no credentials: --filter-not-trait "Category=Integration". Every current test uses a mocked HttpMessageHandler, so nothing is excluded today. The filter and a CONTRIBUTING note are there for any future live-Slack test.

Verification

These checks were run in a clean mcr.microsoft.com/dotnet/sdk:10.0.401 container:

  • dotnet build -c Release finished with 0 warnings and 0 errors, and dotnet pack succeeded.
  • 136 of 136 tests passed. Local line coverage is 87.6%.
  • actionlint is clean apart from the expected unknown pdl-public label.

No NuGet publish or release tag is part of this change.

🤖 Generated with Claude Code

main did not build: the library declared both TargetFrameworks
netstandard2.0 and a stray TargetFramework net10.0 (NETSDK1005).

- Library targets net10.0 only; netstandard2.0 dropped. Fix the CS8601
  the net10.0 nullable annotations on Uri.TryCreate surfaced.
- Tests: xunit v2 -> xunit.v3 on Microsoft.Testing.Platform, nullable
  enabled with the resulting warnings fixed, legacy packages.config and
  VS Service item removed.
- global.json pins SDK 10.0.401 with rollForward disable; CI installs
  it via global-json-file.
- New coverage job on pdl-public runs the offline suite with
  Microsoft.Testing.Extensions.CodeCoverage and uploads Cobertura to
  Codacy; Integration-trait tests are excluded.
- README and CONTRIBUTING updated for the new target framework.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 100.00% diff coverage

Metric Results
Coverage variation Report missing for 56550731
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5655073) Report Missing Report Missing Report Missing
Head commit (d1d4927) 89 78 87.64%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1) 2 2 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@davidnmbond
davidnmbond merged commit 3e562ad into main Sep 28, 2026
6 of 7 checks passed
@davidnmbond
davidnmbond deleted the ci/codacy-coverage branch September 28, 2026 08:27
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