[wrangler] Expand telemetry arg allow list to restore dropped boolean flags#13576
[wrangler] Expand telemetry arg allow list to restore dropped boolean flags#13576
Conversation
🦋 Changeset detectedLatest commit: d41a3ab The changes in this PR will be included in the next version bump. 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 |
|
✅ All changesets look good SummaryReviewed 26 changeset files: Validated Changesets (16)
Skipped (Dependency Updates - per guidelines)
Checks Passed
|
|
I posted a review on PR #13576 with one actionable finding:
Everything else looks correct — all 32 boolean flags are verified as genuinely boolean in their yargs definitions, the changeset is properly formatted, and the test exercises the full sanitization pipeline. |
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: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
1f7d4d7 to
34aa994
Compare
Common boolean flags like --remote, --json, --dry-run, --force and others were unintentionally dropped from sanitizedArgs when argument sanitisation was introduced. The COMMAND_ARG_ALLOW_LIST was too conservative, only permitting --format and --log-level globally. Boolean flags are inherently safe (values are only true/false), so these have been added back. Fixed-choice args (--local-protocol, etc.) have also been added with their known value sets.
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
5146aba to
d41a3ab
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers |
Fixes the issue where common CLI flags like
--remote,--json,--dry-run,--force, and many others were being silently dropped fromsanitizedArgsin telemetry events.When argument sanitisation was introduced, the
COMMAND_ARG_ALLOW_LISTwas very conservative — only--formatand--log-levelwere permitted globally. Any arg not in the list had its value completely dropped fromsanitizedArgsbysanitizeArgValues. These flags were previously tracked and were unintentionally removed as part of the sanitisation process.This PR expands the allow list with:
*entry (inherently safe — values are onlytrue/false):json,force,remote,local,dryRun,preview,yes,skipConfirmation,noBundle,bundle,minify,latest,uploadSourceMaps,legacyEnv,liveReload,keepVars,logpush,strict,testScheduled,showInteractiveDevSession,skipCaching,commitDirty,includeRuntime,includeEnv,strictVars,check,useRemote,updateConfig,nodeCompat,enableContainers,xAutoconfig,ignoreDefaultslocalProtocolandupstreamProtocolfordev(["http", "https"]),containersRolloutfordeploy(["immediate", "gradual"])An integration test has been added that exercises the full sanitisation pipeline (sanitizeArgKeys → getAllowedArgs → sanitizeArgValues) against the real
COMMAND_ARG_ALLOW_LISTto verify flags like--remotenow pass through correctly.