Skip to content

Commit

Permalink
[Wrangler] Added sub commands in the deployments (#2607)
Browse files Browse the repository at this point in the history
* Deployment Details
Added a positional in the 'Deployments' command <deployment-id>.
<deployment-id> will get the details of the deployment, including versioned script, bindings, and usage model information.

changeset added

snapshot for commands updated

removed stray quotes

* Deployment Rollbacks
Created a subcommand on deployments that allows for rolling back a deployment to a previous ID provided.

Changed the command structure to have 2 subcommands view and rollback

Improved the Changeset messaging and combined rollback

Update help messages

Added comfirmation prompt to Rollback

Implemented --yes flag with tests

Updated tests

comfirmation handles non-TTY environments automatically fixed tests to reflect that and removed --yes option

tests breaking in CI

Turn off chalk in tests

Update messaging with new copy for confirm prompt matching dashboard & removing the PUT response in output

snapshots updated

rollback accounts URL

* # This is a combination of 2 commits.
# This is the 1st commit message:

Update rollback fetch call and remove deployments request from publish

# This is the commit message #2:

destructure the one value we want from the result

* Update rollback fetch call and remove deployments request from publish

destructure the one value we want from the result

Have script upload msw always return response body

Update deployment tests

Fixed misc tests

Delete index.js

Added check for request on rollback tests

Fix issue with wrangler version appearing after prompt

* Fix `next(param)` in Pages Plugins (#2789)

* Add duplex to r2 put (#2793)

* Add changeset (#2795)

* Version Packages (#2791)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Add hyphens to all deployment ids

* Merge

* Automatically rollback to previous deployment if deployment id is not specified (#2841)

Co-authored-by: jjohnson <jjohnson@cloudflare.com>

* Have deployment view output in table (#2844)

* Add suggested changes and update wrangler docs

* Separate content into option on view command

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>

* Add message to rollback and restructre rollback commands (#2888)

* Add rollback reason

* fixup: Cleanup hanging prompt mocks in deployments tests

* Change structure for rollback commands

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
Co-authored-by: Samuel Macleod <smacleod@cloudflare.com>

* Remove showing script content in deployment view

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
Co-authored-by: Greg Brimble <gbrimble@cloudflare.com>
Co-authored-by: Somhairle MacLeòid <smacleod@cloudflare.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joshua Johnson <jspspike@gmail.com>
  • Loading branch information
6 people committed Mar 16, 2023
1 parent 6fd0624 commit 163dccf
Show file tree
Hide file tree
Showing 15 changed files with 958 additions and 350 deletions.
34 changes: 34 additions & 0 deletions .changeset/brown-wasps-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
"wrangler": minor
---

feature: add `wrangler deployment view` and `wrangler rollback` subcommands

`wrangler deployment view [deployment-id]` will get the details of a deployment, including bindings and usage model information. When using the `--content` option, the command will return the script content for that deployment.
This information can be used to help debug bad deployments or get insights on changes between deployments.

`wrangler rollback [deployment-id]` will rollback to a specific deployment in the runtime. This will be useful in situations like recovering from a bad
deployment quickly while resolving issues. If a deployment id is not specified wrangler will rollback to the previous deployment. This rollback only changes the code in the runtime and doesn't affect any code or configurations
in a developer's local setup.

example of `view <deployment-id>` output:

```ts
Deployment ID: 07d7143d-0284-427e-ba22-2d5e6e91b479
Created on: 2023-03-02T21:05:15.622446Z
Author: jspspike@gmail.com
Source: Upload from Wrangler 🤠
------------------------------------------------------------
Author ID: e5a3ca86e08fb0940d3a05691310bb42
Usage Model: bundled
Handlers: fetch
Compatibility Date: 2022-10-03
--------------------------bindings--------------------------
[[r2_buckets]]
binding = "MY_BUCKET"
bucket_name = "testr2"

[[kv_namespaces]]
id = "79300c6d17eb4180a07270f450efe53f"
binding = "yeee"
```
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,5 @@ _routes.generated.json
# Vendored npm dependencies
!vendor/*.tgz

# IntelliJ
# IntelliJ
.idea/

0 comments on commit 163dccf

Please sign in to comment.