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

Updated authorization to the latest agent workflow. #197

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

PiotrKarczmarz
Copy link
Collaborator

@PiotrKarczmarz PiotrKarczmarz commented Jan 17, 2025

CLOSE https://linear.app/sourcegraph/issue/CODY-4620/cody-does-not-stay-signed-in-after-closing-visual-studio

  1. Server endpoint and access token is no longer set via ExtensionConfiguration, because in a specific scenario, it could cause invalidating an access token when VS is restarted (probably agent related bug when migrated to the new secret storage driven sign in workflow).
  2. Fixed NRE in the SecretStorageService when Set() method is called with empty/null key (not allowed by IVsCredentialStorageService implementation).
  3. Moved event AuthorizationDetailsChanged from UserSettingsService to SecretStorageService
    • introduced IsEndpoint() as a heuristic logic to detect if the agent changed account and/or access token.
  4. Removed code handling signout/signin commands from HandleAuthCommand() - the agent handles this workflows themselves by accessing secret storage.
  5. Added logging to SecretStorageService and try/catch statements.
  6. Updated UI tests infrastructure to allow setting access token explicitly during run-time.

Test plan

  1. Test sign in / sign out workflows
  2. Check if it's still in logged state when Visual Studio is restarted

Copy link

github-actions bot commented Jan 17, 2025

Test Results

25 tests  +25   23 ✅ +23   5m 58s ⏱️ + 5m 58s
 1 suites + 1    2 💤 + 2 
 1 files   + 1    0 ❌ ± 0 

Results for commit b0e8267. ± Comparison against base commit d1ed3ba.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@kalanchan kalanchan left a comment

Choose a reason for hiding this comment

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

approving to unblock

@PiotrKarczmarz PiotrKarczmarz merged commit b4b9c37 into main Jan 20, 2025
6 checks passed
@PiotrKarczmarz PiotrKarczmarz deleted the piotr/auth-workflow branch January 20, 2025 10:50
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.

2 participants