Skip to content

fix(cli): require folder upload opt-in and isolate archive staging - #863

Merged
Hydralerne merged 1 commit into
oblien:feat/bugfix-integration-2026-09-15from
AbdullahM07:fix/853-folder-upload-staging
Sep 15, 2026
Merged

Hydralerne merged 1 commit into
oblien:feat/bugfix-integration-2026-09-15from
AbdullahM07:fix/853-folder-upload-staging

Conversation

@AbdullahM07

Copy link
Copy Markdown
Contributor

Summary

Require an explicit folder upload choice and stage its archive outside the source tree. Clean up the staging directory even when tar fails before upload.

Motivation

Running openship deploy --project ... --service-ids ... from a non-Git scratch directory silently uploaded that directory. When it contained TMPDIR, 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

  • Add --folder for explicit upload, including from a Git checkout; preserve --name as an upload opt-in outside Git.
  • Refuse implicit uploads outside Git. An explicit --branch selects the existing Git deployment endpoint; reject Git-only options combined with --folder.
  • Resolve symlinks before rejecting the temporary directory or an ancestor as the source, before provisioning an upload session.
  • Use a private per-run staging directory and cover packaging and upload with the same finally cleanup.
  • Update CLI documentation and add real-tar regressions plus command-level coverage for both deployment paths.

Verification

  • Before the fix: four archive regressions fail, including a partial tarball surviving a packaging error.
  • bun run --cwd apps/cli test --maxWorkers=2 --testTimeout=15000: 40 files, 506 tests passed. The final two explicit-upload cases also pass in bun run --cwd apps/cli test deploy-folder-opt-in --maxWorkers=2 (6 tests).
  • bun run --cwd apps/cli lint: passed.
  • Root non-CLI workspace tests: all six tasks passed.
  • Ran bun run format in 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

  • One issue per PR, with a scoped diff
  • Regression tests fail before the fix and pass afterward
  • Relevant tests, typecheck and formatting completed locally
  • Reviewed the implementation and test behavior

@Hydralerne

Hydralerne commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Incorporated this PR into feat/bugfix-integration-2026-09-15 via e1082f44, preserving the original commits and adapting the fix to the current architecture.

Integrate PR #863 in the shared platform/SDK packager: reject staging within source and require an explicit folder-upload choice.

GitHub now records this contributor PR as merged into the integration branch. The integrated changes are tested and awaiting merge to main.

Validation:

  • 41 platform, SDK and CLI tests pass; platform and CLI type checks pass.
  • All three source/staging overlap regressions fail against main (unsafe archives were created), and pass with the guard. Cases include exact paths, ancestors, symlink aliases/parents, common prefixes, retained build outputs, and session/upload failure cleanup.

@Hydralerne Hydralerne closed this Sep 15, 2026
@Hydralerne Hydralerne reopened this Sep 15, 2026
@Hydralerne
Hydralerne changed the base branch from main to feat/bugfix-integration-2026-09-15 September 15, 2026 18:25
@Hydralerne
Hydralerne merged commit e1082f4 into oblien:feat/bugfix-integration-2026-09-15 Sep 15, 2026
3 checks passed
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.

[Bug] openship deploy: folder upload tarball is written inside its own archive root when cwd is $TMPDIR — orphaned tarballs nest and fill the disk

2 participants