Loading
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.
Related Issues
Resolves #1025 (closed)
How has this been tested?
Desktop
- Start the extension in debug mode.
- Set a breakpoint in the method that sends Snowplow events to the snowplow server.
- Type something in a source file to request code suggestions.
- When telemetry is enabled, the method should send the snowplow events via HTTP request.
- Disable telemetry in the VSCode Settings UI.
- When is not enabled, the method should not send the snowplow events via HTTP request.
Web IDE
- Follow these instructions to run the VSCode Workflow Extension in the Web IDE.
- 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