Skip to content

Conversation

@paulacamargo25
Copy link

Closed #20941

  • Add enableTelemetry in package.json
  • Add function that updates the 'enableTelemetry' value in package.json
  • Update release pipelines

@paulacamargo25 paulacamargo25 self-assigned this Jun 6, 2023
@paulacamargo25 paulacamargo25 added area-debugging debt Covers everything internal: CI, testing, refactoring of the codebase, etc. skip package*.json package.json and package-lock.json don't both need updating and removed area-debugging labels Jun 6, 2023
* @returns {boolean}
*/
export function isTelemetryDisabled(workspaceService: IWorkspaceService): boolean {
const settings = workspaceService.getConfiguration('telemetry').inspect<boolean>('enableTelemetry')!;
Copy link
Member

Choose a reason for hiding this comment

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

Are we removing this setting?

Copy link
Author

Choose a reason for hiding this comment

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

I checked the code and we don't use that function anywhere.

@paulacamargo25 paulacamargo25 merged commit 3e5af44 into microsoft:main Jun 8, 2023
@paulacamargo25 paulacamargo25 deleted the 20941-Dont-sent-telemetry-in-forks branch June 8, 2023 20:59
Comment on lines +48 to +51
export function isTelemetryDisabled(): boolean {
const packageJsonPath = path.join(EXTENSION_ROOT_DIR, 'package.json');
const packageJson = fs.readJSONSync(packageJsonPath);
return !packageJson.enableTelemetry;

Choose a reason for hiding this comment

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

File I/O is expensive for this check, this is being done every time a telemetry is sent. See #22991.

Can we do this using setting instead of package.json? @paulacamargo25 @karthiknadig

Copy link
Member

Choose a reason for hiding this comment

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

you should have access to package json as a part of the extension API.

		/**
		 * The parsed contents of the extension's package.json.
		 */
		readonly packageJSON: any;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debt Covers everything internal: CI, testing, refactoring of the codebase, etc. skip package*.json package.json and package-lock.json don't both need updating

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't send telemetry in forks

3 participants