Skip to content

🐛 fix(changelog): overlay pending deletions into the §10e tagged-tree sandbox (D-181 follow-up) - #136

Merged
konih merged 1 commit into
mainfrom
lane/changelog-overlay-deleted
Sep 13, 2026
Merged

konih merged 1 commit into
mainfrom
lane/changelog-overlay-deleted

Conversation

@konih

@konih konih commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Why

Review of #135 (D-181) found one defect in its new §10e row of hack/release/changelog_gate_test.sh. The row overlaid the working tree into its tagged-tree sandbox with git ls-files -z | tar -cf - --null -T -, and that has two problems:

  • Unstaged deletion → spurious red. Delete a tracked file with plain rm, then run task check before git add -A. tar can't stat the file (tar: …: Cannot stat: No such file or directory, exit 2), so the suite fails with "could not overlay the working tree into the tagged-tree sandbox". That failure has nothing to do with the changelog.
  • Staged deletion → silently kept. A file removed with git rm stayed in the sandbox from the HEAD checkout, so the nested run didn't grade the tree under test.

What

  • The overlay is now a function, overlay_worktree <src> <dst>. It clears every file the sandbox tracks, then copies only the source's tracked files that still exist on disk. The following add -A in the sandbox records both kinds of deletion.
  • A cheap fixture row (no nested run) pins it: a modified file is carried over, and an unstaged and a staged deletion are both absent afterwards.

Evidence

  • Red first: the new row failed on the old body with tar: unstaged-rm: Cannot stat.
  • Green with a real deletion: the full changelog_gate_test.sh passes with an unstaged deletion (rm docs/vision.md) in the tree, which is the exact state that went red before.
  • task check green, run under the pinned toolchain. Locally it needed GOFLAGS=-buildvcs=false, because Go's VCS stamping couldn't run git inside the isolated worktree. That is environmental, and CI runs the unmodified check.

… sandbox (D-181 follow-up)

§10e overlaid the working tree with `git ls-files | tar`, so a tracked file
deleted but not yet staged (plain `rm` before `git add -A`) made tar fail to
stat it and `task check` went red with "could not overlay the working tree",
a reason that is not the changelog; a staged deletion was silently kept in
the sandbox, so the nested run did not grade the tree under test.

overlay_worktree now clears every tracked file in the sandbox and copies only
the tree's tracked files that still exist. A fixture row pins it: a modified
file is carried over, and both an unstaged and a staged deletion are absent.
The row reds on the previous body with tar's "Cannot stat".
@sonarqubecloud

Copy link
Copy Markdown

@konih
konih merged commit 8c99686 into main Sep 13, 2026
6 checks passed
@konih
konih deleted the lane/changelog-overlay-deleted branch September 13, 2026 17: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.

1 participant