Repository navigation
Allow enable auth migration by default. - #3804
Conversation
There was a problem hiding this comment.
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")}");
| } | ||
| } | ||
|
|
||
| _trace.Info($"Enable auth migration at {_deferredAuthMigrationTime.ToString("O")}."); |
There was a problem hiding this comment.
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.
EnableAuthMigrationByDefault in the .credentials will make the runner to try migration without waiting for service.
There was a problem hiding this comment.
Could cred.Data ever be null unexpectedly?
There was a problem hiding this comment.
it should never be null, however, i added check since this a new code path, and i can't patch the runner after it releases.
269dc5f to
ea030ea
Compare
This pull request introduces changes to enable authentication migration by default when certain conditions are met. The most important changes include modifications to the
EnableAuthMigrationmethod, updates to theExecuteCommandmethod, and the addition of a new unit test to verify the new functionality.