Skip to content

Add mapbox config set telemetry off - #47

Open
zmofei wants to merge 3 commits into
mainfrom
telemetry-config
Open

zmofei wants to merge 3 commits into
mainfrom
telemetry-config

Conversation

@zmofei

@zmofei zmofei commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Stacked on #46.

Adds mapbox config set telemetry off, which turns off the same things as MAPBOX_CLI_NO_TELEMETRY=1 (event, User-Agent markers, update notice) in every shell. mapbox doctor reports it as telemetry_persisted.

config.json is now read key by key, so one bad or unknown key no longer resets the opt-out. 0.3.0 still drops the key on config set; the CHANGELOG notes it.

Verified: tests, each checked by breaking the code. Not verified: Windows locally.

@zmofei
zmofei force-pushed the telemetry-config branch 6 times, most recently from 8e3914b to 70334bf Compare September 25, 2026 09:52
@zmofei
zmofei added this pull request to stack #60 September 28, 2026 12:18
@zmofei zmofei self-assigned this Sep 29, 2026
@zmofei
zmofei removed this pull request from stack #60 October 9, 2026 09:57
@zmofei
zmofei added this pull request to stack #88 October 9, 2026 09:57
@zmofei
zmofei force-pushed the telemetry-config branch 2 times, most recently from dd279a3 to 4643654 Compare October 9, 2026 10:20
@zmofei
zmofei removed this pull request from stack #88 October 9, 2026 11:34
@zmofei
zmofei added this pull request to stack #90 October 9, 2026 11:34
@zmofei
zmofei removed this pull request from stack #90 October 9, 2026 11:50
@zmofei
zmofei added this pull request to stack #92 October 9, 2026 11:50
@zmofei
zmofei removed this pull request from stack #92 October 9, 2026 14:33
@zmofei
zmofei added this pull request to stack #93 October 9, 2026 14:33
@zmofei
zmofei force-pushed the telemetry-config branch 5 times, most recently from 173bc1d to 20d2fe9 Compare October 9, 2026 15:30
@zmofei zmofei changed the title WIP: Add a persisted telemetry setting to mapbox config Add a persisted telemetry setting to mapbox config Oct 9, 2026
@zmofei
zmofei marked this pull request as ready for review October 9, 2026 15:49
@zmofei
zmofei requested a review from a team as a code owner October 9, 2026 15:49
@zmofei
zmofei removed this pull request from stack #93 October 9, 2026 15:50
@zmofei
zmofei added this pull request to stack #94 October 9, 2026 15:53
@zmofei zmofei changed the title Add a persisted telemetry setting to mapbox config Add mapbox config set telemetry off Oct 9, 2026
@zmofei
zmofei requested a review from mattpodwysocki October 9, 2026 16:05
mattpodwysocki
mattpodwysocki previously approved these changes Oct 9, 2026

@mattpodwysocki mattpodwysocki 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.

Verified the parts that matter most here rather than just reading the diff: ran the actual binary, confirmed mapbox config set telemetry off writes {"telemetry":false} to the real config.json and a fresh process reads it back, and that doctor reports telemetry_persisted/telemetry_allowed separately and correctly. Traced all three things it's supposed to gate, the event, the User-Agent markers, and the update-check, and confirmed each one actually checks the combined telemetry_allowed(), not just doctor's report of it. The key-by-key config.json parsing fix is real too: the old whole-struct Deserialize meant one bad key nulled everything, the new one isolates each key and keeps unknown ones on write, with tests that would catch a regression on either front.

The source_guards test stopping any other module from reading the env-only flag alone is a nice bit of insurance against exactly the bug class this PR is fixing.

Full suite, fmt, clippy all pass. Approving.

Base automatically changed from telemetry-events to main October 9, 2026 18:55
@zmofei
zmofei dismissed mattpodwysocki’s stale review October 9, 2026 18:55

The merge-base changed after approval.

zmofei and others added 3 commits October 9, 2026 21:55
mapbox config set telemetry off stops the run's telemetry event in every
shell, beside MAPBOX_CLI_NO_TELEMETRY for one. The setting is read again
at exit, so the run that turns it off does not report itself.
The two opt-outs now mean the same thing, one for a shell and one for
good: telemetry::telemetry_allowed reads both, so config set telemetry
off also strips the User-Agent markers and silences the update notice,
not only the event. mapbox doctor reports the setting as
telemetry_persisted, with the reason in its text lines, and the Privacy
section names it under How to Opt Out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants