Skip to content

Commit cd5432f

Browse files
authored
Set telemetry options with CLI (#395)
* Set telemetry options with CLI * Updated the build process to reflect recent urgent file moves * Review findings, build failures, and tests * More workarounds for alexferl/vyper#71 * Slight improvement for code coverage
1 parent d8af3ba commit cd5432f

File tree

35 files changed

+540
-69
lines changed

35 files changed

+540
-69
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ jobs:
5252
. ~/.bashrc
5353
. ~/.bash_profile
5454
mamba activate env-build
55-
cp .github/LICENSE.txt .github/apache20.svg partcad
55+
cp LICENSE.txt apache20.svg partcad
5656
(cd partcad && python -m build)
5757
mamba deactivate
5858
5959
mamba activate env-build-cli
60-
cp .github/LICENSE.txt .github/apache20.svg README.md partcad-cli
60+
cp LICENSE.txt apache20.svg README.md partcad-cli
6161
python -m pip install -r partcad/requirements.txt
6262
python -m pip install --no-index --find-links=partcad/dist partcad
6363
(cd partcad-cli && python -m build)

.vscode/launch.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"compounds": [
88
// {
99
// "name": "Debug: PartCAD Development",
10-
// "configurations": ["Debug: partcad status", "Debug: partcad init", "Debug: partcad add --help"]
10+
// "configurations": ["Debug: partcad system status", "Debug: partcad init", "Debug: partcad add --help"]
1111
// },
1212
// {
1313
// "name": "Debug: PartCAD Testing",
@@ -19,7 +19,7 @@
1919
// },
2020
// {
2121
// "name": "Debug: PartCAD Full Suite",
22-
// "configurations": ["Debug: partcad status", "Debug: partcad init"]
22+
// "configurations": ["Debug: partcad system status", "Debug: partcad init"]
2323
// },
2424
// {
2525
// "name": "Debug: PartCAD Testing",
@@ -186,12 +186,12 @@
186186
}
187187
},
188188
{
189-
"name": "Debug: partcad status",
189+
"name": "Debug: partcad system status",
190190
"type": "debugpy",
191191
"request": "launch",
192192
"program": "partcad-cli/src/partcad_cli/click/command.py",
193193
"args": [
194-
"status"
194+
"system status"
195195
],
196196
"console": "integratedTerminal",
197197
"cwd": "${workspaceFolder}",

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"nlopt",
8080
"NOCOMMIT",
8181
"nptyping",
82+
"ollama",
8283
"openscad",
8384
"packagecloud",
8485
"partcad",

docs/source/features.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ Alternatively, you can disable telemetry by setting the following environment va
202202
203203
PC_TELEMETRY_TYPE="none"
204204
205+
You can also change telemetry settings using CLI:
206+
207+
.. code-block:: bash
208+
209+
pc system set telemetry type none
210+
# or, if you want to collect data about PartCAD performance in your organization:
211+
pc system set telemetry type sentry
212+
pc system set telemetry env <you-org-name>
213+
pc system set telemetry sentryDsn <your-sentry-dsn>
214+
205215
Private Repositories
206216
--------------------
207217

docs/source/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ If necessary, PartCAD tools are automatically retrieving the contents of this
9999
repository and all other required repositories and packages. No manual action is needed is need to `install` it.
100100

101101
However, if you suspect that something is wrong with locally cached files,
102-
use ``pc status`` to investigate and to determine the location of the cached files.
102+
use ``pc system status`` to investigate and to determine the location of the cached files.

docs/source/troubleshooting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ configuration, model declarations and definitions.
1212
Status
1313
------
1414

15-
The status of PartCAD context can be evaluated using the ``status`` command.
15+
The status of PartCAD context can be evaluated using the ``system status`` command.
1616

1717
.. code-block:: shell
1818
19-
pc status
19+
pc system status
2020
2121
Pay attention to any exception or error message produced by the
2222
``status`` command.

docs/source/tutorial.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ PartCAD maintains an internal state to keep track of dependencies of a project.
223223

224224
.. code-block:: shell
225225
226-
pc reset
226+
pc system reset
227227
228228
=================
229229
VS Code Extension

features/config.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Feature: `pc config` command
5959
And environment variable "PC_CACHE_MEMORY_DOUBLE_CACHE_MAX_ENTRY_SIZE" is set to "101"
6060
And environment variable "PC_CACHE_DEPENDENCIES_IGNORE" is set to "true"
6161
And environment variable "PC_TELEMETRY_TYPE" is set to "sentry"
62-
And environment variable "PC_TELEMETRY_PERFORMANCE" is set to "true"
62+
And environment variable "PC_TELEMETRY_PERFORMANCE" is set to "false"
6363
And environment variable "PC_TELEMETRY_FAILURES" is set to "true"
6464
And environment variable "PC_TELEMETRY_DEBUG" is set to "false"
6565
And environment variable "PC_TELEMETRY_SENTRY_SHUTDOWN_TIMEOUT" is set to "11"
@@ -84,7 +84,7 @@ Feature: `pc config` command
8484
And STDOUT should contain "cache_memory_double_cache_max_entry_size: 101"
8585
And STDOUT should contain "cache_dependencies_ignore: True"
8686
And STDOUT should contain "'type': 'sentry'"
87-
And STDOUT should contain "'performance': True"
87+
And STDOUT should contain "'performance': False"
8888
And STDOUT should contain "'failures': True"
8989
And STDOUT should contain "'debug': False"
9090
And STDOUT should contain "'sentry_shutdown_timeout': 11"
@@ -172,7 +172,7 @@ Feature: `pc config` command
172172
sentryAttachStacktrace: true
173173
sentryTracesSampleRate: 0.43
174174
"""
175-
When I run "pc --threads-max=1111 --ollama-num-thread=2222 --max-script-correction=3333 --max-model-generation=4444 --max-geometric-modeling=5555 --openai-api-key=abcdef12345 --google-api-key=fedcba54321 --internal-state-dir=/tmp/sandbox/home/.partcad --python-sandbox=pypy --force-update --cache --cache-max-entry-size=102 --cache-min-entry-size=12 --cache-memory-max-entry-size=102 --cache-memory-double-cache-max-entry-size=102 --cache-dependencies-ignore --telemetry-debug --telemetry-sentry-traces-sample-rate=0.35 --telemetry-sentry-attach-stacktrace=no --telemetry-sentry-shutdown-timeout=44 config"
175+
When I run "pc --threads-max=1111 --ollama-num-thread=2222 --max-script-correction=3333 --max-model-generation=4444 --max-geometric-modeling=5555 --openai-api-key=abcdef12345 --google-api-key=fedcba54321 --internal-state-dir=/tmp/sandbox/home/.partcad --python-sandbox=pypy --force-update --cache --cache-max-entry-size=102 --cache-min-entry-size=12 --cache-memory-max-entry-size=102 --cache-memory-double-cache-max-entry-size=102 --cache-dependencies-ignore --telemetry-type=sentry --telemetry-debug --telemetry-sentry-traces-sample-rate=0.35 --telemetry-sentry-attach-stacktrace=no --telemetry-sentry-shutdown-timeout=44 config"
176176
Then the command should exit with a status code of "0"
177177
And STDOUT should contain "threads_max: 1111"
178178
And STDOUT should contain "ollama_num_thread: 2222"

features/docs.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Feature: `pc render` command
147147
Then the command should exit with a status code of "0"
148148
When I run "pc --help"
149149
Then the command should exit with a status code of "0"
150-
When I run "pc status"
150+
When I run "pc system status"
151151
Then the command should exit with a status code of "0"
152152

153153
# TODO: Failure to pip install from GH repo

features/pc.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Feature: `pc` command
2929
@pc-verbose @pc-status
3030
Scenario: Show DEBUG messages with increased verbosity
3131
Given environment variable "PC_NO_ANSI" is set to "1"
32-
When I run "pc -v status"
32+
When I run "pc -v system status"
3333
Then the command should exit with a status code of "0"
3434
# TODO-62: @alexanderilyin: check that DEBUG prefix is present
3535
And STDERR should contain "PartCAD version:"
@@ -42,7 +42,7 @@ Feature: `pc` command
4242

4343
@pc-quiet @pc-status
4444
Scenario: Do not show INFO messages with decreased verbosity
45-
When I run "pc --no-ansi -q status"
45+
When I run "pc --no-ansi -q system status"
4646
Then the command should exit with a status code of "0"
4747
And STDOUT should not contain "INFO:partcad:PartCAD version:"
4848
And STDOUT should not contain "INFO:partcad:Internal data storage location:" with path
@@ -54,7 +54,7 @@ Feature: `pc` command
5454

5555
@pc-no-ansi @pc-status
5656
Scenario: Do not show ANSI codes
57-
When I run "pc --no-ansi status"
57+
When I run "pc --no-ansi system status"
5858
Then the command should exit with a status code of "0"
5959
And STDERR should contain "INFO:partcad:PartCAD version:"
6060
And STDERR should contain "INFO:partcad:Internal data storage location:" with path

0 commit comments

Comments
 (0)