Repository navigation
refactor(ENG-15367): share telemetry opt-outs and the exit wait budget - #568
Open
tigh-latte wants to merge 1 commit into
Open
tigh-latte wants to merge 1 commit into
tigh-latte wants to merge 1 commit into
Conversation
This was referenced Oct 29, 2026
Move the opt-out checks, build environment detection and the Cloudsmith host check out of the Sentry module into core/telemetry_common.py, so error reporting and usage telemetry follow the same rules. The update check now draws its end-of-run wait from a shared 1 second budget, so all background work together never delays a command's exit by more than 1 second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tigh-latte
force-pushed
the
eng-14331-1-shared-helpers
branch
from
November 3, 2026 13:58
e403d0d to
1ca6eeb
Compare
tigh-latte
marked this pull request as ready for review
November 4, 2026 10:15
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the shared telemetry helpers and exit-wait budget changes.
No open issues 🎉
What changed in this PR
Prepares shared infrastructure for the usage telemetry stack without enabling usage reporting. Sentry retains its existing behavior except for honoring opt-outs in CLOUDSMITH_CONFIG_FILE.
Changes:
- Extracts shared opt-out, configuration, environment, and host helpers.
- Makes the update check consume a shared one-second exit-wait budget.
- Adds helper and budget tests, with per-test budget resets.
| File | Description |
|---|---|
cloudsmith_cli/core/update_check.py |
Uses the shared budget when waiting for background work. |
cloudsmith_cli/core/tests/test_update_check.py |
Tests update-check consumption of the shared budget. |
cloudsmith_cli/core/tests/test_telemetry_common.py |
Tests host checks, re-exports, configuration handling, and budget behavior. |
cloudsmith_cli/core/telemetry.py |
Imports and re-exports the extracted shared helpers. |
cloudsmith_cli/core/telemetry_common.py |
Defines shared telemetry helpers and the exit-wait budget. |
cloudsmith_cli/conftest.py |
Isolates configuration environment settings and resets the budget between tests. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This stack adds pseudonymous usage telemetry to the CLI. Each run sends one
cli command executedevent to PostHog, so we can see which commands, flags and setups are actually used before we change or remove them. The code ships without a project key. A build only sends when a developer points it at a test project.This first PR only moves shared code. The opt-out checks, build environment detection and the Cloudsmith host check move out of the Sentry module into
core/telemetry_common.py, so error reporting and usage telemetry follow one set of rules.Behaviour changes
telemetry = falsenow also reads the file named byCLOUDSMITH_CONFIG_FILE, like the rest of the CLI. Before,telemetry = falsein that file did not turn Sentry off.Sentry and PostHog once the full stack is in
DO_NOT_TRACK,CLOUDSMITH_NO_TELEMETRY,telemetry = falsemcp start,telemetry, shell completion, non-Cloudsmith API hosts, SSL verification off, development builds without a test keyThe stack
cloudsmith telemetry status / id / reset@telemetry.send) and log mode for error reportsType of Change
Additional Notes
N/A: nothing calls the moved helpers in a new way until #569 onwards.
🤖 Generated with Claude Code