Skip to content

Remove unnecessary connection test during some registration flows#4244

Merged
TingluoHuang merged 1 commit intoactions:mainfrom
zarenner:zarenner/unnecessary-test-connection
Feb 12, 2026
Merged

Remove unnecessary connection test during some registration flows#4244
TingluoHuang merged 1 commit intoactions:mainfrom
zarenner:zarenner/unnecessary-test-connection

Conversation

@zarenner
Copy link
Contributor

No description provided.

@TingluoHuang TingluoHuang marked this pull request as ready for review February 12, 2026 13:46
@TingluoHuang TingluoHuang requested a review from a team as a code owner February 12, 2026 13:46
Copilot AI review requested due to automatic review settings February 12, 2026 13:46
@TingluoHuang TingluoHuang merged commit 6680090 into actions:main Feb 12, 2026
13 checks passed
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 updates runner registration to skip the _runnerServer.ConnectAsync(...) connectivity test when the runner-admin registration flow is in use, avoiding an extra connection attempt during that path.

Changes:

  • Conditionally skip the runner-server connection validation when UseRunnerAdminFlow is enabled.
  • Update in-code comments to describe why the connection test is skipped in runner-admin flow.

Comment on lines +181 to +186
// Validate can connect using the obtained vss credentials.
// In Runner Admin flow there's nothing new to test connection to at this point as registerToken is already validated via GetTenantCredential.
if (!runnerSettings.UseRunnerAdminFlow)
{
await _runnerServer.ConnectAsync(new Uri(runnerSettings.ServerUrl), creds);
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

When UseRunnerAdminFlow is true, this skips the connection check but still prints "Connected to GitHub" and logs "Test Connection complete." This makes the output/telemetry ambiguous because no runner-server connectivity was actually validated in this path. Consider adjusting the messaging/logging (or emitting an explicit "skipping connection test" trace) so operators can tell whether a real _runnerServer.ConnectAsync succeeded.

See below for a potential fix:


                        _term.WriteLine();
                        _term.WriteSuccessMessage("Connected to GitHub");

                        Trace.Info("Test Connection complete.");
                    }
                    else
                    {
                        Trace.Info("Skipping runner-server connection test because runner-admin flow has already validated the registration token.");

                        _term.WriteLine();
                        _term.WriteSuccessMessage("GitHub authentication succeeded (runner-admin flow; no additional connection test performed).");
                    }

Copilot uses AI. Check for mistakes.
Comment on lines +182 to +186
// In Runner Admin flow there's nothing new to test connection to at this point as registerToken is already validated via GetTenantCredential.
if (!runnerSettings.UseRunnerAdminFlow)
{
await _runnerServer.ConnectAsync(new Uri(runnerSettings.ServerUrl), creds);
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This change introduces a new branch where _runnerServer.ConnectAsync(...) is intentionally not called for runner-admin flow. There are existing L0 tests for ConfigurationManager.ConfigureAsync, but none assert this new behavior. Please add a unit test that exercises the runner-admin flow and verifies the connection test is skipped (and, if applicable, that the flow still proceeds to runner group discovery/registration).

Copilot generated this review using guidance from repository custom instructions.
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