Skip to content

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

Merged
pilgd-aws merged 1 commit into
aws:mainfrom
pilgd-aws:fix/repair-dangling-symlinks
Jun 22, 2026
Merged

fix(extensions-sync): Auto-repair dangling symlinks on SMD image upgrade#247
pilgd-aws merged 1 commit into
aws:mainfrom
pilgd-aws:fix/repair-dangling-symlinks

Conversation

@pilgd-aws

Copy link
Copy Markdown
Contributor

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/sagemaker-extensions-sync.diff

@pilgd-aws pilgd-aws requested review from a team as code owners June 16, 2026 21:14
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.
@azmkercso

azmkercso commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Does this need to be backported to existing release channels (1.1, 1.0)?

@pilgd-aws

Copy link
Copy Markdown
Contributor Author

Does this need to be backported to existing release channels (1.1, 1.0)?

We only have to ship with newest code editor. Let me know if merging just to main is not sufficient.

@pilgd-aws pilgd-aws added this pull request to the merge queue Jun 22, 2026
Merged via the queue into aws:main with commit 712c900 Jun 22, 2026
1 check passed
@pilgd-aws pilgd-aws deleted the fix/repair-dangling-symlinks branch June 22, 2026 09:13
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.

4 participants