Skip to content

Update setup job starting logs#4383

Open
GitPaulo wants to merge 4 commits intoactions:mainfrom
GitPaulo:gitpaulo/update-setup-job-logs
Open

Update setup job starting logs#4383
GitPaulo wants to merge 4 commits intoactions:mainfrom
GitPaulo:gitpaulo/update-setup-job-logs

Conversation

@GitPaulo
Copy link
Copy Markdown

@GitPaulo GitPaulo commented Apr 28, 2026

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.

Copilot AI review requested due to automatic review settings April 28, 2026 11:04
@GitPaulo GitPaulo requested a review from a team as a code owner April 28, 2026 11:04
Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
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

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

Comment thread src/Runner.Worker/JobExtension.cs
Comment thread src/Runner.Worker/JobExtension.cs Outdated
Comment thread src/Runner.Worker/JobExtension.cs Outdated
Comment thread src/Runner.Worker/JobExtension.cs Outdated
if (setting.PoolId > 0)
{
context.Output($"Runner name: '{setting.AgentName}'");
context.Output($"Runner group name: '{setting.PoolName}'");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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?

GitPaulo and others added 2 commits April 28, 2026 12:15
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}'");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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}'");
}

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