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

feat: secrets + environments #523

Merged
merged 1 commit into from
Feb 24, 2022
Merged

feat: secrets + environments #523

merged 1 commit into from
Feb 24, 2022

Conversation

threepointone
Copy link
Contributor

This implements environment support for wrangler secret (both legacy and services). We now consistently generate the right script name across commands with the getScriptName() helper.

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2022

🦋 Changeset detected

Latest commit: ff8ea80

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

This PR includes changesets to release 1 package
Name Type
wrangler 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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 24, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/1892950702/npm-package-wrangler-523

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

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/523/npm-package-wrangler-523

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/1892950702/npm-package-wrangler-523 dev path/to/script.js

await fetchResult(
`/accounts/${config.account_id}/workers/scripts/${scriptName}`,
!args["legacy-env"] && args.env
Copy link
Contributor Author

Choose a reason for hiding this comment

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

filed #524 to write tests for this codepath, looks like I missed it last time around

This implements environment support for `wrangler secret` (both legacy and services). We now consistently generate the right script name across commands with the `getScriptName()` helper.
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

LGTM

@threepointone
Copy link
Contributor Author

I tested this pretty decently, and it works ok. There's one bug I discovered with the api, I'll file that internally. Landing this.

@threepointone threepointone merged commit 8c99449 into main Feb 24, 2022
@threepointone threepointone deleted the secret-envs branch February 24, 2022 15:52
@github-actions github-actions bot mentioned this pull request Feb 24, 2022
mrbbot added a commit that referenced this pull request Oct 31, 2023
Similar to #475, we weren't deleting the `MF-Original-URL` header
from incoming requests, leading to incorrect URLs in the loopback
server when the incoming request was passed-through as the cache key.

Tests also needed to be updated as the storage location is now based
off the actual URL passed to `dispatchFetch()`.
mrbbot added a commit that referenced this pull request Nov 1, 2023
Similar to #475, we weren't deleting the `MF-Original-URL` header
from incoming requests, leading to incorrect URLs in the loopback
server when the incoming request was passed-through as the cache key.

Tests also needed to be updated as the storage location is now based
off the actual URL passed to `dispatchFetch()`.
mrbbot added a commit that referenced this pull request Nov 1, 2023
Similar to #475, we weren't deleting the `MF-Original-URL` header
from incoming requests, leading to incorrect URLs in the loopback
server when the incoming request was passed-through as the cache key.

Tests also needed to be updated as the storage location is now based
off the actual URL passed to `dispatchFetch()`.
mrbbot added a commit that referenced this pull request Nov 1, 2023
Similar to #475, we weren't deleting the `MF-Original-URL` header
from incoming requests, leading to incorrect URLs in the loopback
server when the incoming request was passed-through as the cache key.

Tests also needed to be updated as the storage location is now based
off the actual URL passed to `dispatchFetch()`.
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.

2 participants