Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow enable auth migration by default. #3804

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TingluoHuang
Copy link
Member

This pull request introduces changes to enable authentication migration by default when certain conditions are met. The most important changes include modifications to the EnableAuthMigration method, updates to the ExecuteCommand method, and the addition of a new unit test to verify the new functionality.

@Copilot Copilot bot review requested due to automatic review settings April 10, 2025 16:59
@TingluoHuang TingluoHuang requested a review from a team as a code owner April 10, 2025 16:59
Copy link

@Copilot 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 enables authentication migration by default when the appropriate configuration is set.

  • Added a new unit test in RunnerL0.cs to validate the default activation of auth migration.
  • Updated the ExecuteCommand logic in Runner.Listener/Runner.cs to trigger auth migration based on credentials.
  • Modified the log message in HostContext.cs to reflect the time of auth migration using the current UTC time.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Test/L0/Listener/RunnerL0.cs Added unit test for verifying auth migration behavior.
src/Runner.Listener/Runner.cs Updated command execution logic to check credentials and enable auth migration.
src/Runner.Common/HostContext.cs Changed log message to display the current UTC time instead of a deferred timestamp.
Comments suppressed due to low confidence (2)

src/Runner.Listener/Runner.cs:318

  • [nitpick] Consider defining a constant for the 'EnableAuthMigrationByDefault' flag to prevent potential typos and ensure consistency.
HostContext.EnableAuthMigration("EnableAuthMigrationByDefault");

src/Runner.Common/HostContext.cs:271

  • [nitpick] The log message now uses the current UTC time instead of the deferred auth migration time, which may affect debugging; please verify that this change is intentional.
_trace.Info($"Enable auth migration at {DateTime.UtcNow.ToString("O")}");

@@ -268,7 +268,7 @@ public void EnableAuthMigration(string trace)
}
}

_trace.Info($"Enable auth migration at {_deferredAuthMigrationTime.ToString("O")}.");
Copy link
Member Author

Choose a reason for hiding this comment

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

copilot used the wrong time before... _deferredAuthMigrationTime is a time in the future, i want to log the time at this point.

var cred = store.GetCredentials();
if (cred != null &&
cred.Scheme == Constants.Configuration.OAuth &&
cred.Data.ContainsKey("EnableAuthMigrationByDefault"))
Copy link
Member Author

Choose a reason for hiding this comment

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

EnableAuthMigrationByDefault in the .credentials will make the runner to try migration without waiting for service.

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.

1 participant