Skip to content

move more things into containers-shared for cf - #15512

Draft
emily-shen wants to merge 1 commit into
mainfrom
emily/containers-shared-6
Draft

move more things into containers-shared for cf#15512
emily-shen wants to merge 1 commit into
mainfrom
emily/containers-shared-6

Conversation

@emily-shen

@emily-shen emily-shen commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Also:

move container build earlier


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because:

A picture of a cute animal (not mandatory, but encouraged)

@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ccb62a0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15512

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15512

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15512

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15512

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15512

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15512

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15512

miniflare

npm i https://pkg.pr.new/miniflare@15512

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15512

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15512

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15512

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15512

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15512

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15512

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15512

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15512

wrangler

npm i https://pkg.pr.new/wrangler@15512

commit: ccb62a0

Comment on lines +808 to +831
async function runPreviewContainerOperation<T>(
options: { quiet: boolean },
operation: () => Promise<T>
): Promise<T> {
initContainersSharedContext({
logger: options.quiet ? quietLogger : logger,
fetchResult,
});

if (!options.quiet) {
return operation();
}

// Building and applying containers prints progress to stdout, the same stream
// that carries the `--json` payload. Keep both logging surfaces quiet while
// stdout has to stay machine-readable.
const previousLogLevel = getLogLevel();
setLogLevel("error");
try {
return await operation();
} finally {
setLogLevel(previousLogLevel);
initContainersSharedContext({ logger, fetchResult });
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Keep generated client debug output out of preview --json. verifyContainersScope() initializes OpenAPI.LOGGER to the normal Wrangler logger during preparation, but this later quiet path only changes the containers context and the CLI-helper log level. With WRANGLER_LOG=debug, ApplicationsService logs request and response details to stdout before the JSON result. The previous runWithLogLevel("warn") scope suppressed this.

Suggested change
async function runPreviewContainerOperation<T>(
options: { quiet: boolean },
operation: () => Promise<T>
): Promise<T> {
initContainersSharedContext({
logger: options.quiet ? quietLogger : logger,
fetchResult,
});
if (!options.quiet) {
return operation();
}
// Building and applying containers prints progress to stdout, the same stream
// that carries the `--json` payload. Keep both logging surfaces quiet while
// stdout has to stay machine-readable.
const previousLogLevel = getLogLevel();
setLogLevel("error");
try {
return await operation();
} finally {
setLogLevel(previousLogLevel);
initContainersSharedContext({ logger, fetchResult });
}
async function runPreviewContainerOperation<T>(
options: { quiet: boolean },
operation: () => Promise<T>
): Promise<T> {
const containersLogger = options.quiet ? quietLogger : logger;
initContainersSharedContext({
logger: containersLogger,
fetchResult,
});
if (!options.quiet) {
return operation();
}
const { OpenAPI } = await import("@cloudflare/containers-shared");
const previousOpenApiLogger = OpenAPI.LOGGER;
OpenAPI.LOGGER = {
...quietLogger,
debugWithSanitization() {},
};
// Building and applying containers prints progress to stdout, the same stream
// that carries the `--json` payload. Keep both logging surfaces quiet while
// stdout has to stay machine-readable.
const previousLogLevel = getLogLevel();
setLogLevel("error");
try {
return await operation();
} finally {
setLogLevel(previousLogLevel);
OpenAPI.LOGGER = previousOpenApiLogger;
initContainersSharedContext({ logger, fetchResult });
}
}

@ask-bonk

ask-bonk Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

Moves container build, deployment, and preview logic into containers-shared.

  1. P1: Posted 1 actionable inline suggestion.

github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants