Skip to content

Conversation

lramos15
Copy link
Member

Adds a --telemetry command to the VS Code CLI which dumps all the the telemetry events which VS Code collects.

@lramos15 lramos15 requested a review from sbatten June 24, 2019 16:38
@lramos15 lramos15 self-assigned this Jun 24, 2019
@sbatten sbatten requested a review from joaomoreno June 24, 2019 22:08
@sbatten
Copy link
Member

sbatten commented Jun 24, 2019

@joaomoreno please review the build pipeline changes.

@sbatten sbatten self-requested a review June 24, 2019 23:05
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reduce duplication by deferring to script(s) in ./build/azure-pipelines?

Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, feel free to defer the code duplication if you're sure it's good.

@lramos15
Copy link
Member Author

Deferring to scripts is good but I won't have adequate testing in time for it to get into the June milestone, so I will look into it for the July one as I know this works and don't want to break anything

@joaomoreno
Copy link
Member

joaomoreno commented Jun 25, 2019

@lramos15 @Tyriar @sbatten I have a few questions:

  1. Why does this need to be run per platform? This is important given that we want to reduce the amount of platform-specific work for improving the build perf: Improve build perf #75983.
  2. If this works by parsing GDPR formatted contents, why do we need to run Code at all to spit out information? Why isn't this just done statically against our sources?
  3. If code --telemetry spits out all the information, what's the purpose of https://github.com/microsoft/vscode-telemetry-extractor?
  4. Why are we cloning https://github.com/microsoft/vscode-telemetry-extractor instead of publishing that as a package to npm and using a specific version of that in our devDependencies? We want to always have reproducible builds... and currently builds will always get master from that repo, voiding this contract.

node ./out/cli-extract-extensions.js --sourceDir ./src/telemetry-sources/ --outputDir . --applyEndpoints --includeIsMeasurement
mv declarations-resolved.json ../s/src/telemetry-core.json
mv declarations-extensions-resolved.json ../s/src/telemetry-extensions.json
echo 'Moved Files'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should just be removed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Darwin doesn't need a specific build script?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean the echo. 👍

mergeTelemetry(contents, 'vscode-extensions');
return JSON.stringify(mergedTelemetry, null, 4);
} catch (err) {
return 'Unable to read VS Code telemetry events!';
Copy link
Member

@joaomoreno joaomoreno Jun 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove the whole try catch block and let the actual error bubble up and be printed to the console.

@joaomoreno
Copy link
Member

I've talked to @kieferrm about this and he helped me understand this better. Answering my own questions:

  1. This is not platform specific. If we go along with Improve build perf #75983 this won't be a problem.
  2. I got the flow wrong. This is statically computed. Code spitting out telemetry IS the feature this PR implements.
  3. Understood.

I'd still highly recommend publishing https://github.com/microsoft/vscode-telemetry-extractor to NPM and locking it in our yarn.lock file.

@lramos15
Copy link
Member Author

Yeah sorry for not explaining it well. Ideally we would only compute this once and copy it somehow to all the platforms, but since each platform is run in parallel I wasn't sure how to accomplish that. You are correct that it should be an NPM package, but the telemetry extractor is not open source yet so the plan was to hold off on releasing an NPM package until the tool was open sourced.

@joaomoreno
Copy link
Member

You are correct that it should be an NPM package, but the telemetry extractor is not open source yet so the plan was to hold off on releasing an NPM package until the tool was open sourced.

Then let's lock the clone to a specific commit ID for now.

@joaomoreno joaomoreno added this to the June 2019 milestone Jun 27, 2019
@joaomoreno joaomoreno added vscode-build VS Code build process issues engineering VS Code - Build / issue tracking / etc. labels Jun 27, 2019
@@ -13,6 +13,7 @@ export interface ParsedArgs {
_urls?: string[];
help?: boolean;
version?: boolean;
telemetry?: boolean;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lramos15 shouldn't break anything but missed this arg when removing the command

@@ -62,6 +62,8 @@ const vscodeResources = [
'out-build/bootstrap-amd.js',
'out-build/bootstrap-window.js',
'out-build/paths.js',
'out-build/telemetry-core.json',
'out-build/telemetry-extensions.json',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lramos15 I noticed this code isn't in master anymore but it wasn't removed during the PR to remove the command. What happened to it?

@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc. vscode-build VS Code build process issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants