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

Version secrets + secret behaviour changes #5950

Merged
merged 1 commit into from
Jun 20, 2024
Merged

Version secrets + secret behaviour changes #5950

merged 1 commit into from
Jun 20, 2024

Conversation

WalshyDev
Copy link
Member

@WalshyDev WalshyDev commented May 31, 2024

What this PR solves / how to test

  • Adds new versions secret commands (put, bulk, list and view).
  • Adds a --pretty option to wrangler secret list
  • Handles the new API error in rollback when attempting to rollback to a version with changed secrets from current

Author has addressed the following

  • Tests
    • TODO (before merge)
    • Included
    • Not necessary because:
  • E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required / Maybe required
    • Not required because:
  • Changeset (Changeset guidelines)
    • TODO (before merge)
    • Included
    • Not necessary because:
  • Public documentation
    • TODO (after merge - experimental features)
    • Cloudflare docs PR(s):
    • Not necessary because:

Screenshots

Version in dash
image

Copy link

changeset-bot bot commented May 31, 2024

🦋 Changeset detected

Latest commit: 3b660ad

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

This PR includes changesets to release 2 packages
Name Type
wrangler Minor
@cloudflare/vitest-pool-workers 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

Copy link
Contributor

github-actions bot commented May 31, 2024

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/9599437036/npm-package-wrangler-5950

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

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

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9599437036/npm-package-wrangler-5950 dev path/to/script.js
Additional artifacts:
npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9599437036/npm-package-create-cloudflare-5950 --no-auto-update
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9599437036/npm-package-cloudflare-kv-asset-handler-5950
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9599437036/npm-package-miniflare-5950
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9599437036/npm-package-cloudflare-pages-shared-5950
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/9599437036/npm-package-cloudflare-vitest-pool-workers-5950

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


wrangler@3.61.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20240610.1
workerd 1.20240610.1 1.20240610.1
workerd --version 1.20240610.1 2024-06-10

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@WalshyDev WalshyDev force-pushed the walshy/WC-2235 branch 4 times, most recently from 31e1209 to 694464d Compare June 5, 2024 16:10
@tanushree-sharma
Copy link

tanushree-sharma commented Jun 5, 2024

Nice one with the automated versions message! Can we add one on delete of a secret too?
image

Know you're still polishing up so ignore if these are on your to-do:

  1. Only thing that should be updated / evaluated with the wrangler versions secret put command is secrets. Wrangler.toml warnings should not be shown
image
  1. Copy when creating a new secret (Deleting a secret should reflect similar language)
? Enter a secret value: › ***
🌀 Creating the secret for Worker worker-name
✨ Success! Created version XXX with secret FOO.
➡️ To deploy this version with secret FOO to production traffic use the command wrangler versions deploy.```







@WalshyDev WalshyDev force-pushed the walshy/WC-2235 branch 2 times, most recently from 2bc0741 to 4496743 Compare June 7, 2024 12:33
@tanushree-sharma
Copy link

Looking great. Some more feedback:

  1. Nit: Can we add a space between ➡️ and "To"
image
  1. Forgot the flag in the copy
    ➡️ To deploy this version with secret new-secret to production traffic use the command wrangler versions deploy --x-versions.

  2. Not seeing the version message populated anymore (I did wrangler secret put)

image
  1. wrangler secret list is showing warnings (similar to wrangler dev #1 in my message above)
image
  1. Not seeing updated output for wrangler versions view. Also shows the warning.
image

@WalshyDev WalshyDev force-pushed the walshy/WC-2235 branch 2 times, most recently from 90c7419 to f5f0917 Compare June 19, 2024 20:08
@WalshyDev WalshyDev marked this pull request as ready for review June 19, 2024 20:09
@WalshyDev WalshyDev requested review from a team as code owners June 19, 2024 20:09
@WalshyDev WalshyDev changed the title [wip] Version secret upload Version secrets + secret behaviour changes Jun 19, 2024
@WalshyDev WalshyDev force-pushed the walshy/WC-2235 branch 4 times, most recently from f7ed70a to 0d003c7 Compare June 19, 2024 20:37
@WalshyDev WalshyDev force-pushed the walshy/WC-2235 branch 6 times, most recently from fbb7dd3 to d2e14f0 Compare June 20, 2024 10:01
@WalshyDev WalshyDev force-pushed the walshy/WC-2235 branch 2 times, most recently from d1af9a5 to 8786cf8 Compare June 20, 2024 12:03
Copy link
Contributor

@CarmenPopoviciu CarmenPopoviciu left a comment

Choose a reason for hiding this comment

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

thx Walshy :meouw-heart:

@WalshyDev WalshyDev merged commit 0075621 into main Jun 20, 2024
19 checks passed
@WalshyDev WalshyDev deleted the walshy/WC-2235 branch June 20, 2024 15:00
@tanushree-sharma
Copy link

tanushree-sharma commented Jun 21, 2024

Know this has already been merged but I have feedback:

1. Rollback guardrail: If we detect that a user is rolling back to a version that has a different value for a secret, we should warn the user but give them the option to proceed anyway:

I set up a case to hit the guardrail and wrangler is getting stuck here:
image

It isn't until I cancel the operation that I see the warning
image

Also, this is what I'm seeing in dash:
image

We need a popup window rather than a banner.

2. I want to make the next step after wrangler versions secret put/delete clear to users and the best way to do that is to have “To deploy..” on the next line

Instead of:
image

This:
image

3. Can we add back the automatic version message when a secret has been updated? Currently the version message is blank

4. Reminder to implement wrangler versions view updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants