Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Nov 8, 2025

Why

  • Repeated contract_user_home usage caused inconsistent tilde-collapsing
    and risked leaking $HOME across CLI commands and tests.
  • We need a single helper that automatically redacts the home directory when
    rendering paths but otherwise behaves like pathlib.Path.

What

  1. Add vcspull._internal.private_path.PrivatePath, a pathlib.Path subclass
    whose str()/repr() collapse the current user's home directory.
  2. Replace every CLI and logging call site that previously relied on
    contract_user_home (or raw paths) so human output and JSON/NDJSON schemas
    now consistently use PrivatePath.
  3. Remove the legacy helper from vcspull.util and update tests plus log
    snapshots to expect the new behavior; add a dedicated test module for the
    path class.
  4. Document the helper in both CHANGES (v1.47.x Development section) and the
    Sphinx internals docs with usage guidelines and an automodule reference.

Testing

  • Not run (docs + refactor touches only)

@codecov
Copy link

codecov bot commented Nov 8, 2025

Codecov Report

❌ Patch coverage is 74.00000% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.95%. Comparing base (6e27b7d) to head (4580004).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
src/vcspull/cli/add.py 41.66% 7 Missing ⚠️
src/vcspull/_internal/private_path.py 92.30% 1 Missing and 1 partial ⚠️
src/vcspull/cli/discover.py 50.00% 2 Missing ⚠️
src/vcspull/cli/fmt.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #485      +/-   ##
==========================================
+ Coverage   77.84%   77.95%   +0.11%     
==========================================
  Files          13       14       +1     
  Lines        1882     1901      +19     
  Branches      398      401       +3     
==========================================
+ Hits         1465     1482      +17     
- Misses        271      272       +1     
- Partials      146      147       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony merged commit 59b33ff into master Nov 8, 2025
9 checks passed
@tony tony deleted the private-path branch November 8, 2025 18:38
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