Skip to content

Display a more helpful error when publishing to a route in use by another worker - #2023

Merged
caass merged 4 commits into
mainfrom
wrangler-publish-warn-custom-routes
Oct 14, 2022
Merged

caass merged 4 commits into
mainfrom
wrangler-publish-warn-custom-routes

Conversation

@caass

@caass caass commented Oct 13, 2022 •

Copy link
Copy Markdown
Contributor

Display a more helpful error when trying to publish to a route in use by another worker.

Previously, when trying to publish a worker to a route that was in use by another worker,
there would be a really unhelpful message about a failed API call. Now, there's a much
nicer message that tells you what worker is running on that route, and gives you a link
to the workers overview page so you can unassign it if you want.

 ⛅️ wrangler 2.1.11
--------------------
Total Upload: 0.20 KiB / gzip: 0.17 KiB

✘ [ERROR] Can't publish a worker to routes that are assigned to another worker.

  "test-custom-routes-redeploy" is already assigned to route
  test-custom-worker.swag.lgbt

  Unassign other workers from the routes you want to publish to, and then try again.
  Visit
  https://dash.cloudflare.com/<account_id>/workers/overview
  to unassign a worker from a route.

Closes #1849

@changeset-bot

changeset-bot Bot commented Oct 13, 2022 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e1a0eda

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions

github-actions Bot commented Oct 13, 2022 •

Copy link
Copy Markdown
Contributor

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/3249591395/npm-package-wrangler-2023

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/2023/npm-package-wrangler-2023

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/3249591395/npm-package-wrangler-2023 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.developers.workers.dev/runs/3249591395/npm-package-cloudflare-pages-shared-2023

@codecov

codecov Bot commented Oct 13, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #2023 (e1a0eda) into main (932fecc) will decrease coverage by 0.16%.
The diff coverage is 12.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2023      +/-   ##
==========================================
- Coverage   72.77%   72.61%   -0.17%     
==========================================
  Files         122      122              
  Lines        8368     8392      +24     
  Branches     2197     2203       +6     
==========================================
+ Hits         6090     6094       +4     
- Misses       2278     2298      +20     
Impacted Files Coverage Δ
packages/wrangler/src/publish/publish.ts 85.71% <12.50%> (-5.90%) ⬇️
...ackages/wrangler/src/__tests__/helpers/mock-bin.ts 100.00% <0.00%> (+5.26%) ⬆️

@penalosa penalosa left a comment

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.

Couple comments, but looks good!

Comment thread packages/wrangler/src/publish/publish.ts Outdated
Comment thread packages/wrangler/src/publish/publish.ts Outdated
Comment thread packages/wrangler/src/publish/publish.ts Outdated
Comment thread packages/wrangler/src/publish/publish.ts Outdated
@caass
caass force-pushed the wrangler-publish-warn-custom-routes branch from 7962322 to e1a0eda Compare October 14, 2022 11:26
@caass
caass merged commit d6660ce into main Oct 14, 2022
@caass
caass deleted the wrangler-publish-warn-custom-routes branch October 14, 2022 11:40
@github-actions github-actions Bot mentioned this pull request Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 BUG: publish fails when attempting to publish a Worker to routes that already exist

4 participants