Skip to content

fix(compose): hash symlinked local-feature content for reattach - #145

Merged
bilby91 merged 1 commit into
mainfrom
fix/reattach-hash-symlinks
Oct 28, 2026
Merged

bilby91 merged 1 commit into
mainfrom
fix/reattach-hash-symlinks

Conversation

@bilby91

@bilby91 bilby91 commented Oct 28, 2026

Copy link
Copy Markdown
Member

Problem

The DAP review bot found this on the v0.5.2 bump (crunchloop/dap#6946). #144's compose inputs hash digests a local feature's directory with hashDirContent, which only walks regular files. feature.GenerateBuildContext (copyDir), however, copies a symlink as the content it names.

So a local feature whose install.sh is a symlink to a shared script outside the feature directory keeps the same hash when that script changes. The next Up then reattaches to the image built from the old script instead of rebuilding.

Fix

hashDirContent now includes symlinks and hashes them as their resolved content, which is what the build context gets.

A symlink to a directory fails the hash. copyDir cannot copy one either. The workspace then gets no label and always takes the full path, which is the existing fail-safe for a hash that cannot be computed.

The changelog cuts 0.5.3.

Tests

  • TestComposeInputsHash_LocalFeatureSymlinkTarget:
    • editing the target of a symlinked install.sh changes the hash;
    • a symlink to a directory fails the hash.
  • Local runs: make lint reports 0 issues and make test passes (-race).

🤖 Generated with Claude Code

https://claude.ai/code/session_01UMTBosSzdEvXqCZ9c7VyLk

hashDirContent only walked regular files, but GenerateBuildContext
copies a symlink in a local feature as the content it names. Editing
the target of a symlinked install.sh outside the feature directory
left the compose inputs hash unchanged, so Up reattached to the image
built from the old content. Hash symlinks as their resolved content,
and fail the hash (no label, full path) on a symlink to a directory,
which the build context copy cannot handle either.

Cut 0.5.3 in the changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UMTBosSzdEvXqCZ9c7VyLk
@bilby91
bilby91 merged commit 8800af2 into main Oct 28, 2026
9 of 10 checks passed
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