Repository navigation
Send a random installation ID with usage reports (trace-client-python 0.4.0) - #34
Merged
Merged
Conversation
… 0.4.0) Re-vendors trace-client-python at 0.4.0 and passes it a per-installation ID: TRACE_INSTALL_ID when set, otherwise a trace-install-id file the client creates (only when reporting is on). The README says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
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.
The vendored trace client is re-vendored at trace-client-python 0.4.0 (the released file, with the repo's existing vendoring note and import path kept; its upstream test suite is re-vendored with it). The program now passes a per-installation ID, so trace can count installations instead of raw events.
install, a random UUID. It is not derived from the machine, the user or an address; it only says "these events came from the same installation".trace-install-idunder the user data directory:$XDG_DATA_HOME/patchwork/(or~/.local/share/patchwork/) on Linux,~/Library/Application Support/patchwork/on macOS,%APPDATA%\patchwork\on Windows. Patchwork has no per-user data directory of its own (settings.jsonandenvironments.jsonare in the working directory), so the shared convention is used. Deleting the file resets the ID. Setting the environment variableTRACE_INSTALL_ID(non-blank) sends that value instead, which lets an operator pin an ID.TRACE_USAGE_REPORTING=off,DO_NOT_TRACK=1) never creates, reads or sends it. The standaloneinstall_id_from_filehelper is not called.installIdFile()inusage_reporting.pycomputes the path;buildClientpassesinstall_id=os.environ.get("TRACE_INSTALL_ID")andinstall_id_file=installIdFile(). The first-run notice now mentions the ID.py_compileof the listed modules, thenpython -m unittest discover -s tests) pass locally on Python 3.12: 122 tests OK.tests/test_usage_reporting.pynow points the user data dir into a temp dir for every test, expects theinstalltag, and covers the file being created and reused,TRACE_INSTALL_IDwinning, the per-platform paths, and no file under the settings and environment opt-outs.🤖 Generated with Claude Code
https://claude.ai/code/session_014ztkfamsbEqQfcu76me5SL
drafted by Claude on behalf of Daniel Stephenson