-
Notifications
You must be signed in to change notification settings - Fork 292
Initial check-in for supporting telemetry in vscode #6123
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
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
b131f23
init check-in for telemetry
RodgeFu d7a67d3
Merge remote-tracking branch 'upstream/main' into vscode-telemetry
RodgeFu 8dcb494
update telemetry after discussion
RodgeFu ef973de
add pipeline change
RodgeFu f495b74
update telemetry
RodgeFu 43b59ab
some update
RodgeFu 70f3804
Merge remote-tracking branch 'upstream/main' into vscode-telemetry
RodgeFu 138efa8
update script
RodgeFu f9399c4
add changelog
RodgeFu 76a47df
refine the operation detail part
RodgeFu 0e3ab03
update telemetry key var name
RodgeFu 9927ec6
comment some pipeline for verifying the change (will revert after test)
RodgeFu 94764cc
comment more for testing
RodgeFu c9c1454
update script to have more log
RodgeFu 507d81b
add more log to verify the script
RodgeFu fa8281e
update update-vscode-telemetry-key script
RodgeFu 6ccec9b
fix bug in script
RodgeFu d302d59
refine handling of telemetry key
RodgeFu b056e29
add vsix to artifact
RodgeFu 4a56505
revert unnecessary change in pipeline
RodgeFu 36a9060
add more log
RodgeFu 77cb489
some refine
RodgeFu fab9abc
rename env var
RodgeFu 79ad735
add comment in launch.json
RodgeFu 016c9d8
update emitterPackage to emitterName
RodgeFu eec692e
merge from upstream/main
RodgeFu 3c93e16
Merge remote-tracking branch 'upstream/main' into vscode-telemetry
RodgeFu d890012
revert unnecessary change from merge
RodgeFu fa52faf
add basic telemetry for emit code
RodgeFu c020741
Merge remote-tracking branch 'upstream/main' into vscode-telemetry
RodgeFu c6738f5
add telemetry for preview and emit
RodgeFu e3d2e6e
add more telemetry and support delay
RodgeFu 7f4ccc4
Merge remote-tracking branch 'upstream/main' into vscode-telemetry
RodgeFu e3e3e74
remove flush which doesnt work
RodgeFu 967f05a
some update
RodgeFu 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- typespec-vscode | ||
--- | ||
|
||
Support telemetry |
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
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,37 @@ | ||
import fs from "fs"; | ||
import path from "path"; | ||
import { fileURLToPath } from "url"; | ||
|
||
const newKey = process.argv[2]; | ||
if (!newKey) { | ||
console.log("One argument for telemetry-key to use is expected. Exit without updating anything"); | ||
process.exit(1); | ||
} else { | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const targetPackageJsonFile = path.resolve(__dirname, "../package.json"); | ||
console.log(`Updating package.json at ${targetPackageJsonFile}`); | ||
const packageJson = JSON.parse(fs.readFileSync(targetPackageJsonFile, "utf8")); | ||
const oldKey = packageJson.telemetryKey ?? ""; | ||
const keyToString = (key) => | ||
`'${key.substring(0, 8)}...${key.substring(Math.max(0, key.length - 17))}'(length: ${key.length})`; | ||
|
||
console.log(`Updating telemetry key from ${keyToString(oldKey)} to ${keyToString(newKey)}`); | ||
packageJson.telemetryKey = newKey; | ||
|
||
fs.writeFileSync(targetPackageJsonFile, JSON.stringify(packageJson, null, 2)); | ||
|
||
// double verify the updated result | ||
const newPackageJson = JSON.parse(fs.readFileSync(targetPackageJsonFile, "utf8")); | ||
const updatedKey = newPackageJson.telemetryKey ?? ""; | ||
if (updatedKey !== newKey) { | ||
console.error( | ||
`Failed to update telemetry key in package.json. Actual = ${keyToString(updatedKey)}; Expected = ${keyToString(newKey)}`, | ||
); | ||
process.exit(2); | ||
} else { | ||
console.log( | ||
`telemetryKey in package.json updated to '${keyToString(updatedKey)}' successfully`, | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export const StartFileName = "main.tsp"; | ||
export const TspConfigFileName = "tspconfig.yaml"; | ||
export const EmptyGuid = "00000000-0000-0000-0000-000000000000"; |
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
Oops, something went wrong.
Oops, something went wrong.
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.