Repository navigation
Reuse the runner's dependency install on Git push deploys [skip ci] - #316
Merged
Merged
Conversation
…hon code swap [skip ci] On a Git push deploy the EC2 runner installs the checkout's dependencies, and the CLI then ran npm ci again because it could not verify the tree: npm workspaces, skipped optional platform packages and install scripts all made the check refuse it. The runner now names the directory it installed in through STP_RUNNER_INSTALLED_DEPENDENCIES, and the CLI reuses that install for any package manager. The npm check also accepts workspaces and skipped optional packages, for pipelines without install scripts. A Python code swap image starts from the base image built just before it, which only the local store holds; the build no longer asks Docker Hub for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nd pnpm [skip ci] The runner and the CLI pick lockfiles in different orders, and the runner always runs its own pnpm. The CLI now keeps the runner's tree only when STP_RUNNER_INSTALLED_LOCKFILE names the lockfile the CLI follows and, for pnpm, when the CLI would also run the pnpm on PATH. The npm check accepts a missing optional package only when its os, cpu or libc excludes this machine, so a tree restored from an older cache or installed with --omit=optional is installed again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 23, 2026
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.
Two CLI changes that make Git push deploys faster. The runner side is stacktape/console-app#140.
The CLI reuses the runner's dependency install. On a push deploy, the EC2 runner installs the checkout's dependencies. The CLI then ran
npm ci(about 9 s on the runner for the benchmark's lambda fixture), becauseisCompletedNpmInstallrefused the tree. The fixture is an npm workspace, npm leaves out optional packages for other platforms (@esbuild/darwin-*), so the hidden lockfile never equals the lockfile, and esbuild and prisma have install scripts. npm does not record whether install scripts ran, so content alone cannot prove such a tree. The runner therefore says so explicitly. The installer skips its install and writes its marker, so a nested Stacktape process in that checkout also skips it, when three things hold.STP_RUNNER_INSTALLED_DEPENDENCIESnames the install directory andnode_modulesexists there.STP_RUNNER_INSTALLED_LOCKFILEnames the same lockfile the CLI follows; the runner and the CLI pick lockfiles in different orders. For pnpm, the CLI would also run the pnpm on PATH, not a declared version or the one a v6 lockfile needs. Otherwise it installs as before. The runner sets the variable only after a successful install of a fresh worktree, so a lockfile change still installs. Laptops and other CI pipelines behave as before.The npm check itself now also accepts workspaces (it verifies the links, each workspace's manifest against its lockfile entry, and the workspace patterns) and missing optional packages whose
os,cpuorlibcexcludes this machine. Any other missing optional package, from--omit=optionalor an older cached tree, still installs. That lets a pipeline's ownnpm cicount, but only for trees without install scripts, which keep refusing as before.A Python code swap no longer pulls its local base image. The swap image starts
FROM stacktape-python-swap-base:<id>, which is the image built just before it and exists only in the local store. The build treated it as a base image to keep pulled, so every Python push ran adocker pullagainst Docker Hub that failed (0.7 s locally).Measured with the runner's command sequence on this machine (fresh checkout, the runner's install,
CI=true stacktape deployto the e2e account, alternating before and after, n=5 each):git push-equivalent start to deployed went from 41.8 s to 24.7 s. Initialize went from 15.1 s to 1.6–4.6 s; the remaining spread is AWS API latency. The second install took 12.2–14.5 s locally.Checks: new
dependency-installer.spec.tsbuilds real npm workspace trees offline (links, a package skipped for another platform, changed manifests, a moved link, an incomplete install, and the runner path keepingnode_modulesuntouched). The extendedrailpack.test.tsasserts that the swap build names no base image.test:src,test:fresh-install, packagingtest,typecheckandcheck:integratedpass, exceptpackaging-harness.spec.ts"measures a shape and reports which artifacts each edit changes", which fails the same way onorigin/main.