feat(telemetry): respect DO_NOT_TRACK opt-out#1517
Open
season179 wants to merge 1 commit into
Open
Conversation
Collaborator
📊 Automated PR Analysis
SummaryAdds support for the standard DO_NOT_TRACK environment variable as a telemetry opt-out mechanism, alongside the existing RTK_TELEMETRY_DISABLED=1 behavior. The implementation accepts '1' or 'true' (case-insensitive, whitespace-trimmed) and surfaces the active env override in Review Checklist
Linked issues: #1514 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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.
Summary
DO_NOT_TRACKenvironment variable as a telemetry opt-out.RTK_TELEMETRY_DISABLED=1behavior unchanged.rtk telemetry statusand document the new opt-out in telemetry docs.Fixes #1514
Behavior
Telemetry is now blocked when either of these environment variables is set:
RTK_TELEMETRY_DISABLED=1 DO_NOT_TRACK=true # also accepts DO_NOT_TRACK=1DO_NOT_TRACK=trueis case-insensitive and trims surrounding whitespace. Non-truthy values such asfalse,0,yes,no, and empty strings do not block telemetry.Test plan
rtk cargo +1.92.0 fmt --all -- --checkrtk cargo +1.92.0 clippy --all-targets(passes with pre-existing warnings in unrelated files)rtk cargo +1.92.0 test telemetry_env_overridertk git diff --checkDO_NOT_TRACK=1 rtk cargo +1.92.0 run --quiet -- telemetry statusreportsenv override: DO_NOT_TRACK (blocked)RTK_TELEMETRY_DISABLED=true rtk cargo +1.92.0 run --quiet -- telemetry statusdoes not report an env override, preserving the existing exact=1RTK-specific behaviorFull suite note
rtk cargo +1.92.0 testwas run, but the full suite fails in unrelated existing areas:cmds::cloud::curl_cmd::tests::{test_filter_curl_long_output_truncated,test_filter_curl_multibyte_boundary,test_filter_curl_exact_500_bytes}fail because the result no longer containsbytes total.core::trackingtests fail withunable to open database filewhile creating the tracker.The new telemetry env override tests pass independently.