fix(cli): review fixes for the local-bundle paths

- --local-bundle now respects --dry-run (build the bundle, print its
  path, stop before any upload or deployment initialization)
- append to an existing .dockerignore in the bundle output instead of
  clobbering one a build extension may have written
- send config.runtime on initialization, identical to classic native
  deploys, instead of the resolved manifest runtime
- bundle artifacts get a distinct 'bundles/' key prefix so the build
  server can recognize a bundle even if the fromBundle flag is stripped
  by schema skew along the enqueue chain
This commit is contained in:
Saadi Myftija
2026-07-21 18:50:25 +02:00
parent 645a4a806c
commit 18c44a5a46
2 changed files with 24 additions and 5 deletions
@@ -24,7 +24,10 @@ const objectStoreClient =
const artifactKeyPrefixByType = {
deployment_context: "deployments",
deployment_bundle: "deployments",
// Distinct prefix on purpose: the artifact key is the one signal that survives
// any schema skew, so the build server can recognize a bundle even if the
// fromBundle flag gets stripped somewhere along the enqueue chain.
deployment_bundle: "bundles",
} as const;
const artifactBytesSizeLimitByType = {
deployment_context: 100 * 1024 * 1024, // 100MB
+20 -4
View File
@@ -1351,10 +1351,24 @@ async function handleNativeBuildServerDeploy({
await writeJSONFile(join(destination.path, BUNDLE_BUILD_ARGS_FILE), {
env: buildManifest.build.env ?? {},
});
await writeFile(
join(destination.path, ".dockerignore"),
`${BUNDLE_BUILD_ARGS_FILE}\n.dockerignore\n`
// Append to a .dockerignore a build extension may have produced, never clobber it
const dockerignorePath = join(destination.path, ".dockerignore");
const [, existingDockerignore] = await tryCatch(readFile(dockerignorePath, "utf-8"));
const dockerignoreEntries = [BUNDLE_BUILD_ARGS_FILE, ".dockerignore"].filter(
(entry) => !existingDockerignore?.split("\n").includes(entry)
);
if (dockerignoreEntries.length > 0) {
await writeFile(
dockerignorePath,
`${existingDockerignore ? existingDockerignore.trimEnd() + "\n" : ""}${dockerignoreEntries.join("\n")}\n`
);
}
if (options.dryRun) {
logger.info(`Dry run complete. View the built bundle at ${destination.path}`);
return;
}
}
const $deploymentSpinner = spinner();
@@ -1441,7 +1455,9 @@ async function handleNativeBuildServerDeploy({
userId,
gitMeta,
type: config.features.run_engine_v2 ? "MANAGED" : "V1",
runtime: bundleManifest?.runtime ?? config.runtime,
// Deliberately config.runtime (not the resolved manifest runtime) so the persisted
// value is identical to classic native deploys.
runtime: config.runtime,
isNativeBuild: true,
artifactKey,
skipPromotion: options.skipPromotion,