Skip to content

feat!: Bump minimum DotNet version to 8#225

Merged
gjtorikian merged 4 commits intonext-versionfrom
bump-msv
Mar 22, 2026
Merged

feat!: Bump minimum DotNet version to 8#225
gjtorikian merged 4 commits intonext-versionfrom
bump-msv

Conversation

@gjtorikian
Copy link
Copy Markdown
Contributor

Description

The next autogenerated SDK version will support Dotnet 8+.

Documentation

Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.

[ ] Yes

If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.

gjtorikian and others added 2 commits March 20, 2026 17:50
Drop netstandard2.0/net461/netcoreapp3.1 targets in favor of net8.0.
Migrate test framework from xUnit v2 to v3, update all test methods
from async void to async Task, and bump test dependencies (Moq 4.20.72,
coverlet 6.0.2, System.Linq.Async 6.0.1). Remove obsolete packages
(Microsoft.Bcl.AsyncInterfaces, System.Configuration.ConfigurationManager,
.NET Framework reference assemblies). CI now tests against .NET 8, 9, and 10.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Runs `dotnet format --verify-no-changes` on PRs and pushes to main
to catch formatting issues separately from the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian requested review from a team as code owners March 20, 2026 21:52
@gjtorikian gjtorikian requested review from mthadley and removed request for a team March 20, 2026 21:52
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 20, 2026

Greptile Summary

This PR bumps the minimum supported .NET version from netstandard2.0/net461 to net8.0 exclusively, as preparation for the next autogenerated SDK version. It cleans up legacy compatibility shims, removes the libssl1.1 workaround from CI, upgrades the test framework from xUnit v2 to xUnit v3, and correctly fixes all async void test methods to return async Task.

Key changes:

  • WorkOS.net.csproj: Drops multi-targeting (netstandard2.0;net461) in favor of net8.0 only, removing conditional package groups and legacy compatibility packages (e.g., Microsoft.Bcl.AsyncInterfaces, System.Runtime.InteropServices.RuntimeInformation).
  • ci.yml: Updated test matrix to ["8.x", "9.x", "10.x"], removed legacy libssl1.1 step, and switched test execution to dotnet run (aligned with xUnit v3's OutputType=Exe model) — though dotnet test would still work and provides better CI test reporting.
  • lint.yml: New workflow enforcing dotnet format on every PR.
  • WorkOSTests.csproj: Migrated to xUnit v3 (xunit.v3 1.1.0) with updated package versions; <NoWarn>xUnit1051</NoWarn> globally suppresses warnings for the remaining synchronous void-returning test methods that were not converted in this PR.

Confidence Score: 4/5

  • Safe to merge — the breaking change is intentional and clearly communicated; only minor CI reporting and warning-suppression concerns remain.
  • All changes are well-scoped and consistent with the stated goal of dropping legacy .NET support. The async voidasync Task fixes are correct. The two minor concerns (using dotnet run instead of dotnet test in CI, and the global xUnit1051 suppression masking partially migrated synchronous tests) do not affect correctness or production code — they are style and process concerns only.
  • test/WorkOSTests/WorkOSTests.csproj (global warning suppression) and .github/workflows/ci.yml (test runner invocation method).

Important Files Changed

Filename Overview
.github/workflows/ci.yml Updated matrix from [6.x, 7.x, 8.x] to [8.x, 9.x, 10.x] and switched test execution from dotnet test to dotnet run, which may limit CI test reporting integration.
.github/workflows/lint.yml New workflow added for C# formatting checks using dotnet format --verify-no-changes on .NET 8. Looks correct and well-structured.
.github/workflows/release.yml Cleaned up by removing the legacy libssl1.1 installation step and pinning the release build to .NET 8.x. No issues found.
src/WorkOS.net/WorkOS.net.csproj Dropped multi-target netstandard2.0;net461 in favor of net8.0 only, removed legacy compatibility shim packages, and simplified to a single unconditional Newtonsoft.Json dependency. This is a clean and intentional breaking change.
test/WorkOSTests/WorkOSTests.csproj Migrated to net8.0 with OutputType=Exe, upgraded to xUnit v3 (1.1.0) with xunit.runner.visualstudio 3.1.0. Global suppression of xUnit1051 hides that many synchronous void test methods have not been migrated to return Task.
test/WorkOSTests/Client/Utilities/RequestUtilitiesTest.cs Fixed async voidasync Task signatures and replaced .Result blocking call with proper await. Correct improvements.
test/WorkOSTests/Services/Webhooks/WebhookTests.cs Removed unused Xunit.Abstractions import. No functional changes; clean-up only.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[PR: Bump min .NET to 8] --> B[Library: WorkOS.net.csproj]
    A --> C[Tests: WorkOSTests.csproj]
    A --> D[CI: ci.yml]
    A --> E[New: lint.yml]
    A --> F[Release: release.yml]

    B --> B1[netstandard2.0 + net461 ➜ net8.0]
    B --> B2[Remove legacy compat packages\nBcl.AsyncInterfaces, RuntimeInformation, etc.]

    C --> C1[xunit v2 ➜ xunit.v3 1.1.0]
    C --> C2[async void ➜ async Task\nin all async test methods]
    C --> C3[OutputType=Exe\nRollForward=Major]
    C --> C4[NoWarn xUnit1051\nsuppresses void sync tests]

    D --> D1[Matrix: 8.x / 9.x / 10.x]
    D --> D2[dotnet test ➜ dotnet run]
    D --> D3[Remove libssl1.1 step]

    E --> E1[dotnet format --verify-no-changes\non every PR + main push]

    F --> F1[Remove libssl1.1 step\nPin release build to .NET 8.x]
Loading

Last reviewed commit: "ci: Add dotnet forma..."

Comment thread .github/workflows/ci.yml
<RollForward>Major</RollForward>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>xUnit1051</NoWarn>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Global suppression of xUnit1051 hides migration gaps

xUnit1051 in xUnit v3 warns when [Fact] or [Theory] test methods return void instead of Task or ValueTask. The warning is being silenced globally, but there are at least 20+ synchronous public void test methods still present in the codebase (e.g., TestGetAuthorizationURLWithProvider, TestCreateQueryString, TestParseTime, etc.).

While this is a pragmatic workaround, it means the codebase is partially migrated. If the intent is to migrate all tests to async (as was done for many tests in this PR), the remaining synchronous tests should also be converted. If keeping synchronous tests is intentional, adding a comment explaining the rationale would help future maintainers understand why this suppression is in place.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

gjtorikian and others added 2 commits March 22, 2026 11:22
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…Task

xUnit v3 uses an in-process runner, so `dotnet test` fails with missing
testhost assemblies. Switch CI to `dotnet run --project`. Also convert
all remaining synchronous void test methods to return Task, and document
why the xUnit1051 suppression is still needed (CancellationToken warnings).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@gjtorikian gjtorikian merged commit 285493e into next-version Mar 22, 2026
7 checks passed
@gjtorikian gjtorikian deleted the bump-msv branch March 22, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants