Skip to content

fix(workspace): upgrade report excludes .venv/docs from the ADDED walk (#951) - #952

Merged
c-vigo merged 2 commits into
release/0.5.0from
bugfix/951-preview-report-exclude-venv
Jul 9, 2026
Merged

c-vigo merged 2 commits into
release/0.5.0from
bugfix/951-preview-report-exclude-venv

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

--preview/--force upgrade report over-reported ~1763 phantom .venv/…/site-packages/* files in the ADDED section that the real upgrade never writes, making the ADDED list unusable. Report-only bug — no data risk.

Root cause

The #949 fix switched the report classifier to find -L (assets/init-workspace.sh:534) so it follows the Nix image's store-symlink template — correct for the OVERWRITTEN section. But find -L now also follows the baked template's .venv symlink tree. The report find excluded only .git, whereas the real rsync copy excludes more:

rsync -avL --delete --exclude='.git' --exclude='.venv' --exclude='docs/issues/' --exclude='docs/pull-requests/' …

So every symlinked .venv file leaked into ADDED.

Fix

Mirror the copy's static excludes in the report find (single-site change, line 534):

done < <(find -L "$TEMPLATE_DIR" -type f \
    ! -path "*/.git/*" ! -path "*/.venv/*" \
    ! -path "*/docs/issues/*" ! -path "*/docs/pull-requests/*" -print0)

.venv is the one that leaks today; the two docs/* excludes are for parity so future template changes can't leak either.

Test evidence (TDD)

New bats test upgrade preview omits the baked .venv symlink tree from ADDED (#951) places a symlinked .venv/…/site-packages/phantom-venv-pkg.py (mirroring the image's baked venv) plus a normal symlinked template file under TEMPLATE_DIR, and asserts the normal file is still in ADDED while the .venv file is not.

Full prek run --all-files hook suite green (sync-manifest mirror of CHANGELOG.md re-staged).

Refs: #951
Closes #951

c-vigo added 2 commits July 9, 2026 10:50
The #949 fix switched the preview/report classifier to `find -L` so it
follows the Nix image's store-symlink template. But `find -L` also
descends the baked .venv symlink tree, so the ADDED section over-reported
phantom .venv/.../site-packages/* files the real rsync copy never writes.

Mirror the static excludes the real copy applies (.git, .venv,
docs/issues/, docs/pull-requests/) in the report `find` so ADDED matches
what the upgrade actually does.

Refs: #951
@c-vigo
c-vigo enabled auto-merge July 9, 2026 08:54
@c-vigo

c-vigo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed: single-site change adding ! -path "*/.venv/*" (+ docs/issues, docs/pull-requests) to the report find at init-workspace.sh:534, mirroring the rsync copy's static excludes. Test reproduces (.venv symlink shows in ADDED before, excluded after; #949 OVERWRITTEN/ADDED tests still green, 124/124). Changelog under [0.5.0]-TBD as a #949 follow-up. Minimal + clean. LGTM — auto-merge stands.

@c-vigo
c-vigo merged commit 286e419 into release/0.5.0 Jul 9, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/951-preview-report-exclude-venv branch July 9, 2026 09:14
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