Skip to content

fix(extensions-sync): Auto-repair dangling symlinks on SMD image upgrade#237

Closed
pilgd-aws wants to merge 1 commit into
aws:mainfrom
pilgd-aws:fix/repair-dangling-symlinks
Closed

fix(extensions-sync): Auto-repair dangling symlinks on SMD image upgrade#237
pilgd-aws wants to merge 1 commit into
aws:mainfrom
pilgd-aws:fix/repair-dangling-symlinks

Conversation

@pilgd-aws

Copy link
Copy Markdown
Collaborator

Summary

Adds repairDanglingSymlinks() to the sagemaker-extensions-sync extension. When a CodeEditor space restarts with a newer SMD image, pre-packaged extension symlinks become dangling (old version paths no longer exist). This fix detects and re-links them automatically before the existing sync logic runs.

What it does

  • Scans PV extensions dir for symlinks where stat() fails (dangling)
  • Matches each to the current image version by stripping the version from the dirname
  • Re-links to the new image path, or cleans up if the extension was removed
  • Respects .obsolete file to avoid re-installing user-uninstalled extensions
  • Calls refreshExtensionsMetadata() to force VS Code rescan

Testing

  • Unit test: 5 scenarios, 19 assertions (version bump, extension removed, user-uninstalled, valid symlink untouched, real dir untouched)
  • E2E test: validated in real SMD 3.9.6-cpu container with simulated upgrade (10/10 assertions passed)

Change size

90 insertions, 3 deletions in patches/sagemaker-extensions-sync.patch

@pilgd-aws pilgd-aws requested a review from a team as a code owner June 16, 2026 19:47
Add repairDanglingSymlinks() to detect and fix broken symlinks in the
persistent volume when a CodeEditor space restarts with a newer SMD
image. Runs before existing sync logic so subsequent reads see clean
state. Respects .obsolete file to avoid re-installing user-uninstalled
extensions.
@pilgd-aws pilgd-aws force-pushed the fix/repair-dangling-symlinks branch from b1ec7fc to c581234 Compare June 16, 2026 20:05
@pilgd-aws

Copy link
Copy Markdown
Collaborator Author

Closing — this repo is deprecated. Moving PR to https://github.com/aws/code-editor instead.

@pilgd-aws pilgd-aws closed this Jun 16, 2026
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