refactor: GitLabPlatformForAccount must have account
Description
When we implemented the GitLabPlatformForAccount, we knew that the WebIDE doesn't have a token account, so we made the account optional.
This MR represents that situation differently, we create a TokenAccount
with an empty token. No logic is now dependent on the token, but once we have OAuth working in WebIDE, this refactoring enables us to only change the implementation detail in the Browser platform.
This refactoring comprises of 3 distinct commits and is best-reviewed commit-by-commit.
Related Issues
Refactoring to support implementation of LS: multiple accounts and self-managed support (#1054 - closed)
How has this been tested?
- first and second commit
- This MR changed how API fetches the current user, so I changed that the following ways:
- I run the command
GitLab: Show issues assigned to me
this command fetches current user to get their ID and then opens URL likehttps://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues?assignee_id=3457201
- The
Merge Requests I'm reviewing
tree item in the GitLab menu uses custom query with current user, we changed that logic in the first refactoring
- I run the command
- This MR changed how API fetches the current user, so I changed that the following ways:
- third commit
- we changed the way we initialize GitLabPlatformManager for WebIDE
- I followed our guide to set up the Workflow with WebIDE
- In the submodule I checked out this MR branch and then run
yarn start:example
from the WebIDE root - I saw that the WebIDE and Workflow work well - the code suggestions worked and there were no errors in the log.
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by Tomas Vik