Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have deployment view output in table #2844

Merged

Conversation

jspspike
Copy link
Contributor

@jspspike jspspike commented Mar 2, 2023

Have new view for wrangler deployment view command
Example output

 ⛅️ wrangler 2.12.0
--------------------
🚧`wrangler deployments` is a beta command. Please report any issues to https://github.com/cloudflare/workers-sdk/issues/new/choose


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"

---------------------------script---------------------------

(() => {
  // index.js
  addEventListener("fetch", (event) => {
    event.respondWith(handleRequest(event.request));
  });
  async function handleRequest(request) {
    return new Response(JSON.stringify("Hello r2"), {
      headers: { "content-type": "text/plain" }
    });
  }
})();
//# sourceMappingURL=index.js.map

Author has included the following, where applicable:

  • Tests
  • Changeset

Reviewer has performed the following, where applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

Fixes # [insert issue number].

@jspspike jspspike requested a review from a team as a code owner March 2, 2023 21:18
@changeset-bot
Copy link

changeset-bot bot commented Mar 2, 2023

⚠️ No Changeset found

Latest commit: bff3c91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 1 package
Name Type
wrangler Minor

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2023

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/4327065671/npm-package-wrangler-2844

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4327065671/npm-package-wrangler-2844 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/4327065671/npm-package-cloudflare-pages-shared-2844

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

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

❗ No coverage uploaded for pull request base (jacobmgevans/deployment-view-rollback@aff4c8f). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                           Coverage Diff                            @@
##             jacobmgevans/deployment-view-rollback    #2844   +/-   ##
========================================================================
  Coverage                                         ?   74.13%           
========================================================================
  Files                                            ?      166           
  Lines                                            ?    10319           
  Branches                                         ?     2768           
========================================================================
  Hits                                             ?     7650           
  Misses                                           ?     2669           
  Partials                                         ?        0           

Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks like a great refactor and polishing up of the output!! There are a couple things to fix and a few linter issues.

.changeset/brown-wasps-fail.md Outdated Show resolved Hide resolved
packages/wrangler/src/deployments.ts Show resolved Hide resolved
packages/wrangler/src/deployments.ts Outdated Show resolved Hide resolved
@Skye-31
Copy link
Contributor

Skye-31 commented Mar 2, 2023

It might be a good idea to hide the contents of the script behind a flag or something similar - if someone has a large worker, such as a 5mb one, this would flood their terminal

Could also truncate the contents of the script if a flag isn't desired

@JacobMGEvans
Copy link
Contributor

It might be a good idea to hide the contents of the script behind a flag or something similar - if someone has a large worker, such as a 5mb one, this would flood their terminal

Could also truncate the contents of the script if a flag isn't desired

@admah Interesting thought.

@jspspike jspspike merged commit 302dcf3 into jacobmgevans/deployment-view-rollback Mar 3, 2023
@jspspike jspspike deleted the jspspike/deployment-view branch March 3, 2023 23:42
jspspike added a commit that referenced this pull request Mar 13, 2023
* Add suggested changes and update wrangler docs

* Separate content into option on view command

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
jspspike added a commit that referenced this pull request Mar 15, 2023
* Add suggested changes and update wrangler docs

* Separate content into option on view command

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
jspspike added a commit that referenced this pull request Mar 16, 2023
* Add suggested changes and update wrangler docs

* Separate content into option on view command

---------

Co-authored-by: jjohnson <jjohnson@cloudflare.com>
jspspike added a commit that referenced this pull request Mar 16, 2023
* 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>
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.

None yet

4 participants