Skip to content

Update to latest version of .NET and packages - #210

Merged
mgrosperrin merged 4 commits into
mainfrom
features/0.14.0/update-dependencies
Aug 6, 2026
Merged

Update to latest version of .NET and packages#210
mgrosperrin merged 4 commits into
mainfrom
features/0.14.0/update-dependencies

Conversation

@mgrosperrin

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings August 5, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository to a newer .NET SDK/tooling baseline and modernizes CI/release workflows, while refreshing package dependencies and test infrastructure to use Microsoft Testing Platform.

Changes:

  • Bump SDK tooling via global.json and update central package versions (notably Microsoft.Extensions.*, NSubstitute, and xUnit MTP packages).
  • Migrate test projects to Microsoft Testing Platform extensions (TRX + code coverage) and simplify test target frameworks to net8.0.
  • Refactor GitHub Actions workflows into reusable build.yml plus separate publish workflows, and switch solution definition from .sln to .slnx.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/MGR.CommandLineParser.UnitTests/MGR.CommandLineParser.UnitTests.csproj Switch unit tests to Microsoft Testing Platform (TRX + coverage) and xUnit MTP package.
tests/MGR.CommandLineParser.IntegrationTests/MGR.CommandLineParser.IntegrationTests.csproj Switch integration tests to Microsoft Testing Platform (TRX + coverage) and xUnit MTP package.
tests/Directory.Build.props Update tests to target net8.0 only.
src/MGR.CommandLineParser/MGR.CommandLineParser.csproj Include repo README.md in NuGet package and set PackageReadmeFile.
src/MGR.CommandLineParser.Hosting/MGR.CommandLineParser.Hosting.csproj Include repo README.md in NuGet package and set PackageReadmeFile.
src/MGR.CommandLineParser.Command.Lambda/MGR.CommandLineParser.Command.Lambda.csproj Include repo README.md in NuGet package and set PackageReadmeFile.
MGR.CommandLineParser.slnx Add new XML-based solution definition.
MGR.CommandLineParser.sln Remove legacy Visual Studio solution file.
global.json Bump .NET SDK version and configure Microsoft Testing Platform as the test runner.
Directory.Packages.props Update centralized package versions and swap to xUnit MTP + MTP extensions.
.github/workflows/release.yml Rewire release pipeline to use new reusable build + publish workflows and update deploy-pages action.
.github/workflows/publish-packages-nuget.yml Add reusable NuGet publish workflow using OIDC login.
.github/workflows/publish-packages-myget.yml Add reusable MyGet publish workflow.
.github/workflows/generate-docs.yml Update docs workflow actions and docfx action used.
.github/workflows/codeql-analysis.yml Update to setup-dotnet via global.json and refresh checkout action.
.github/workflows/ci.yml Rewire CI to use new reusable build workflow and separate publish workflow.
.github/workflows/buildAndPublish.yml Remove old combined build/test/publish workflow.
.github/workflows/build.yml Add new reusable build/test/coverage/package-artifact workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/build.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 5, 2026 20:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 18 changed files in this pull request and generated no new comments.

Suppressed comments (5)

.github/workflows/build.yml:43

  • TRX output is commonly written under nested TestResults subdirectories; the current glob (TestResults/*_report.trx) won’t match in that case, causing test reporting to miss results. Using a recursive glob is safer without changing the test invocation.
        name: .NET Tests
        path: 'TestResults/*_report.trx'
        reporter: dotnet-trx

tests/MGR.CommandLineParser.IntegrationTests/MGR.CommandLineParser.IntegrationTests.csproj:5

  • After removing Microsoft.NET.Test.Sdk, this project no longer has a test-project marker (IsTestProject is not set anywhere in the repo). dotnet test may not discover or execute these tests unless IsTestProject is explicitly enabled.
	<PropertyGroup>
		<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
	</PropertyGroup>

tests/MGR.CommandLineParser.UnitTests/MGR.CommandLineParser.UnitTests.csproj:5

  • After removing Microsoft.NET.Test.Sdk, this project no longer has IsTestProject set anywhere in the repo (and the usual SDK-based marker is gone). dotnet test may skip the project entirely unless IsTestProject is explicitly set.
	<PropertyGroup>
		<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
	</PropertyGroup>

.github/workflows/build.yml:35

  • The repo no longer contains a .sln file and has multiple .csproj files at the repo root, so relying on bare dotnet build / dotnet test can fail depending on whether the SDK recognizes .slnx as a solution format. Pointing the commands explicitly at MGR.CommandLineParser.slnx avoids brittle CI behavior.

This issue also appears on line 41 of the same file.

    - name: Build and Pack
      run: dotnet build -c Release -p:Version=${{ steps.version.outputs.version}}

    - name: Run tests
      run: dotnet test -c Release --no-build --report-trx --report-trx-filename "{asm}_report.trx" --coverage --coverage-output-format cobertura

.github/workflows/codeql-analysis.yml:43

  • With the .sln removed and multiple projects present, dotnet build -c Release can fail if the SDK doesn’t auto-detect the new .slnx solution format. Build the solution explicitly to keep CodeQL runs deterministic.
    - name: Build projects
      run: dotnet build -c Release

Comment thread .github/workflows/build.yml Fixed
Comment thread .github/workflows/build.yml Fixed
Comment thread .github/workflows/generate-docs.yml Fixed
Comment thread .github/workflows/publish-packages-nuget.yml Fixed
Copilot AI review requested due to automatic review settings August 6, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

Suppressed comments (3)

tests/MGR.CommandLineParser.UnitTests/Extensibility/Converters/FileSystemInfoConverterTests.cs:43

  • Path.GetTempPath() returns a path with a trailing directory separator, while new DirectoryInfo(value).FullName typically normalizes by trimming it. This makes the subsequent Assert.Equal(value, ((DirectoryInfo)actual).FullName) brittle and can fail cross-platform.
    {
        // Arrange
        IConverter converter = new FileSystemInfoConverter();
        var value = Path.GetTempPath();

tests/MGR.CommandLineParser.IntegrationTests/UnspecifiedCommand/SimpleOptionsWithArgumentsTests.cs:16

  • Path.GetTempPath() returns a trailing directory separator; later OutputDirectory.FullName will be normalized (typically without the trailing separator), making Assert.Equal(expectedOutputDirectory, ...) fragile. Normalizing the temp directory string avoids OS-specific failures.
        var fileArgument = Path.GetTempFileName();
        var expectedOutputDirectory = Path.GetTempPath();
        var expectedOutputFile = Path.GetTempFileName();
        IEnumerable<string> args = ["import", fileArgument, "-p:50", @"-o:" + expectedOutputDirectory, @"-of:" + expectedOutputFile];

Directory.Packages.props:14

  • Microsoft.NET.Test.Sdk is still pinned here, but there are no PackageReference Include="Microsoft.NET.Test.Sdk" usages in the repo anymore (tests were moved to Microsoft Testing Platform). Keeping unused central package versions makes dependency management harder.
    <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />

Copilot AI review requested due to automatic review settings August 6, 2026 13:21
@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@mgrosperrin
mgrosperrin merged commit 2ea3dc5 into main Aug 6, 2026
9 checks passed
@mgrosperrin
mgrosperrin deleted the features/0.14.0/update-dependencies branch August 6, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated no new comments.

Suppressed comments (4)

tests/MGR.CommandLineParser.UnitTests/Extensibility/Converters/FileSystemInfoConverterTests.cs:27

  • Path.GetTempFileName() creates a real file on disk, which the test never cleans up. Since the converter only needs a syntactically valid path string, use a random filename under the temp directory instead to avoid leaving temp files behind.
        var value = Path.GetTempFileName();

tests/MGR.CommandLineParser.UnitTests/Extensibility/Converters/FileSystemInfoConverterTests.cs:43

  • Path.GetTempPath() typically includes a trailing directory separator, while DirectoryInfo.FullName may normalize that representation. Normalizing the expected path using DirectoryInfo(...).FullName will prevent platform-specific assertion failures.
        var value = Path.GetTempPath();

tests/MGR.CommandLineParser.IntegrationTests/UnspecifiedCommand/SimpleOptionsWithArgumentsTests.cs:15

  • Path.GetTempFileName() creates real files and the test does not clean them up. Also, comparing directory strings against DirectoryInfo.FullName can be flaky due to normalization (e.g., trailing separators). Prefer non-creating temp paths and normalize the expected directory path.
        var fileArgument = Path.GetTempFileName();
        var expectedOutputDirectory = Path.GetTempPath();
        var expectedOutputFile = Path.GetTempFileName();

.github/workflows/build.yml:43

  • The TRX filename passed to dotnet test does not include a TestResults/ path, but the test reporter only looks in TestResults/*_report.trx. This mismatch can cause CI to report "no test results found" even when tests ran successfully; use a recursive glob (or align the output location) so results are always discovered.
        name: .NET Tests
        path: 'TestResults/*_report.trx'
        reporter: dotnet-trx

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.

3 participants