Skip to content

Send a random installation ID with usage reports (trace-client-java 0.6.0) - #58

Merged
dmccoystephenson merged 1 commit into
mainfrom
trace-install-id
Oct 3, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
trace-install-id

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Every usage report now carries a random per-installation ID as the tag install, so trace can count installations rather than events. The vendored trace client is re-vendored at trace-client-java 0.6.0 (package line kept).

  • Where the ID comes from: TRACE_INSTALL_ID when it is set and not blank (so an operator can pin one per deployment); otherwise Parpt's own per-user directory, ~/.config/parpt/trace-install-id, next to the existing notice marker (Parpt has no other settings file on disk). A new random UUID is written there the first time reporting runs and reused after that.
  • Opt-outs first: both values are only handed to the client's builder (installId(...) / installIdFile(...)), and the client resolves them after its own opt-out checks. When reporting is off (the program's own switch, TRACE_USAGE_REPORTING=off, DO_NOT_TRACK=1, or no key), no ID is made up and the file is neither read nor written. A file that cannot be read or written yields an in-memory ID for that run; startup never fails over it.
  • New helper: TraceInstallId (next to the vendored client) reads TRACE_INSTALL_ID and resolves the per-user data directory ($XDG_DATA_HOME or ~/.local/share on Linux/BSD, ~/Library/Application Support on macOS, %APPDATA% on Windows). It never touches the disk itself; here only its TRACE_INSTALL_ID reader and file-name constant are used, since the ID lives in the program's own directory.
  • First-run notice now mentions the installation ID and no longer says nothing about "this machine" is sent.
  • README: the usage-reporting section now says that the ID is sent, where it is stored, that deleting the file resets it, and that every opt-out stops it.
  • Tests: UsageReporterTest now expects the install tag (read back from the file) on project-created; a new test checks the file is written next to the marker only when enabled and reused on the next start; TraceInstallIdTest covers the helper.
  • Verified locally: ./gradlew build --no-daemon (JDK 21) — 144 tests, 0 failures.

🤖 Generated with Claude Code

https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL


drafted by Claude on behalf of Daniel Stephenson

….6.0)

Re-vendor the trace client at 0.6.0 and pass it TRACE_INSTALL_ID (when
set) and a per-user trace-install-id file, which the client resolves
after its opt-out checks, so every event carries the tag `install` and
trace can count installations rather than events. A disabled client
never makes up, reads or writes an ID. The README's usage-reporting
section says what the ID is, where it lives, and how to reset it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Test Results

144 tests  +3   144 ✅ +3   1s ⏱️ ±0s
 22 suites +1     0 💤 ±0 
 22 files   +1     0 ❌ ±0 

Results for commit 137867b. ± Comparison against base commit 151b2dd.

@dmccoystephenson
dmccoystephenson merged commit 3a6a92b into main Oct 3, 2026
3 checks passed
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.

1 participant