-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better messaging in remote mode (#5107)
* Partial refactor: remove zoneID from `getZoneIdHostAndRoutes()` `zoneId` is only fetched in remote mode. Whether or not Wrangler is in remote mode can be decided further down the call stack than this function, and so when Wrangler is switched between local mode and remote mode the `zoneId` value returned from this function is stale. The `host` and `routes` returned from this function are always the same regardless of remote mode/local mode * Remove `zone` and `zoneId` from props & typing * Get zone in `remote.tsx` and only switch host when running a zone preview * More detailed error messages + tests * Fix snapshots * changesets * Remove .only * fix build * Make e2e validation stricter * Fix tests & push inferred host down in call stack * setTimeout -> retry * strip ansi
- Loading branch information
Showing
17 changed files
with
385 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: Ensures that switching to remote mode during a dev session (from local mode) will correctly use the right zone. Previously, zone detection happened before the dev session was mounted, and so dev sessions started with local mode would have no zone inferred, and would have failed to start, with an ugly error. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: Ensure that preview sessions created without a zone don't switch the host on which to start the preview from the one returned by the API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
import assert from "node:assert"; | ||
|
||
assert( | ||
process.env.CLOUDFLARE_ACCOUNT_ID, | ||
"Please provide a CLOUDFLARE_ACCOUNT_ID as an environment variable" | ||
); | ||
|
||
export const CLOUDFLARE_ACCOUNT_ID = process.env.CLOUDFLARE_ACCOUNT_ID; | ||
export const CLOUDFLARE_ACCOUNT_ID = process.env | ||
.CLOUDFLARE_ACCOUNT_ID as string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export const WRANGLER = | ||
process.env.WRANGLER ?? `pnpm --silent dlx wrangler@beta`; | ||
export const WRANGLER = process.env.WRANGLER as string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import assert from "node:assert"; | ||
|
||
assert( | ||
process.env.WRANGLER, | ||
'You must provide a way to run Wrangler (WRANGLER="pnpm --silent dlx wrangler@beta" will run the latest beta)' | ||
); | ||
|
||
assert( | ||
process.env.CLOUDFLARE_ACCOUNT_ID, | ||
"You must provide a CLOUDFLARE_ACCOUNT_ID as an environment variable" | ||
); | ||
|
||
assert( | ||
process.env.CLOUDFLARE_API_TOKEN, | ||
"You must provide a CLOUDFLARE_API_TOKEN as an environment variable" | ||
); | ||
|
||
assert( | ||
process.env.CLOUDFLARE_ACCOUNT_ID === "8d783f274e1f82dc46744c297b015a2f", | ||
"You must run Wrangler's e2e tests against DevProd Testing" | ||
); | ||
|
||
export const setup = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import path from "path"; | ||
import { defineConfig } from "vitest/config"; | ||
|
||
export default defineConfig({ | ||
test: { | ||
testTimeout: 240_000, | ||
poolOptions: { | ||
threads: { | ||
singleThread: true, | ||
}, | ||
}, | ||
retry: 2, | ||
include: ["e2e/**/*.test.ts"], | ||
globalSetup: path.resolve(__dirname, "./validate-environment.ts"), | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.