Skip to content

cloudflare: omit unsupported --keep-vars for wrangler versions upload#702

Merged
theoephraim merged 3 commits into
mainfrom
copilot/fix-varlock-wrangler-cli-flag
May 13, 2026
Merged

cloudflare: omit unsupported --keep-vars for wrangler versions upload#702
theoephraim merged 3 commits into
mainfrom
copilot/fix-varlock-wrangler-cli-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

varlock-wrangler treated deploy and versions upload identically and always appended --keep-vars=false. Wrangler 4.x does not support that flag on versions upload, causing hard failure with Unknown arguments: keep-vars, keepVars.

  • CLI argument handling

    • Added explicit command detection for versions upload.
    • Updated deploy path to only append --keep-vars=false for deploy, not versions upload.
    • Kept all existing env/secrets injection behavior unchanged for both flows.
  • Focused regression coverage

    • Added a targeted test for varlock-wrangler argument construction using a stubbed wrangler binary.
    • Verifies:
      • versions upload does not receive --keep-vars=false
      • deploy does receive --keep-vars=false
const wranglerArgs = [...args, ...varFlags, '--secrets-file', tmp.filePath];
if (!isVersionsUploadCommand(args)) wranglerArgs.push('--keep-vars=false');
exitCode = await spawnWrangler(wranglerArgs);

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.iconify.design
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node --experimental-import-meta-resolve --require /home/REDACTED/work/varlock/varlock/node_modules/.bun/vitest@4.1.5+aa8dd106732c7af1/node_modules/vitest/suppress-warnings.cjs --conditions node --conditions development /home/REDACTED/work/varlock/varlock/node_modules/.bun/vitest@4.1.5+aa8dd106732c7af1/node_modules/vitest/dist/workers/forks.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix invalid '--keep-vars' flag in varlock-wrangler cloudflare: omit unsupported --keep-vars for wrangler versions upload May 13, 2026
Copilot AI requested a review from theoephraim May 13, 2026 01:11
- Add process.exitCode assignment in handleDeploy and handleTypes so
  wrangler failures correctly exit non-zero (fixes #703)
- Remove copilot-generated test file (unnecessary)
- Update changeset to cover both fixes
@github-actions
Copy link
Copy Markdown
Contributor

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • @varlock/cloudflare-integration 1.1.1 → 1.1.2

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@theoephraim theoephraim marked this pull request as ready for review May 13, 2026 23:20
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@varlock/cloudflare-integration@702

commit: 94f0453

@theoephraim theoephraim merged commit 3c994c4 into main May 13, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: varlock-wrangler passes invalid --keep-vars CLI flag to wrangler

2 participants