Repository navigation
Add install telemetry #13653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Karthik Nadig (karthiknadig)
merged 5 commits into
microsoft:master
from
karthiknadig:install1
Aug 28, 2020
Merged
Add install telemetry #13653
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Add extension install telemetry.
- Loading branch information
commit caf4da649f9a157bc3fbe9d4a1b7a8b14e620926
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import * as path from 'path'; | ||
| import { setSharedProperty } from '.'; | ||
| import { IFileSystem } from '../common/platform/types'; | ||
| import { EXTENSION_ROOT_DIR } from '../constants'; | ||
|
|
||
| /** | ||
| * Sets shared telemetry property about where the extension was installed from | ||
| * currently we only detect installations from the Python coding pack installer. | ||
| * Those installations get the 'pythonCodingPack'. Otherwise assume the default | ||
| * case as 'MarketPlace'. | ||
| * | ||
| */ | ||
| export async function setExtensionInstallTelemetryProperties(fs: IFileSystem) { | ||
| // Look for PythonCodingPack file under `%USERPROFILE%/.vscode/extensions` | ||
| // folder. If that file exists treat this extension as installed from coding | ||
| // pack. | ||
| // | ||
| // Use parent of EXTENSION_ROOT_DIR to access %USERPROFILE%/.vscode/extensions | ||
| // If you use join (%USERPROFILE%, .vscode, extensions), then if user has both | ||
| // ~/.vscode and ~./vscode-insiders, and launches Python extension via VS Code | ||
| // insiders, it will look for ~/.vscode/extensions/PythonCodingPack which is | ||
| // wrong. This is a rare scenario, and it can be easily avoided by using parent | ||
| // of EXTENSION_ROOT_DIR. Ii you use EXTENSION_ROOT_DIR then, in the case of | ||
| // VS Code insiders it will be, ~/.vscode-insiders/extensions/. That folder will | ||
| // NOT have PythonCodingPack file and we can treat the insiders case as MarkerPlace. | ||
| const fileToCheck = path.join(path.dirname(EXTENSION_ROOT_DIR), 'PythonCodingPack'); | ||
|
karthiknadig marked this conversation as resolved.
|
||
| if (await fs.fileExists(fileToCheck)) { | ||
| setSharedProperty('installSource', 'pythonCodingPack'); | ||
| } else { | ||
| // We did not file the `PythonCodingPack` file, assume market place install. | ||
| setSharedProperty('installSource', 'marketPlace'); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.