Skip to content
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

Respect VSCode's telemetry setting #10934

Closed
PeterJCLaw opened this issue Jul 26, 2022 · 4 comments · Fixed by #10986
Closed

Respect VSCode's telemetry setting #10934

PeterJCLaw opened this issue Jul 26, 2022 · 4 comments · Fixed by #10986
Assignees
Labels
debt Code quality issues
Milestone

Comments

@PeterJCLaw
Copy link

PeterJCLaw commented Jul 26, 2022

Environment data

  • VS Code version: 1.69.2
  • Jupyter Extension version (available under the Extensions sidebar): v2022.6.1201981810
  • OS (Windows | Mac | Linux distro) and version: Ubuntu 20.04 LTS

Expected behaviour

When VSCode's telemetry preference is set to a restricted value (e.g: off, crash) the extension should not query for or send telemetry.

Actual behaviour

I observed lines such as printenv > /tmp/tmp-45935fdNhOTkd5hRYtxt in my shell history and via https://twitter.com/ferrouswheel/status/1551353490949017600 traced this to having (hopefully!) come from this extension

switch (this.shellDetector.identifyTerminalShell(terminal)) {
case TerminalShellType.powershellCore:
case TerminalShellType.powershell:
command = `Get-ChildItem Env: | Select Name | Export-Csv -Path ${filePath.fileToCommandArgument()} -NoTypeInformation`;
break;
case TerminalShellType.commandPrompt:
command = `set > ${filePath.fileToCommandArgument()}`;
break;
default:
command = `printenv > ${filePath.fileToCommandArgument()}`;
break;
}

I have telemetry.telemetryLevel set to off on the machine where this was observed.

Ideally the extension should not gather telemetry data outside the enabled telemetry remit.

@PeterJCLaw PeterJCLaw added the bug Issue identified by VS Code Team member as probable bug label Jul 26, 2022
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jul 26, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Jul 26, 2022

Thanks for the issue.

The data may be gathered but the way the code is setup, it isn't sent. Turning telemetry off doesn't affect the internal behavior of the extension, it merely prevents the data from being sent anywhere.

We use this npm module to send our telemetry. It determines if the telemetry data is sent or not:
https://github.com/microsoft/vscode-extension-telemetry/blob/5d778578cb8484d3336549f2b6b667fa9f0411b1/src/common/baseTelemetryReporter.ts#L301

@r3m0t
Copy link
Contributor

r3m0t commented Jul 27, 2022

It isn't telemetry, it's used in the code to launch your Jupyter kernels and Jupyter server.

const vars = await this.envVarsProvider.getEnvironmentVariables(undefined, 'RunPythonCode');

specModel.env = await this.kernelEnvVars.getEnvironmentVariables(resource, interpreter, specedKernel);

@rchiodo
Copy link
Contributor

rchiodo commented Jul 27, 2022

Those are not the same 'getEnvironmentVariables' calls. The one adding to the shell history is only used in our jupyter install telemetry.

@rebornix rebornix assigned DonJayamanne and unassigned rchiodo Jul 28, 2022
@rebornix rebornix added debt Code quality issues and removed bug Issue identified by VS Code Team member as probable bug triage-needed Issue needs to be triaged labels Jul 28, 2022
@DonJayamanne DonJayamanne added this to the August 2022 milestone Jul 31, 2022
@DonJayamanne
Copy link
Contributor

Closing as a duplicate of #10935

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants