chore: Distinguish telemetry events from WebIDE and Desktop extension
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:
-
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
-
Provide the
trackingUrl
for the local Snowplow collector in the VS Code Extensionsettings.json
config"gitlab.trackingUrl": "http://localhost:9091",
-
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, };
-
set languageServer feature flag to false in the
common/feature_flags/constants.ts
[FeatureFlag.LanguageServer]: false
-
reset the snowplow micro
curl -s "http://127.0.0.1:9091/micro/reset"
-
Run vscode extension locally
-
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" } }
-
Trigger code suggestion and check
ideExtensionContext
in the snowplow micro
WebIDE:
- Go to
gitlab.web.ide
and checkout this branch - cd
gitlab-vscode-extension
and repeat Desktop step 2 - 4-
If you get
process is undefined
error and fails to activate workflow extension, go to/common/constants.ts
and changeIS_OSX
toexport const IS_OSX = typeof process !== 'undefined' && process.platform === 'darwin';
just for testing purpose to get by #1609 (closed).
-
- Follow Setup integrating with GitLab Workflow VS Code extension
- Run
yarn run start:example
- 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
- 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