fix(plannings): follow symlinks when scanning plannings dir#200
Open
kernoeb wants to merge 1 commit into
Open
Conversation
Bun's Glob.scan defaults to followSymlinks: false, so files mounted as symlinks were skipped and 0 plannings loaded. Kubernetes ConfigMap volume mounts expose every file as a symlink (file.json -> ..data/file.json), which made directory-overwrite mounts find nothing. Enable followSymlinks so ConfigMap-mounted plannings are discovered. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Problem
When the plannings directory is overwritten via a Kubernetes ConfigMap volume mount, every file is exposed as a symlink:
Bun.Glob.scandefaults tofollowSymlinks: false, so withonlyFiles: truethese symlinked entries are skipped → 0 plannings loaded (server starts fine, but the planning tree is empty).Fix
Pass
followSymlinks: trueto theglob.scan(...)inapps/api/src/plannings/index.ts.Verification
Reproduced the exact ConfigMap symlink layout (
..data+ per-file symlinks) and ran the glob both ways:followSymlinks: false(before)followSymlinks: true(after)Reading the resolved path right after (
Bun.file(file).json()) follows the symlink transparently, so no other change is needed. The non-symlink case is unaffected. Typecheck + lint pass.Notes for K8s users
Without this change, alternatives that need no code change are: mount each file with
subPath:(real bind-mounted file), or setPLANNINGS_LOCATION=/app/plannings/..data(the inner files are real).🤖 Generated with Claude Code