refactor: Move telemetryCheck to GitLabPlaform

Description

It creates a platform-agnostic API to check if telemetry is enabled. The goal of this refactoring is to have a single telemetry setup function for the browser and desktop platforms.

How does it work?

We create a new DependencyContainer type that acts as a dependency manager for cross-platform features in the extension. We follow the inversion of control and the dependency injection principles to decouple platform-specific concerns from cross-platform features.

Resolves #1025 (closed)

How has this been tested?

Desktop

  1. Start the extension in debug mode.
  2. Set a breakpoint in the method that sends Snowplow events to the snowplow server.
  3. Type something in a source file to request code suggestions.
  4. When telemetry is enabled, the method should send the snowplow events via HTTP request.
  5. Disable telemetry in the VSCode Settings UI.
  6. When is not enabled, the method should not send the snowplow events via HTTP request.

Web IDE

  1. Follow these instructions to run the VSCode Workflow Extension in the Web IDE.
  2. You can check that Snowplow events are sent or skipped depending on the Web Browser's do not track signal.

Screenshots (if appropriate):

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 Enrique Alcántara

Merge request reports

Loading
Loading