fix(up): skip unresolvable paths instead of failing the whole upload - #1043
Open
codyde wants to merge 2 commits into
Open
fix(up): skip unresolvable paths instead of failing the whole upload#1043codyde wants to merge 2 commits into
codyde wants to merge 2 commits into
Conversation
A dangling symlink anywhere in the tree aborted `railway up` during indexing with "No such file or directory", creating no deployment. An exact-path `.railwayignore` rule could not exclude it: `follow_links(true)` makes the walker stat the symlink target before the ignore rules are consulted for that entry, so the error is raised before matching happens. Treat a walk entry whose error is `NotFound` as skippable — a broken link, or a file removed mid-walk, has no contents to upload — and report it through `reporter::warn` so it is structured under `--json`. Any other error still fails the deploy, since that would mean a silently incomplete tarball. Validate the root path up front: it reaches the walker as the same `NotFound`, and no caller checks it, so skipping it would turn a typo'd path into an empty but successful deploy.
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
A single dangling symlink anywhere in the tree aborts
railway upduring indexing withNo such file or directory, and no deployment is created. An exact-path.railwayignorerule cannot exclude it:follow_links(true)makes the walker stat the symlink target before the ignore rules are consulted for that entry, so the error is raised before matching happens.Closes #1023.
Resolution
NotFoundas skippable — a broken link, or a file removed mid-walk, has no contents to upload — and report it viareporter::warn, so it is structured under--json.NotFound, and none of the three callers check it, so skipping it would turn a typo'd path into an empty but successful deploy.Not
follow_links(false): that regresses symlinked directories, which is what #296 fixed.Verification
Real deploys, identical tree (
backend/AGENTS.mddangling +/backend/AGENTS.mdin.railwayignore):--jsonstdoutDeployed app serves correctly, so real files still ship. Covered by 7 tests including symlinked-dir traversal, symlink loop stays fatal, and the missing-root and empty-dir/single-file boundaries.