Skip to content

Adopt .NET 10 with multitargeting#25

Open
JohnCampionJr wants to merge 10 commits into
solarwinds:mainfrom
jcamp-code:feature/adopt-net10
Open

Adopt .NET 10 with multitargeting#25
JohnCampionJr wants to merge 10 commits into
solarwinds:mainfrom
jcamp-code:feature/adopt-net10

Conversation

@JohnCampionJr

Copy link
Copy Markdown

Closes #16.

Multi-targets net8.0 and net10.0 for both the tool and the tests, bumps the SDK and CI to .NET 10, and runs the test suite against both runtimes.

Raising AnalysisLevel to 10 (tracking the new TFM) surfaced two rules, fixed rather than suppressed:

  • CA1515: made the app's types internal. Added InternalsVisibleTo for DynamicProxyGenAssembly2 so Moq can still mock the now-internal interfaces.
  • CA1872: use Convert.ToHexString in the test hash helper.

Left the Spectre.Console and other package upgrades out to keep this focused; can follow up separately.

Also adds macOS support to ProcessExecutorTests (was throwing on OSX).

Multi-target net8.0;net10.0 for the tool and tests, bump the SDK and CI to .NET 10, and run the tests on both runtimes. AnalysisLevel tracks the TFM now; fixed the findings it surfaced (CA1515 -> internal types with InternalsVisibleTo for Moq, CA1872 -> Convert.ToHexString).
@JohnCampionJr

Copy link
Copy Markdown
Author

Sorry, accidentally closed it; certainly didn't mean to.

@JohnCampionJr JohnCampionJr marked this pull request as ready for review June 8, 2026 18:38
Copilot AI review requested due to automatic review settings June 8, 2026 18:38
@JohnCampionJr JohnCampionJr requested a review from a team as a code owner June 8, 2026 18:38

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

Note

Copilot was unable to run its full agentic suite in this review.

Adopts .NET 10 by multi-targeting the tool and test projects (net8.0 + net10.0), updates CI/CodeQL SDK setup accordingly, and reduces the library’s exposed surface area by making several types internal.

Changes:

  • Multi-target the main package and tests for net8.0;net10.0 and adjust language/analyzer settings per target.
  • Update CI/CodeQL workflows and global.json to use .NET 10 SDK.
  • Make multiple previously public types internal and add InternalsVisibleTo for proxy-based mocking.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/SolarWinds.Changesets.Tests/Version/CsProjectsRepositoryTests.cs Simplifies SHA256 hash-to-hex conversion using Convert.ToHexString.
tests/SolarWinds.Changesets.Tests/SolarWinds.Changesets.Tests.csproj Multi-targets tests for net8.0 and net10.0.
tests/SolarWinds.Changesets.Tests/ProcessExecutorTests.cs Extends non-Windows test execution path to include macOS.
src/SolarWinds.Changesets/SolarWinds.Changesets.csproj Multi-targets package and enables internals access for dynamic proxy mocking.
src/SolarWinds.Changesets/Shared/ResultCodes.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ProcessOutput.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ProcessExecutor.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/InitializationException.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/IProcessExecutor.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/IConfigurationService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/IChangesetsRepository.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/Constants.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ChangesetFile.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/ChangesetConfig.cs Changes visibility to internal.
src/SolarWinds.Changesets/Shared/BumpType.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/IGitService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/IDotnetService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/GitService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Publish/Services/DotnetService.cs Changes visibility to internal.
src/SolarWinds.Changesets/Commands/Add/IProjectFileNamesLocator.cs Changes visibility to internal.
global.json Pins repo SDK to .NET 10 feature band.
Directory.Build.props Conditions C# language and analyzer levels per target framework.
.github/workflows/codeql.yml Uses .NET 10 SDK for CodeQL build.
.github/workflows/ci.yml Installs both .NET 8 and .NET 10 SDKs in CI.
.changeset/adopt-dotnet-10.md Adds a changeset entry describing .NET 10 adoption.

Comment thread src/SolarWinds.Changesets/Shared/ResultCodes.cs
Comment thread global.json Outdated
Comment thread Directory.Build.props Outdated
Comment thread Directory.Build.props Outdated
JohnCampionJr and others added 8 commits June 8, 2026 15:38
Use 10.0.100 with rollForward latestFeature so any installed .NET 10 feature band
satisfies it, instead of requiring 10.0.300 or higher.
only one lang and analysis should be supported (we will develop in .net 10, yet compile for .net 8-10)
…y.build.props

Removed net10.0 from the target frameworks.
for building all .net 8-10 we just need the .net 10 sdk
@magiino

magiino commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@JohnCampionJr Thank you for your contribution, and I apologize for the delay in reviewing your pull request. We will merge all PRs and release the new version ASAP.

I have a demo repository where I configured the original https://github.com/changesets/action to work with our net-changesets tool.

You can find it here:
https://github.com/magiino/Marekth.NetChangesets.Demo/blob/main/.github/workflows/release.yml

After each merge to the main branch, the action creates a release PR. During this process, all changeset files are converted into changelog entries, and the package version is bumped by running the changeset version.
Once the release PR is merged, changeset publish is triggered automatically.

Example release PR:
https://github.com/magiino/Marekth.NetChangesets.Demo/pull/7/changes

The action is wired to the .NET Changesets implementation here:
https://github.com/magiino/Marekth.NetChangesets.Demo/blob/main/.github/workflows/release.yml#L44

You can provide your own commands for both the versioning and publishing steps. In our case, we use this mechanism to invoke the .NET implementation instead of the default JavaScript-based one.

"SolarWinds.Changesets": Minor
---

Adopt .NET 10 with multi-targeting. The tool and tests now target net8.0 and net10.0, the SDK and CI use .NET 10, and the test suite runs against both runtimes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jvilimek, this must be updated according to the new changes

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.

Adopt .NET 10

4 participants