telemetry: honor the DO_NOT_TRACK env var - #986
Conversation
There was a problem hiding this comment.
Important
The new external reference points users to a hijacked, spam-laden domain and should be replaced before merging.
Reviewed changes the telemetry opt-out implementation, its unit coverage, and every related documentation and release-note update.
- Environment opt-out: extracts environment checks into
checkIsOptedOutViaEnvand addsDO_NOT_TRACKalongside the existing Varlock and legacy variables. - Regression coverage: exercises canonical and accepted values for
DO_NOT_TRACK, plus unchanged behavior forVARLOCK_TELEMETRY_DISABLEDandPH_OPT_OUT. - User guidance: updates CLI help, the telemetry guide, CLI reference, and patch changeset for the new opt-out variable.
azure/gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes since the prior Pullfrog review, covering the documentation fix for the unsafe external reference.
- Archived proposal: Replaced the lapsed live-domain link with a verified Wayback snapshot in the telemetry guide.
- Source guidance: Updated the telemetry helper JSDoc to reference the same archived proposal and explain why the live domain is not used.
azure/gpt-5.6-sol | 𝕏
|
Seems reasonable. Thanks for the contribution! (And everything else) |
commit: |
DO_NOT_TRACK is an informal convention many CLI tools follow (Homebrew, Deno, Turborepo, Netlify CLI, Astro): when the variable is set, the tool skips sending analytics, so one setting opts out of every tool that supports it. varlock now honors it alongside VARLOCK_TELEMETRY_DISABLED, accepting the same true-ish values. The convention is linked at https://donottrack.sh/ (suggested in review by @philmillman).
philmillman
left a comment
There was a problem hiding this comment.
github seems to be having a major incident. this looks good to me, we'll wait to merge until the next release so the docs are in sync. thanks again @jdalton !

Thanks for varlock. The schema-driven approach to environment variables has been really useful.
DO_NOT_TRACKis an informal convention that a lot of command line tools follow (Homebrew, Deno, Turborepo, Netlify CLI, Astro): the tool checks theDO_NOT_TRACKenvironment variable, and skips sending analytics when it is set. The point is that someone can set it once and opt out of every tool that honors it, instead of learning a different variable for each one. Homebrew, Deno, Turborepo, Netlify CLI and Astro all honor it today. varlock already hasVARLOCK_TELEMETRY_DISABLED, a legacyPH_OPT_OUT, and config file flags, so this adds the standard variable next to them.The change is in one function,
checkIsOptedOut()inpackages/varlock/src/cli/helpers/telemetry.ts. I pulled its environment variable check into a small exported helper so it could be unit tested without touching the real user config file, then addedDO_NOT_TRACKthere. The canonical value is1, but it is parsed with the sameTRUE_ENV_VAR_VALUESlist the existing variable uses, sotrueandtwork too. Tests cover each branch:DO_NOT_TRACK=1opts out,0or unset orfalsedoes not, and the existing variables still behave the same. Docs are updated in the telemetry guide, the CLI reference, and thevarlock telemetrycommand help.📔
PH_OPT_OUTstill matches only the exact stringtrue, which is its existing behavior, and a test now asserts that so the legacy semantics do not drift.