workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

Feature: `dispatch-namespace` option in `wrangler deploy`

Open benycodes opened this issue 1 year ago • 1 comments
trafficstars

What this PR solves / how to test: Ability to deploy workers to dispatch namespaces (Workers for Platforms product).

Usage: wrangler deploy --dispatch-namespace <namespace>

This is an improvement to PR #2746 because:

  • Correct terminology of 'dispatch namespace' used instead of 'platform namespace'.
  • Excludes tasks related to routes. custom domains. cron/schedules, and queue consumers when dispatch-namespace option used (these features aren't supported in Workers for Platforms)
  • Allows for any name to be used for the script when dispatch-namespace option used, because Workers for Platforms doesn't check script names

benycodes avatar Feb 25 '24 18:02 benycodes

🦋 Changeset detected

Latest commit: 97210b97eba0d874554b0f6b5c9ff63c00101b1d

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

This PR includes changesets to release 2 packages
Name Type
wrangler Minor
@cloudflare/vitest-pool-workers Patch

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

changeset-bot[bot] avatar Feb 25 '24 18:02 changeset-bot[bot]

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-wrangler-5093

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/5093/npm-package-wrangler-5093

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-wrangler-5093 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-create-cloudflare-5093 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-cloudflare-kv-asset-handler-5093
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-miniflare-5093
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-cloudflare-pages-shared-5093
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/8283476292/npm-package-cloudflare-vitest-pool-workers-5093

Note that these links will no longer work once the GitHub Actions artifact expires.


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240304.2
workerd 1.20240304.0 1.20240304.0
workerd --version 1.20240304.0 2024-03-04

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

github-actions[bot] avatar Mar 07 '24 19:03 github-actions[bot]

Codecov Report

Attention: Patch coverage is 95.23810% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 71.50%. Comparing base (cab7e1c) to head (97210b9). Report is 84 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5093      +/-   ##
==========================================
+ Coverage   70.33%   71.50%   +1.16%     
==========================================
  Files         298      309      +11     
  Lines       15515    16097     +582     
  Branches     3987     4111     +124     
==========================================
+ Hits        10913    11510     +597     
+ Misses       4602     4587      -15     
Files Coverage Δ
...angler/src/__tests__/helpers/mock-upload-worker.ts 100.00% <100.00%> (ø)
packages/wrangler/src/config/validation.ts 89.73% <100.00%> (+0.03%) :arrow_up:
packages/wrangler/src/deploy/deploy.ts 89.95% <100.00%> (+0.20%) :arrow_up:
packages/wrangler/src/deploy/index.ts 95.74% <50.00%> (-1.03%) :arrow_down:

... and 43 files with indirect coverage changes

codecov[bot] avatar Mar 07 '24 19:03 codecov[bot]

Thanks for the PR @benycodes I've pushed some changes to simplify along with adding a changeset and tests. From my side, this is good to go now :)

Appreciate it!

WalshyDev avatar Mar 11 '24 20:03 WalshyDev

thank you so much to both of you for taking this PR across the finish line <3

CarmenPopoviciu avatar Mar 14 '24 16:03 CarmenPopoviciu