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: dev+envs #532

Merged
merged 1 commit into from
Mar 2, 2022
Merged

feat: dev+envs #532

merged 1 commit into from
Mar 2, 2022

Conversation

threepointone
Copy link
Contributor

This implements service environments + wrangler dev. Fairly simple, it just needed the right url when creating the edge preview token.

I tested this by publishing a service under one env, adding secrets under it in the dashboard, and then trying to dev under another env, and verifying that the secrets didn't leak.

(This uncovered an issue where we can't set the right host incl. the env prefix, but it's not critical right now, following up internally.)

@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2022

🦋 Changeset detected

Latest commit: b3654be

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 28, 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/1924516548/npm-package-wrangler-532

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

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

Or you can use npx with this latest build directly:

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

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.

This all looks like it should work, although I have not run it locally :-)

There doesn't seem to be much point in separate CfAccount and CfWorkerContext interfaces any more. They are always used as a pair, AFAICT. So how about just join them up into a single CfWorkerContext interface?

This implements service environments + `wrangler dev`. Fairly simple, it just needed the right url when creating the edge preview token.

I tested this by publishing a service under one env, adding secrets under it in the dashboard, and then trying to dev under another env, and verifying that the secrets didn't leak.
@threepointone
Copy link
Contributor Author

Agreed about the type, and I'll merge the CfAccount and CfWorkerContext types in a followup PR.

@threepointone threepointone merged commit 046b17d into main Mar 2, 2022
@threepointone threepointone deleted the dev-envs branch March 2, 2022 20:38
@github-actions github-actions bot mentioned this pull request Mar 2, 2022
mrbbot added a commit that referenced this pull request Oct 31, 2023
Wait for control messages using the new `--control-fd` flag for
signalling when `workerd` is ready to receive requests, and the port
it's listening on. This allows us to pass port `0` directly to
workerd, and have it allocate a free port, preventing races. It also
allows us to remove the repeated readiness probes. 🎉
mrbbot added a commit that referenced this pull request Nov 1, 2023
Wait for control messages using the new `--control-fd` flag for
signalling when `workerd` is ready to receive requests, and the port
it's listening on. This allows us to pass port `0` directly to
workerd, and have it allocate a free port, preventing races. It also
allows us to remove the repeated readiness probes. 🎉
mrbbot added a commit that referenced this pull request Nov 1, 2023
Wait for control messages using the new `--control-fd` flag for
signalling when `workerd` is ready to receive requests, and the port
it's listening on. This allows us to pass port `0` directly to
workerd, and have it allocate a free port, preventing races. It also
allows us to remove the repeated readiness probes. 🎉
mrbbot added a commit that referenced this pull request Nov 1, 2023
Wait for control messages using the new `--control-fd` flag for
signalling when `workerd` is ready to receive requests, and the port
it's listening on. This allows us to pass port `0` directly to
workerd, and have it allocate a free port, preventing races. It also
allows us to remove the repeated readiness probes. 🎉
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