Skip to content

telemetry: honor the DO_NOT_TRACK env var - #986

Merged
theoephraim merged 1 commit into
dmno-dev:mainfrom
jdalton:dnt-opt-out
Aug 7, 2026
Merged

telemetry: honor the DO_NOT_TRACK env var#986
theoephraim merged 1 commit into
dmno-dev:mainfrom
jdalton:dnt-opt-out

Conversation

@jdalton

@jdalton jdalton commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Thanks for varlock. The schema-driven approach to environment variables has been really useful.

DO_NOT_TRACK is an informal convention that a lot of command line tools follow (Homebrew, Deno, Turborepo, Netlify CLI, Astro): the tool checks the DO_NOT_TRACK environment 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 has VARLOCK_TELEMETRY_DISABLED, a legacy PH_OPT_OUT, and config file flags, so this adds the standard variable next to them.

The change is in one function, checkIsOptedOut() in packages/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 added DO_NOT_TRACK there. The canonical value is 1, but it is parsed with the same TRUE_ENV_VAR_VALUES list the existing variable uses, so true and t work too. Tests cover each branch: DO_NOT_TRACK=1 opts out, 0 or unset or false does not, and the existing variables still behave the same. Docs are updated in the telemetry guide, the CLI reference, and the varlock telemetry command help.

📔 PH_OPT_OUT still matches only the exact string true, which is its existing behavior, and a test now asserts that so the legacy semantics do not drift.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 checkIsOptedOutViaEnv and adds DO_NOT_TRACK alongside the existing Varlock and legacy variables.
  • Regression coverage: exercises canonical and accepted values for DO_NOT_TRACK, plus unchanged behavior for VARLOCK_TELEMETRY_DISABLED and PH_OPT_OUT.
  • User guidance: updates CLI help, the telemetry guide, CLI reference, and patch changeset for the new opt-out variable.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using azure/gpt-5.6-sol𝕏

Comment thread packages/varlock-website/src/content/docs/guides/telemetry.mdx Outdated

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

Pullfrog  | View workflow run | Using azure/gpt-5.6-sol𝕏

@theoephraim

Copy link
Copy Markdown
Member

Seems reasonable. Thanks for the contribution! (And everything else)

@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/varlock@986

commit: dfa6652

Comment thread packages/varlock-website/src/content/docs/guides/telemetry.mdx Outdated
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 philmillman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 !

@theoephraim
theoephraim merged commit 1295e66 into dmno-dev:main Aug 7, 2026
21 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants