-
Notifications
You must be signed in to change notification settings - Fork 1k
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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")}."); |
There was a problem hiding this comment.
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")) |
There was a problem hiding this comment.
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.
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 theExecuteCommand
method, and the addition of a new unit test to verify the new functionality.