Repository navigation
fix(compose): hash symlinked local-feature content for reattach - #145
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.shis a symlink to a shared script outside the feature directory keeps the same hash when that script changes. The nextUpthen reattaches to the image built from the old script instead of rebuilding.Fix
hashDirContentnow includes symlinks and hashes them as their resolved content, which is what the build context gets.A symlink to a directory fails the hash.
copyDircannot 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:install.shchanges the hash;make lintreports 0 issues andmake testpasses (-race).🤖 Generated with Claude Code
https://claude.ai/code/session_01UMTBosSzdEvXqCZ9c7VyLk