Skip to content

chore: Distinguish telemetry events from WebIDE and Desktop extension

Juhee Lee requested to merge 1532/add-webIDE-refs-snowplow into main

Description

Snowplow telemetry events currently don't distinguish between WebIDE and Desktop. They are all tracked as coming from desktop.

This MR introduces the distinction.

Related Issues

Resolves #1532 (closed) #1548 (closed)

How has this been tested?

Desktop:

  1. Run snowplow micro locally

    docker run --name snowplow-micro --rm -e MICRO_IGLU_REGISTRY_URL="https://gitlab-org.gitlab.io/iglu" -p 127.0.0.1:9091:9090 snowplow/snowplow-micro:latest
  2. Provide the trackingUrl for the local Snowplow collector in the VS Code Extension settings.json config

    "gitlab.trackingUrl": "http://localhost:9091",
  3. apply this patch

    diff --git a/src/common/snowplow/snowplow_options.ts b/src/common/snowplow/snowplow_options.ts
    index c0b43b9c..66842cca 100644
    --- a/src/common/snowplow/snowplow_options.ts
    +++ b/src/common/snowplow/snowplow_options.ts
    @@ -10,7 +10,7 @@ export type SnowplowOptions = {
     
     export const snowplowBaseOptions: Omit<SnowplowOptions, 'enabled'> = {
       appId: 'gitlab_ide_extension',
    -  endpoint: 'https://snowplow.trx.gitlab.net',
    +  endpoint: 'http://localhost:9091',
       timeInterval: 5000,
       maxItems: 10,
     };
  4. set languageServer feature flag to false in the common/feature_flags/constants.ts

    [FeatureFlag.LanguageServer]: false
  5. reset the snowplow micro

    curl -s "http://127.0.0.1:9091/micro/reset"
  6. Run vscode extension locally

  7. Trigger a chat and submit the feedback form. Check ideExtensionContext in the snowplow micro [http://127.0.0.1:9091/micro/good]

    {
      "schema": "iglu:com.gitlab/ide_extension_version/jsonschema/1-0-0",
      "data": {
      "ide_name": "Visual Studio Code",
      "ide_vendor": "Microsoft Corporation",
      "ide_version": "1.89.1",
      "extension_name": "GitLab Workflow",
      "extension_version": "5.12.0"
    }
    }
  8. Trigger code suggestion and check ideExtensionContext in the snowplow micro

WebIDE:

  1. Go to gitlab.web.ide and checkout this branch
  2. cd gitlab-vscode-extension and repeat Desktop step 2 - 4
    1. If you get process is undefined error and fails to activate workflow extension, go to /common/constants.ts and change IS_OSX to

      export const IS_OSX = typeof process !== 'undefined' && process.platform === 'darwin';

      just for testing purpose to get by #1609 (closed).

  3. Follow Setup integrating with GitLab Workflow VS Code extension
  4. Run yarn run start:example
  5. Fill up the config form
    • Gitlab URL: https://gitlab.com
    • Project Path: gitlab-org/gitlab-web-ide
    • Git Ref: main
    • Check Enable code suggestions and Enable telemetry
    • Authenticate with your GitLab personal access token
  6. Repeat desktop step 7 & 8 and confirm the following ideExtensionContext
{
 "schema": "iglu:com.gitlab/ide_extension_version/jsonschema/1-0-0",
 "data": {
   "ide_name": "GitLab Web IDE",
   "ide_vendor": "GitLab Inc.",
   "ide_version": "1.89.1",
   "extension_name": "GitLab Workflow",
   "extension_version": "5.15.0"
  }
}

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Juhee Lee

Merge request reports

Loading