-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wrangler deploy prompts warning with deployment (#5992)
* feat: wrangler deploy prompts warning with deployment * fix: wrangler deploy prompts warning with deployment styling Styling of the warning about multiple deployments during `wrangler deploy` should be consistent with `wrangler versions` styling. * Fix typo in packages/wrangler/src/versions/deploy.ts Co-authored-by: Rahul Sethi <[email protected]> * Fix typo in packages/wrangler/src/versions/deploy.ts Co-authored-by: Rahul Sethi <[email protected]> --------- Co-authored-by: Daniel Rivas <[email protected]> Co-authored-by: Rahul Sethi <[email protected]>
- Loading branch information
1 parent
88ca59b
commit c13fb91
Showing
8 changed files
with
265 additions
and
29 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
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
97 changes: 97 additions & 0 deletions
97
packages/wrangler/src/__tests__/helpers/msw/handlers/versions.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,102 @@ | ||
import { http, HttpResponse } from "msw"; | ||
import { createFetchResult } from "../index"; | ||
import type { ApiDeployment, ApiVersion } from "../../../../versions/types"; | ||
|
||
export const mswListNewDeploymentsLatestFull = [ | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/deployments", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
deployments: [ | ||
{ | ||
id: `deployment:${params["scriptName"]}`, | ||
source: "api", | ||
strategy: "percentage", | ||
author_email: "[email protected]", | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
versions: [ | ||
{ | ||
version_id: `${params["scriptName"]}:version:0`, | ||
percentage: 100.0, | ||
}, | ||
], | ||
}, | ||
] as Array<ApiDeployment>, | ||
}) | ||
); | ||
}, | ||
{ once: true } | ||
), | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/versions/:version", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
id: params["version"], | ||
number: 1, | ||
metadata: { | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
modified_on: "2021-01-01T00:00:00.000000Z", | ||
source: "api", | ||
author_email: "[email protected]", | ||
}, | ||
} as ApiVersion) | ||
); | ||
}, | ||
{ once: false } | ||
), | ||
]; | ||
|
||
export const mswListNewDeploymentsLatestFiftyFifty = [ | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/deployments", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
deployments: [ | ||
{ | ||
id: `deployment:${params["scriptName"]}`, | ||
source: "api", | ||
strategy: "percentage", | ||
author_email: "[email protected]", | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
versions: [ | ||
{ | ||
version_id: `${params["scriptName"]}:version:0`, | ||
percentage: 50.0, | ||
}, | ||
{ | ||
version_id: `${params["scriptName"]}:version:1`, | ||
percentage: 50.0, | ||
}, | ||
], | ||
}, | ||
] as Array<ApiDeployment>, | ||
}) | ||
); | ||
}, | ||
{ once: true } | ||
), | ||
http.get( | ||
"*/accounts/:accountId/workers/scripts/:scriptName/versions/:version", | ||
({ params }) => { | ||
return HttpResponse.json( | ||
createFetchResult({ | ||
id: params["version"], | ||
number: 1, | ||
metadata: { | ||
created_on: "2021-01-01T00:00:00.000000Z", | ||
modified_on: "2021-01-01T00:00:00.000000Z", | ||
source: "api", | ||
author_email: "[email protected]", | ||
}, | ||
} as ApiVersion) | ||
); | ||
}, | ||
{ once: false } | ||
), | ||
]; | ||
|
||
export const mswListNewDeployments = http.get( | ||
"*/accounts/:accountId/workers/scripts/:workerName/deployments", | ||
|
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
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.