Conversation
There was a problem hiding this comment.
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.0tonet10.0, SDK version bumped to10.0.103, and in-box NuGet packages removed. - New
Runner.Sdk.GeneratorRoslyn source generator replaces the MSBuildGenerateConstanttarget forBuildConstantscode generation, with IDE-friendly fallbacks for commit hash, runtime ID, and version. RunnerService.csprojmigrated from legacy to SDK-style, test infrastructure updated (dev.sh testnow usesdotnet testdirectly,ProcessExtensionL0test 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.Startcan returnnullif the process cannot be started (e.g.,gitis not on PATH). This would result in aNullReferenceExceptionon the next line when accessingprocess.StandardOutput. Additionally, ifgitfails (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();
}
This PR upgrades runner to using .Net 10 (specifically
10.0.103):BuildContants.csfileRunnerServiceproject is migrated to SDK style to avoid C# Dev Kit warningsdev.sh build/layout10.0.103