Repository navigation
feat(ENG-15367): send the deprecated names a run used - #587
Closed
tigh-latte wants to merge 5 commits into
Closed
tigh-latte wants to merge 5 commits into
tigh-latte wants to merge 5 commits into
Conversation
… every run A hook on the root command records the command path, the flags and aliases used, where each setting came from, the login method and the API status, all from the Click context, so new commands and flags need no telemetry code. AliasGroup.main hands the run to the sender when it ends. Credential helper commands and login use the tracked command classes so their runs are recorded (or excluded) consistently. Grouped short options (-vS, -vPname) are split up as Click does, so a typed -S or -P always reaches the send rules. The reported env var is the first non-empty one, as Click uses, and a typed --help only counts as help when the run succeeded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- telemetry status: shows whether usage telemetry would send and why not. - telemetry id: shows the install ID. - telemetry reset: deletes the install ID. Our release, binary and image workflows set CLOUDSMITH_NO_TELEMETRY so smoke tests send nothing. AGENTS.md gets the rules for working on usage telemetry. telemetry status applies typed flags (-S) the same way the send rules do. The macOS clean-room smoke test passes CLOUDSMITH_NO_TELEMETRY explicitly, since env -i drops the workflow's value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A run gets persona "agent" when the environment shows an AI coding agent ran the command. Only markers that agents set for the commands they run are read (Claude Code, Codex CLI, Gemini CLI, Copilot, then AI_AGENT); markers that IDEs also set in a person's own terminal are ignored. A new "agent" property carries a name defined in code, never the variable's value, and unknown AI_AGENT values become "unidentified_agent". Agent wins the persona even in CI; ci and ci_provider stay as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A command declares what it may send with @telemetry.send(...) from cloudsmith_cli/cli/telemetry.py: NONE, ERRORS (Sentry reports only), USAGE (usage events only) or ALL, the default. A policy on a group applies to every command under it unless a command sets its own, and it only narrows what is sent: the opt-outs always win. This replaces the list of excluded command names in core/usage/run.py. Credential helpers, mcp start and the telemetry group use ERRORS, so they still report crashes and send no usage events, as before. A test lists every command that sends less than ALL, so a change of policy is always visible in review. CLOUDSMITH_TELEMETRY=log now covers error reports too: the scrubbed Sentry event is printed to stderr instead of being sent, even without a DSN. Before, log mode only showed usage events and error reports were still sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a `deprecated` list property: the deprecated commands, option spellings, environment variables and config.ini keys that the run used, as `<kind>:<name>` (for example `option:--org`, `env:CLOUDSMITH_API_PROXY`, `config:api_proxy`, `command:login`). It answers who still depends on a name before it is removed in 2.0.0. `deprecation.record` notes each name in the root ctx.meta. The warn_* helpers and the deprecated login command call it before they decide whether to print, so a suppressed warning (credential helpers, shell completion) is still recorded; those runs send no usage event anyway. Every name comes from the code: option spellings and env var names that the options declare, keys of CONFIG_KEY_REPLACEMENTS, and command names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tigh-latte
force-pushed
the
eng-15367-7-send-policy
branch
from
November 5, 2026 11:37
3986f10 to
5ea20dc
Compare
Collaborator
Author
|
Closing: we decided not to mark deprecations in the CLI's telemetry. Old names are already visible in the raw properties ( |
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 PR adds a
deprecatedproperty to the usage event. It lists the deprecated names that the run used, so we can see who still depends on a name before it is removed in 2.0.0.commandcommand:login,command:tokenlogincommandoptionoption:--org,option:--show-all,option:--tokendeprecation.warn_optionenvenv:CLOUDSMITH_ORG,env:CLOUDSMITH_API_PROXYdeprecation.warn_envvarconfigconfig:api_proxy,config:orgdeprecation.warn_config_keydeprecation.record(kind, name)adds<kind>:<name>to the rootctx.meta;collect_factsreads it withdeprecation.used(meta). Thewarn_*helpers call it before they decide whether to print, so a suppressed warning (credential helpers, shell completion) is still recorded. Those runs send no usage event anyway.CONFIG_KEY_REPLACEMENTS, and command names. Never a value from the user.cli/deprecation.py.AGENTS.mdsays so.The PostHog dashboard "CLI: Command and flag use" already has three insights on this property: the share of runs that used a deprecated name, a table of every deprecated name still in use (runs, human installs, CI and agent runs, newest version, last seen), and daily runs by persona.
Type of Change
Additional Notes
Since #574 the old spellings are hidden
deprecated_*options, soflagsandflags_typedalready show them by parameter name and spelling. They do not cover config.ini keys, the deprecatedauthflags or thelogincommand, which is why this PR adds one explicit property.