Skip to content

Net10 upgrade#4288

Open
paveliak wants to merge 13 commits intoactions:mainfrom
paveliak:net10-upgrade
Open

Net10 upgrade#4288
paveliak wants to merge 13 commits intoactions:mainfrom
paveliak:net10-upgrade

Conversation

@paveliak
Copy link
Contributor

@paveliak paveliak commented Mar 9, 2026

This PR upgrades runner to using .Net 10 (specifically 10.0.103):

  • Source generator is added for the BuildContants.cs file
  • RunnerService project is migrated to SDK style to avoid C# Dev Kit warnings
  • C# DevKit extension is added to the Codespace
  • Code and tests is refactored to allow developing/testing in VStudio/VSCode without prior running of dev.sh build/layout
  • On Windows VStudio 2026 is needed to develop for 10.0.103

@paveliak paveliak requested a review from a team as a code owner March 9, 2026 14:13
Copilot AI review requested due to automatic review settings March 9, 2026 14:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the GitHub Actions runner from .NET 8 to .NET 10 (SDK 10.0.103). It touches every project file to update the target framework, replaces the MSBuild-based BuildConstants.cs generation with a Roslyn incremental source generator, migrates RunnerService.csproj to SDK-style project format, removes NuGet packages that are now in-box with .NET 10, and adjusts tests to be runnable without a prior dev.sh build/layout.

Changes:

  • All project files updated from net8.0 to net10.0, SDK version bumped to 10.0.103, and in-box NuGet packages removed.
  • New Runner.Sdk.Generator Roslyn source generator replaces the MSBuild GenerateConstant target for BuildConstants code generation, with IDE-friendly fallbacks for commit hash, runtime ID, and version.
  • RunnerService.csproj migrated from legacy to SDK-style, test infrastructure updated (dev.sh test now uses dotnet test directly, ProcessExtensionL0 test adds PATH-based node lookup), and C# DevKit extension added to the Codespace.

Reviewed changes

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

Show a summary per file
File Description
src/global.json SDK version bumped from 8.0.418 to 10.0.103
src/dev.sh SDK version updated, GIT_COMMIT_HASH added, CommitHash passed to builds/tests, test command changed to dotnet test
src/dir.proj Removed GenerateConstant and Test targets, added Generator cleanup to Clean
src/Runner.Sdk.Generator/BuildConstantsGenerator.cs New Roslyn incremental source generator for BuildConstants
src/Runner.Sdk.Generator/Runner.Sdk.Generator.csproj New project file for the source generator (targets netstandard2.0)
src/Runner.Sdk/Runner.Sdk.csproj Updated TFM, added source generator project reference and CompilerVisibleProperties, removed in-box packages
src/Runner.Sdk/BuildConstants.cs Deleted (now generated by source generator)
src/Sdk/Sdk.csproj Updated TFM, removed in-box packages
src/Runner.Worker/Runner.Worker.csproj Updated TFM, removed System.Threading.Channels
src/Runner.Common/Runner.Common.csproj Updated TFM, removed in-box packages
src/Runner.Listener/Runner.Listener.csproj Updated TFM, removed Microsoft.Win32.Registry
src/Runner.Plugins/Runner.Plugins.csproj Updated TFM
src/Runner.PluginHost/Runner.PluginHost.csproj Updated TFM, removed System.Runtime.Loader
src/Runner.Service/Windows/RunnerService.csproj Migrated to SDK-style project format
src/Test/Test.csproj Updated TFM, removed System.Threading.ThreadPool
src/Test/L0/ProcessExtensionL0.cs Added FindInPath helper for node lookup, fallback to layout path
src/ActionsRunner.sln Added Generator project, added x64/x86 platform configurations
.devcontainer/devcontainer.json Updated .NET version, added C# DevKit extension
Comments suppressed due to low confidence (1)

src/Runner.Sdk.Generator/BuildConstantsGenerator.cs:41

  • Process.Start can return null if the process cannot be started (e.g., git is not on PATH). This would result in a NullReferenceException on the next line when accessing process.StandardOutput. Additionally, if git fails (e.g., the directory is not a git repo), no error is reported and the output may be empty or contain an error message that gets injected into the generated source.

Consider wrapping this in a try/catch and returning a sensible default (like "N/A") on failure, and adding a null check for process.

        private static string GetCommitHash(string projectDir)
        {
            using var process = Process.Start(new ProcessStartInfo("git", "rev-parse HEAD")
            {
                WorkingDirectory = projectDir,
                RedirectStandardOutput = true,
                UseShellExecute = false,
            });
            return process.StandardOutput.ReadToEnd().Trim();
        }

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.

2 participants