fix: preserve symlinks in .config/ during restore to prevent ENOENT on dangling links#1327
Open
anishesg wants to merge 1 commit into
Open
fix: preserve symlinks in .config/ during restore to prevent ENOENT on dangling links#1327anishesg wants to merge 1 commit into
anishesg wants to merge 1 commit into
Conversation
…n dangling links The `restoreConfigFromBase` function crashes with ENOENT when `.config/` contains symlinks pointing to files that don't exist yet (e.g., symlinks into dependency directories before installation). Signed-off-by: anish <anishesg@users.noreply.github.com>
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.
The
restoreConfigFromBasefunction crashes with ENOENT when.config/contains symlinks pointing to files that don't exist yet (e.g., symlinks into dependency directories before installation).The root cause is on line 89 of
src/github/operations/restore-config.ts, wherecpSyncis called withdereference: true. This option forces Node.js to follow symlinks and stat their targets, causing the copy operation to fail when the target doesn't exist.The fix changes
dereference: truetodereference: false, which preserves symlinks as-is without attempting to resolve them. This allows dangling symlinks in.config/to be copied to.config-pr/and later restored from the base branch without crashing. The symlinks can resolve naturally after dependency installation later in the workflow.A regression test was added to verify that dangling symlinks in
.config/skills/no longer cause the restore step to crash.Fixes #1321