Skip to content
This repository was archived by the owner on Nov 20, 2026. It is now read-only.

fix: keep usage reporting off once it is turned off - #72

Merged
dmccoystephenson merged 1 commit into
mainfrom
fix/opt-out-fails-closed
Nov 19, 2026
Merged

dmccoystephenson merged 1 commit into
mainfrom
fix/opt-out-fails-closed

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Usage reporting is made to stay off once it has been turned off, in the vendored client and in patchwork's own settings handling.

Changes

  • The vendored trace client is updated from trace-client-python 0.4.1 to 0.5.0 (Make every opt-out fail closed (0.5.0) Stephenson-Software/trace-client-python#45), in which every opt-out fails closed: TRACE_USAGE_REPORTING set to anything but blank/true/on/yes/1, or DO_NOT_TRACK set to anything but blank/0/false/off/no, turns reporting off. The vendored test suite is updated to match (the two package-layout tests, which read pyproject.toml and the package __init__, are left out because a single vendored module has neither).
  • Fail-open paths fixed in usage_reporting.py (each was pinned by a characterization test, now rewritten):
    • enabled was read with bool(), so "enabled": "false" or "off" reported. It is now read with the client's allows_reporting().
    • "usage_reporting": false (or any non-object) was overwritten with the default block, i.e. turned back on, and the on-notice shown again. It is now read as the switch itself and the file is left alone.
    • A first run under an environment opt-out wrote "enabled": true, so a later run without the variable reported without the on-notice ever having been shown. It now writes "enabled": false, and the notice says so.
  • README opt-out section updated.

Tests

  • python -m unittest discover -s tests: 260 tests, OK.

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

Re-vendor trace-client-python 0.5.0 (every opt-out fails closed) and make
patchwork's own switch fail closed too:
- enabled is read with allows_reporting(), not bool(): "false"/"off" no longer report
- "usage_reporting": false (not an object) is read as the switch and no
  longer overwritten with the default block (on)
- a first run under TRACE_USAGE_REPORTING/DO_NOT_TRACK records enabled: false

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson
dmccoystephenson merged commit 947d4aa into main Nov 19, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the fix/opt-out-fails-closed branch November 19, 2026 05:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant