fix(cli): require folder upload opt-in and isolate archive staging - #863
Open
AbdullahM07 wants to merge 1 commit into
Open
AbdullahM07 wants to merge 1 commit into
AbdullahM07 wants to merge 1 commit into
Conversation
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.
Summary
Require an explicit folder upload choice and stage its archive outside the source tree. Clean up the staging directory even when
tarfails before upload.Motivation
Running
openship deploy --project ... --service-ids ...from a non-Git scratch directory silently uploaded that directory. When it containedTMPDIR, the archive could include earlier uploads and its own output. Packaging happened before the cleanup block, leaving failed archives behind to grow on subsequent attempts.Related issue
Fixes #853
Changes
--folderfor explicit upload, including from a Git checkout; preserve--nameas an upload opt-in outside Git.--branchselects the existing Git deployment endpoint; reject Git-only options combined with--folder.finallycleanup.Verification
bun run --cwd apps/cli test --maxWorkers=2 --testTimeout=15000: 40 files, 506 tests passed. The final two explicit-upload cases also pass inbun run --cwd apps/cli test deploy-folder-opt-in --maxWorkers=2(6 tests).bun run --cwd apps/cli lint: passed.bun run formatin an isolated checkout and retained only scoped formatting.The CLI suite uses a 15-second timeout because its existing port-release test waits six seconds when local port 3001 is occupied; the running local server was left in place.
Checklist