Skip to content

wrangler: Hyperdrive dev bindings#4222

Merged
Skye-31 merged 5 commits intocloudflare:mainfrom
tmthecoder:tejas/add-hyperdrive-support
Nov 7, 2023
Merged

wrangler: Hyperdrive dev bindings#4222
Skye-31 merged 5 commits intocloudflare:mainfrom
tmthecoder:tejas/add-hyperdrive-support

Conversation

@tmthecoder
Copy link
Contributor

@tmthecoder tmthecoder commented Oct 18, 2023

Associated docs issue(s)/PR(s):

  • N/A

Author has included the following, where applicable:

Reviewer is to perform the following, as 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

Note for PR author:

We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label highlight pr review so future reviewers can take inspiration and learn from it.

@tmthecoder tmthecoder requested a review from a team as a code owner October 18, 2023 17:54
@changeset-bot
Copy link

changeset-bot bot commented Oct 18, 2023

🦋 Changeset detected

Latest commit: 7d5f3f4

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

@tmthecoder tmthecoder force-pushed the tejas/add-hyperdrive-support branch from 50e87ad to 8dc7983 Compare October 18, 2023 18:03
@tmthecoder tmthecoder force-pushed the tejas/add-hyperdrive-support branch from 8dc7983 to ff99153 Compare October 26, 2023 16:20
Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

Looking good! This should include some tests, ideally validating that this works end-to-end in local mode (have a look at the e2e folder for some example tests of Wrangler dev—ideally it would be good to validate that a mock postgres server is connected to by workerd)

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #4222 (7d5f3f4) into main (a4a89ae) will decrease coverage by 0.01%.
Report is 15 commits behind head on main.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4222      +/-   ##
==========================================
- Coverage   75.34%   75.34%   -0.01%     
==========================================
  Files         223      223              
  Lines       12341    12349       +8     
  Branches     3190     3194       +4     
==========================================
+ Hits         9298     9304       +6     
- Misses       3043     3045       +2     
Files Coverage Δ
packages/wrangler/src/dev/miniflare.ts 60.35% <33.33%> (-0.49%) ⬇️
packages/wrangler/src/dev.tsx 82.40% <0.00%> (-1.34%) ⬇️

... and 5 files with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Oct 26, 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/6775494867/npm-package-wrangler-4222

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

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

Or you can use npx with this latest build directly:

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

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


wrangler@3.15.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare workspace:* 3.20231025.1
workerd 1.20231030.0 1.20231030.0
workerd --version 1.20231030.0 2023-10-30

|

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

@tmthecoder
Copy link
Contributor Author

tmthecoder commented Oct 27, 2023

@penalosa Should be all set with tests as well. However the socket test won't work until cloudflare/miniflare#727 is merged in & miniflare is bumped here due to a small address formatting bug I found in my initial implementation there

@tmthecoder tmthecoder force-pushed the tejas/add-hyperdrive-support branch from 29d33c7 to 59e071c Compare October 27, 2023 14:38
@penalosa penalosa added e2e Run wrangler + vite-plugin e2e tests on a PR and removed e2e Run wrangler + vite-plugin e2e tests on a PR labels Oct 27, 2023
it("connects to a socket", async () => {
server.on("connection", (sock) => {
sock.on("data", (data) => {
expect(new TextDecoder().decode(data)).toBe("test string");
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this expect definitely run? What if the test exits too soon?

Copy link
Contributor

Choose a reason for hiding this comment

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

This may need wrapping in a new Promise() that's explicitly await in the test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yeah, that makes sense. Just wrapped it in a promise

Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

LGTM! Let's wait to merge until Miniflare is released and bumped on Monday, so that tests will pass

@tmthecoder tmthecoder force-pushed the tejas/add-hyperdrive-support branch 2 times, most recently from e6512ea to b1e7d8a Compare November 1, 2023 20:18
@tmthecoder
Copy link
Contributor Author

@penalosa Tests seem to pass locally now that miniflare is the latest in-workspace version. Are we able to rerun the flows here to make sure and then merge?

@tmthecoder tmthecoder force-pushed the tejas/add-hyperdrive-support branch from b1e7d8a to 75cde6a Compare November 1, 2023 20:28
import crypto from "node:crypto";
import * as nodeNet from "node:net";
import path from "node:path";
import { afterEach } from "node:test";
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be from vitest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Skye-31 Ah my bad, it should be changed now. Also fixed the formatting errors that caused tests to fail

@tmthecoder tmthecoder force-pushed the tejas/add-hyperdrive-support branch from 75cde6a to eb60fde Compare November 2, 2023 14:19
@tmthecoder
Copy link
Contributor Author

@rts-rob

@Skye-31 Skye-31 merged commit f867e01 into cloudflare:main Nov 7, 2023
@workers-devprod workers-devprod mentioned this pull request Nov 7, 2023
@tmthecoder tmthecoder deleted the tejas/add-hyperdrive-support branch November 7, 2023 18:19
@gp27 gp27 mentioned this pull request Jan 8, 2024
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.

3 participants