Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Nov 3, 2025

Earlier:

Changes

Refactor: cli/add path-first handling trims legacy heuristics

why: Stop vcspull add from inventing a ./ workspace when the caller supplies
only a repository path, and keep duplicate sections intact without sidecar
structures. what:

  • resolve the canonical workspace label directly from loader output, only
    honoring ./ when the user passes --workspace ./
  • collapse the --no-merge flow onto ordered loader items so duplicate sections
    round-trip without config_items bookkeeping
  • tighten CLI regression coverage around explicit dot workspaces in both merge
    modes to guard the new behavior

Testing

tony added 2 commits November 2, 2025 20:16
why: Path-first adds from inside a workspace still wrote './' sections even after adopting tilde labels. what: - compute a preferred workspace label and migrate existing './' entries to the tilde label, keeping config_items in sync
why: Guard against regressions when runs from inside the workspace with and without . what: - add tests confirming tilde-labelled workspaces and './' upgrades
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

❌ Patch coverage is 63.97516% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.84%. Comparing base (de203a4) to head (e285b82).
⚠️ Report is 10 commits behind head on master.

Files with missing lines Patch % Lines
src/vcspull/cli/add.py 63.52% 42 Missing and 16 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## master #484 +/- ## ========================================== - Coverage 79.09% 77.84% -1.26%  ========================================== Files 13 13 Lines 1789 1882 +93 Branches 382 398 +16 ========================================== + Hits 1415 1465 +50  - Misses 235 271 +36  - Partials 139 146 +7 

☔ 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 added 7 commits November 3, 2025 18:09
why: The path is None heuristic dates back to the deprecated name+URL flow; path-first adds should only create ./ when explicitly requested. what: - Remove workspace_root_path is None branch that implied path is None - Set preserve_cwd_label directly from explicit_dot flag - Fix variable redefinition in _prepare_no_merge_items refs: Legacy name+URL flow deprecation
…th-first adds why: Path-first adds should derive workspace from repo parent directory, and handle home directory edge case. what: - _resolve_workspace_path returns repo.parent when workspace_root is None - workspace_root_label handles workspace_path == home to return ~/ - Prevents ~/./ labels when workspace is the home directory refs: Path-first workflow correctness
why: Legacy name+URL flow tests expected ./ labels; path-first workflow uses tilde labels. what: - Update test fixtures to provide repo paths instead of path=None - Update expectations: ~/ instead of ./, ~/code/ for parent directories - Fix workspace label expectations to match parent directory behavior - Remove normalization expectations for path-first adds refs: Path-first workflow migration
why: Path-first adds should not auto-migrate existing ./ sections; explicit --workspace ./ is the only way to create/target ./ labels. what: - Remove migration logic from _ensure_workspace_label_for_merge - Remove migration logic from _prepare_no_merge_items - Existing ./ sections now preserved when they match the target workspace refs: Simplify legacy heuristics
why: Automatic ./ migration removed; test should verify ./ sections are preserved. what: - Rename test_handle_add_command_upgrades_dot_workspace_section - Update test to verify existing ./ sections are preserved - Change assertions to expect ./ label when matching existing section refs: Remove ./ migration behavior
…st adds why: normalize_workspace_roots was only needed for legacy name+URL flow cleanup; path-first adds derive correct labels directly. what: - Remove normalize_workspace_roots call from merge path - Remove in-place label normalization from no-merge path - Remove unused normalize_workspace_roots import (ruff auto-fix) - Simplify config_was_relabelled tracking refs: Eliminate legacy normalization machinery
why: Refactoring had no user-visible behavior changes; update test snapshots for new explicit ./ workspace tests. what: - Remove CHANGES entry about internal legacy heuristics cleanup - Add snapshots for path-explicit-dot-workspace tests refs: Internal cleanup
@tony tony force-pushed the vcspull-add-bug-pt-4 branch from dbd97bc to e285b82 Compare November 4, 2025 00:31
@tony tony merged commit 5dd8aa3 into master Nov 4, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants