Skip to content

refactor: GitLabPlatformForAccount must have account

Tomas Vik requested to merge tv/2023-11/ensure-account-platform-has-account into main

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:
  • 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.
      • Screenshot_2023-11-13_at_21.07.26

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

Merge request reports