[wrangler] fix: suppress status badge when printBanner returns false#13837
Conversation
🦋 Changeset detectedLatest commit: 84c3e07 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
Show detailed file reviewers
|
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency in Wrangler’s command handler so that a command’s behaviour.printBanner decision (e.g. disabling banners for --json) also suppresses the beta/open-beta statusMessage, preventing unexpected non-JSON output on stderr.
Changes:
- Compute a single
bannerEnabledboolean frombehaviour.printBannerand reuse it consistently. - Gate
def.metadata.statusMessageprinting behindbannerEnabled(in addition togetWranglerHideBanner()). - Add a regression test ensuring the beta/open-beta status warning is not printed for
ai-search list --json.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/wrangler/src/core/register-yargs-command.ts | Reuses the printBanner evaluation to consistently suppress the beta/open-beta status warning when banners are disabled. |
| packages/wrangler/src/tests/ai-search.test.ts | Adds a regression test asserting the status warning doesn’t appear in --json mode. |
| .changeset/fix-beta-banner-respects-print-banner.md | Records the patch-level bugfix in the release notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@NuroDev @penalosa @dario-piotrowicz — all Copilot review comments have been addressed. This PR is ready for review. |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
…ning false When printBanner is the static boolean `false` (e.g. kv bulk get), the statusMessage (open-beta warning) should still be shown. Only suppress it when printBanner is a dynamic function that returned false (e.g. --json mode).
|
/bonk review this PR |
|
Review submitted. Here's a summary of my findings: Overall verdict: Approve. This is a clean, well-scoped bug fix. What the PR does: When a command defines Key design decision: The PR intentionally only suppresses Two minor comments posted:
|
|
Codeowners approval required for this PR:
Show detailed file reviewers |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Fixes #13121.
When a command sets
printBanner: (args) => !args.json(e.g.ai-search list), the deprecated/status-message badge was still printed in JSON mode because thestatusMessageguard didn't check the same condition as the banner guard.Root cause:
def.metadata.statusMessagewas gated only by!getWranglerHideBanner(), not by the command'sprintBannerlogic.Fix: Extract
bannerEnabledfrom theprintBannerevaluation and gate thestatusMessagedisplay behind it, mirroring the existingprintWranglerBanner()call.