Skip to content

[rush] Add tarball support to deploy archives - #6227

Merged
Ian Clanton-Thuon (iclanton) merged 8 commits into
mainfrom
verbose-meme
Nov 26, 2026
Merged

Ian Clanton-Thuon (iclanton) merged 8 commits into
mainfrom
verbose-meme

Conversation

@iclanton

@iclanton Ian Clanton-Thuon (iclanton) commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Add .tar, .tar.gz, and .tgz support to rush deploy --create-archive, alongside ZIP support.

Details

  • Use native tar exclusively, sharing memoized discovery and execution with build caching. Missing or failed native tar produces an explicit error; retain the native-only cache policy.
  • Make ArchiveManager accept only file paths. AssetHandler writes generated content once and registers the materialized target path for normal deployments.
  • For archive-only tar deployments, AssetHandler stages assets once in isolated folders under common/temp. For archive-only ZIP deployments, stage only generated files and read existing source files directly.
  • Clean up staging on success, extraction failures, finalization failures, and native tar failures.
  • Preserve file permissions and symbolic links. Materialized archives use the target files and their actual permissions.
  • Use NUL-delimited native file lists so whitespace and leading dashes are treated literally.
  • Update CLI help, package documentation, API review, and changefiles.

How it was tested

On pushed revision 483d37c, on Linux:

  • Built Rush and package-extractor successfully, including TypeScript and lint checks.
  • Passed 36 archive and extraction tests, including single-write checks for generated assets, empty files, target-file registration, concurrent staging, and cleanup after extraction and finalization failures.
  • Passed 78 targeted native tar, cache, and CLI tests.
  • Verified changefiles and whitespace; the worktree is clean.

Impacted documentation

Support .tar, .tar.gz, and .tgz deployment archives using the existing tar dependency. Preserve ZIP support and add archive coverage, documentation, and release changefiles.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@iclanton

Copy link
Copy Markdown
Member Author

Copilot, address the comments.

Share native tar discovery and execution between deployment and build caching, retaining the JavaScript path for unavailable/incompatible tar and in-memory archive-only assets. Check in fixtures, remove the Windows symlink test skip, use FileSystem streams and template paths, and apply changefile wording.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Memoize native tar discovery, separate archive format detection, and remove the Rush adapter in favor of direct shared callers. Extract JavaScript tar creation and use it for build cache creation fallback, retaining atomic publication and abort handling.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Use native tar exclusively and stage archive-only deployment assets in isolated common/temp folders with guaranteed cleanup. Remove the shared JavaScript writer and restore native-only cache behavior.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Member Author

Implemented the native-only decision in e5252b7. Archive-only tar deployments now stage assets in an isolated directory under the repository's common/temp, with cleanup on both success and failure. The shared JavaScript writer and the newly introduced cache-creation fallback are removed.

This preserves Rush's native-only cache policy established by #3653: that removal was motivated by JavaScript extraction accepting corrupt/truncated cache archives and restoring incomplete outputs, rather than evidence that JavaScript archive creation itself was faulty.

The pushed revision builds successfully and passes all 18 archive tests and 73 targeted cache/native tar tests.

…ives

Fix CI snapshots and Windows tar tests; handle early stdin EOF as a closed pipe.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Member Author

Pushed fixes for the reported CI failures: refreshed the deploy-help and command-spec snapshots, corrected the native symlink fixture to create a symbolic link rather than a Windows junction, and handled Windows stdin EOF alongside EPIPE when tar exits early. Added regression coverage for both closed-pipe errors. Both packages build successfully, and all 96 targeted tests pass locally on Linux. Windows validation is pending the new CI run.

…oy archives

Use file-path-only archive inputs and stage generated assets once in AssetHandler.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Member Author

Implemented the path-only design in 483d37c: removed fileData from ArchiveManager, moved staging and generated-file writes into AssetHandler, and register targetFilePath for materialized deployments. Archive-only tar assets are staged once; archive-only ZIP stages generated files only. Cleanup now also covers extraction failures before finalization. Added single-write, empty-file, target-content, and extraction-failure regression tests. Both packages build and all 114 targeted tests pass locally.

Address latest archive review comments, preserving ZIP order and concurrent staging isolation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@iclanton

Copy link
Copy Markdown
Member Author

Pushed 4c43038 as a separate fixup and replied to all six latest review comments. Implemented ArchiveManager initialization memoization, parallel ZIP reads with preserved entry order, explicit success-only log cleanup, collision-safe timestamp staging, and allocation-free traversal validation. Retained archiveTempFolder as public because rush deploy uses it to honor RUSH_TEMP_FOLDER. Also made the executable-permission regression compare against the actual fixture mode rather than assuming checkout permissions.

Validation on Linux: package-extractor and rush-lib both build with TypeScript/lint checks; all 43 targeted archive/extraction tests and 75 native-tar/build-cache tests pass (118 total). The worktree is clean, the pre-existing metadata commit is preserved, and CI including Windows is running. Leaving the PR open for review.

@iclanton
Ian Clanton-Thuon (iclanton) merged commit 7ed61c9 into main Nov 26, 2026
8 checks passed
@iclanton
Ian Clanton-Thuon (iclanton) deleted the verbose-meme branch November 26, 2026 21:46
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants