From bf5294ce2359f0d9f0abe38e6cda75f103ac02c3 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Wed, 30 Oct 2024 13:31:02 -0500 Subject: [PATCH 1/6] Add Setting to disable telemetry This adds a new `enableTelemetry` boolean jupyterlab setting that is checked before sending a prompt acceptance post. This new flag is enabled by default. --- schema/plugin.json | 6 ++++++ src/index.ts | 13 +++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/schema/plugin.json b/schema/plugin.json index d94c99b..3dcc446 100644 --- a/schema/plugin.json +++ b/schema/plugin.json @@ -26,6 +26,12 @@ "description": "Whether to fetch completions for QiskitCodeAssistant:completer", "type": "boolean", "default": true + }, + "enableTelemetry": { + "title": "Enable Telemetry", + "description": "Send telemetry to the The Qiskit Code Assistant Service", + "type": "boolean", + "default": true } }, "additionalProperties": false diff --git a/src/index.ts b/src/index.ts index 93274bd..2035359 100644 --- a/src/index.ts +++ b/src/index.ts @@ -96,12 +96,17 @@ const plugin: JupyterFrontEndPlugin = { category: 'Qiskit Code Assistant' }); - completionProviderManager.selected.connect((completer, selection) => - provider.accept(selection.insertText) - ); + completionProviderManager.selected.connect((completer, selection) => { + if (settings.composite['enableTelemetry'] as boolean) { + provider.accept(selection.insertText) + } + }); app.commands.commandExecuted.connect((registry, executed) => { - if (executed.id === CommandIDs.acceptInline) { + if ( + executed.id === CommandIDs.acceptInline && + settings.composite['enableTelemetry'] as boolean + ) { inlineProvider.accept(); } }); From 96a15986e643be9c1a96f97640c875b83024f353 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Thu, 31 Oct 2024 21:01:46 -0500 Subject: [PATCH 2/6] update docs --- GETTING_STARTED.md | 2 ++ README-PyPi.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 8d003f8..cabb6e6 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -116,6 +116,8 @@ There are a few settings we recommend to edit in your user settings. 4. Keyboard shortcuts can be changed by searching for `completer` in the Keyboard Shortcuts settings and adding new shortcuts for the relevant commands. +5. Telemetry can be disabled by unselecting the `enableTelemetry` setting. + ## Troubleshooting If you are seeing the frontend extension, but it is not working, check that the server diff --git a/README-PyPi.md b/README-PyPi.md index 44646c4..a437b7c 100644 --- a/README-PyPi.md +++ b/README-PyPi.md @@ -122,6 +122,8 @@ There are a few settings we recommend to edit in your user settings. 4. Keyboard shortcuts can be changed by searching for `completer` in the Keyboard Shortcuts settings and adding new shortcuts for the relevant commands. +5. Telemetry can be disabled by unselecting the `enableTelemetry` setting. + ## Terms of use - [End User License Agreement (EULA)](/~https://github.com/Qiskit/qiskit-code-assistant-jupyterlab/blob/main/docs/EULA.md) acceptance required before starting to use the model acceptance required before starting to use the model From 1ea09f8d2bbc9534d164089978d6d63ff66de925 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Thu, 31 Oct 2024 21:05:03 -0500 Subject: [PATCH 3/6] fix lint errors --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2035359..ea6dec4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -98,14 +98,14 @@ const plugin: JupyterFrontEndPlugin = { completionProviderManager.selected.connect((completer, selection) => { if (settings.composite['enableTelemetry'] as boolean) { - provider.accept(selection.insertText) + provider.accept(selection.insertText); } }); app.commands.commandExecuted.connect((registry, executed) => { if ( executed.id === CommandIDs.acceptInline && - settings.composite['enableTelemetry'] as boolean + (settings.composite['enableTelemetry'] as boolean) ) { inlineProvider.accept(); } From c19ef19881394687ef77cfbc507fb8879fa1f5e0 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Mon, 4 Nov 2024 08:28:22 -0600 Subject: [PATCH 4/6] address review --- GETTING_STARTED.md | 2 +- README-PyPi.md | 2 +- schema/plugin.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index cabb6e6..d593131 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -116,7 +116,7 @@ There are a few settings we recommend to edit in your user settings. 4. Keyboard shortcuts can be changed by searching for `completer` in the Keyboard Shortcuts settings and adding new shortcuts for the relevant commands. -5. Telemetry can be disabled by unselecting the `enableTelemetry` setting. +5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. ## Troubleshooting diff --git a/README-PyPi.md b/README-PyPi.md index a437b7c..cd33e0f 100644 --- a/README-PyPi.md +++ b/README-PyPi.md @@ -122,7 +122,7 @@ There are a few settings we recommend to edit in your user settings. 4. Keyboard shortcuts can be changed by searching for `completer` in the Keyboard Shortcuts settings and adding new shortcuts for the relevant commands. -5. Telemetry can be disabled by unselecting the `enableTelemetry` setting. +5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. ## Terms of use diff --git a/schema/plugin.json b/schema/plugin.json index 3dcc446..b6400e2 100644 --- a/schema/plugin.json +++ b/schema/plugin.json @@ -29,7 +29,7 @@ }, "enableTelemetry": { "title": "Enable Telemetry", - "description": "Send telemetry to the The Qiskit Code Assistant Service", + "description": "Send telemetry to the Qiskit Code Assistant Service", "type": "boolean", "default": true } From 7277090e4565c42826637eb4ef5d6edf7f075993 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Tue, 5 Nov 2024 11:45:43 -0600 Subject: [PATCH 5/6] update docs --- GETTING_STARTED.md | 3 +++ README-PyPi.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index d593131..04f9a58 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -118,6 +118,9 @@ There are a few settings we recommend to edit in your user settings. 5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. + > **NOTE**: The telemetry does not collect your code nor the suggested code completions. + What is collected is whether a code suggestion was accepted or dismissed. + ## Troubleshooting If you are seeing the frontend extension, but it is not working, check that the server diff --git a/README-PyPi.md b/README-PyPi.md index cd33e0f..bacad2e 100644 --- a/README-PyPi.md +++ b/README-PyPi.md @@ -124,6 +124,9 @@ There are a few settings we recommend to edit in your user settings. 5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. + > **NOTE**: The telemetry does not collect your code nor the suggested code completions. + What is collected is whether a code suggestion was accepted or dismissed. + ## Terms of use - [End User License Agreement (EULA)](/~https://github.com/Qiskit/qiskit-code-assistant-jupyterlab/blob/main/docs/EULA.md) acceptance required before starting to use the model acceptance required before starting to use the model From d086c8201c03dc612b00ad2b63e2004e2398b764 Mon Sep 17 00:00:00 2001 From: Alex Bozarth Date: Tue, 5 Nov 2024 11:49:01 -0600 Subject: [PATCH 6/6] fix lint --- GETTING_STARTED.md | 4 ++-- README-PyPi.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GETTING_STARTED.md b/GETTING_STARTED.md index 04f9a58..32f87f4 100644 --- a/GETTING_STARTED.md +++ b/GETTING_STARTED.md @@ -118,8 +118,8 @@ There are a few settings we recommend to edit in your user settings. 5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. - > **NOTE**: The telemetry does not collect your code nor the suggested code completions. - What is collected is whether a code suggestion was accepted or dismissed. + > **NOTE**: The telemetry does not collect your code nor the suggested code completions. + > What is collected is whether a code suggestion was accepted or dismissed. ## Troubleshooting diff --git a/README-PyPi.md b/README-PyPi.md index bacad2e..96e0635 100644 --- a/README-PyPi.md +++ b/README-PyPi.md @@ -124,8 +124,8 @@ There are a few settings we recommend to edit in your user settings. 5. Telemetry can be disabled by unchecking the `enableTelemetry` setting. - > **NOTE**: The telemetry does not collect your code nor the suggested code completions. - What is collected is whether a code suggestion was accepted or dismissed. + > **NOTE**: The telemetry does not collect your code nor the suggested code completions. + > What is collected is whether a code suggestion was accepted or dismissed. ## Terms of use