Update setup job starting logs#4383
Conversation
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Pull request overview
Updates the “Set up job” startup logging in JobExtension.InitializeJob to better align runner identification details (runner name, runner group) with the desired LHR/self-hosted log output.
Changes:
- Log runner name unconditionally from runner settings.
- Log runner group name based on configured pool metadata (
PoolId/PoolName). - Keep machine name logging gated on detecting OAuth-based credentials.
Show a summary per file
| File | Description |
|---|---|
| src/Runner.Worker/JobExtension.cs | Adjusts setup-job log lines for runner identity/group details. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 3
| if (setting.PoolId > 0) | ||
| { | ||
| context.Output($"Runner name: '{setting.AgentName}'"); | ||
| context.Output($"Runner group name: '{setting.PoolName}'"); |
There was a problem hiding this comment.
Question, should we use variables system here?
message.Variables["system.runnerGroupName"] was used before but now PoolName will be available, can we trust it to be up to date?
Co-authored-by: Copilot <copilot@github.com>
| context.Output($"Runner name: '{setting.AgentName}'"); | ||
| if (!string.IsNullOrEmpty(setting.PoolName)) | ||
| { | ||
| context.Output($"Runner group name: '{setting.PoolName}'"); |
There was a problem hiding this comment.
we probably still want to use system.runnerGroupName for self-hosted runner since you can rename the runner group.
| var credFile = HostContext.GetConfigFile(WellKnownConfigFile.Credentials); | ||
| if (File.Exists(credFile)) | ||
| { | ||
| var credData = IOUtil.LoadObject<CredentialData>(credFile); |
There was a problem hiding this comment.
i would suggest just add the following after the if (credData != null && credData.Data.TryGetValue("clientId", out var clientId))
else if (setting.PoolId > 0 && !string.IsNullOrEmpty(setting.PoolName) && !string.IsNullOrEmpty(setting.AgentName))
{
context.Output($"Runner name: '{setting.AgentName}'");
context.Output($"Runner group name: '{setting.PoolName}'");
}
Overview
We are cleaning up setup job logs and this is a first step to restore parity to LHR logs and improve on it further in the future.