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

startDevWorker Milestone 1 - Reboot #4175

Closed
wants to merge 34 commits into from

Conversation

RamIdeas
Copy link
Contributor

@RamIdeas RamIdeas commented Oct 13, 2023

This is the PR to reintroduce #3960

TODO:

What this PR solves / how to test:

Please use the prerelease builds in the bot comment below to test: wrangler dev, wrangler dev --remote, unstable_dev() in local and remote mode, on your setup and post your issues in comments below

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

  • [insert associated docs issue(s)/PR(s)]

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.

@RamIdeas RamIdeas requested a review from a team as a code owner October 13, 2023 13:38
@changeset-bot
Copy link

changeset-bot bot commented Oct 13, 2023

⚠️ No Changeset found

Latest commit: b55a13a

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 no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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 Oct 13, 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/6720209255/npm-package-wrangler-4175

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

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

Or you can use npx with this latest build directly:

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

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


[email protected] includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20231025.1 3.20231025.1
workerd 1.20231025.0 1.20231025.0
workerd --version 1.20231025.0 2023-10-25

|

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

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #4175 (83af6d8) into main (e4aff81) will increase coverage by 0.26%.
Report is 265 commits behind head on main.
The diff coverage is 51.61%.

❗ Current head 83af6d8 differs from pull request most recent head b55a13a. Consider uploading reports for the commit b55a13a to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4175      +/-   ##
==========================================
+ Coverage   75.38%   75.65%   +0.26%     
==========================================
  Files         223      237      +14     
  Lines       12327    12507     +180     
  Branches     3187     3198      +11     
==========================================
+ Hits         9293     9462     +169     
- Misses       3034     3045      +11     
Files Coverage Δ
packages/wrangler/src/api/index.ts 100.00% <100.00%> (ø)
.../wrangler/src/api/startDevWorker/BaseController.ts 100.00% <100.00%> (ø)
...gler/src/api/startDevWorker/NotImplementedError.ts 100.00% <100.00%> (ø)
...ckages/wrangler/src/api/startDevWorker/devtools.ts 100.00% <100.00%> (ø)
packages/wrangler/src/api/startDevWorker/types.ts 100.00% <100.00%> (ø)
packages/wrangler/src/dev.tsx 83.53% <ø> (-0.21%) ⬇️
packages/wrangler/src/dev/miniflare.ts 66.86% <100.00%> (+6.02%) ⬆️
packages/wrangler/src/https-options.ts 100.00% <100.00%> (ø)
packages/wrangler/src/api/dev.ts 82.60% <75.00%> (ø)
packages/wrangler/src/api/startDevWorker/index.ts 50.00% <50.00%> (ø)
... and 13 more

... and 25 files with indirect coverage changes

@penalosa
Copy link
Contributor

@RamIdeas would it be possible to separate out the individual bug fixes into separate PRs?

@RamIdeas
Copy link
Contributor Author

@RamIdeas would it be possible to separate out the individual bug fixes into separate PRs?

@penalosa the 2 commits to fix 2 of the bugs were quite tiny and encapsulated in individual commits. I think reviewing each commit will be easy enough

If there are bigger changes, I will absolutely open a separate PR 👍

@RamIdeas RamIdeas force-pushed the startDevWorker-milestone-1-reboot branch from cdfb63c to 83af6d8 Compare October 18, 2023 21:36
Cyb3r-Jak3 added a commit to Cyb3r-Jak3/workers-serverless-api that referenced this pull request Oct 20, 2023
@Cyb3r-Jak3
Copy link
Contributor

I tested this in my project and seeing warning released to Your worker created multiple branches of a single stream... with this version workflow (in the test stage) whereas the latest wrangler dev didn't have those errors workflow.

When testing locally on Windows 10 I also get the following additional messages to stderr

stderr | src/git.test.ts > Git Endpoints > Git Repos
workerd/jsg/util.c++:275: error: e = workerd/util/sqlite.c++:894: failed: SQLite failed; sqlite3_errmsg(db) = cannot commit transaction - SQL statements in progress;  sqlite3_step()
stack: 7ff60e46d2af 7ff60e802419 7ff60e8ada63 0; sentryErrorContext = jsgInternalError
workerd/jsg/util.c++:275: error: e = workerd/util/sqlite.c++:894: failed: SQLite failed; sqlite3_errmsg(db) = cannot commit transaction - SQL statements in progress;  sqlite3_step()
stack: 7ff60e46d2af 7ff60e802419 7ff60e8ada63 0; sentryErrorContext = jsgInternalError

stderr | src/git.test.ts > Git Endpoints > Git User
workerd/jsg/util.c++:275: error: e = kj/filesystem-disk-win32.c++:249: failed: DeleteFileW(path.begin()): cloudflare/workers-sdk#5 Access is denied.; dbgStr(path) = \\?\F:\git\workers\severless-api\.wrangler\state\v3\kv\a3030e4701ed406ba337ca8bd9108dda\blobs\3c82b7cd5bfbf427963c8519cc2107c742efd2080a295d5fee70ef81031353690000022f9a055c8c
stack: 7ff60e46d2af 7ff60e498d9a 7ff60e7748ef 0 0; sentryErrorContext = jsgInternalError

@lrapoport-cf lrapoport-cf added the awaiting Cloudflare response Awaiting response from workers-sdk maintainer team label Oct 23, 2023
@jadbox
Copy link

jadbox commented Oct 24, 2023

Does this help with supporting wranger pages dev --remote?

@RamIdeas RamIdeas force-pushed the startDevWorker-milestone-1-reboot branch 2 times, most recently from 7ee52ca to f698350 Compare October 25, 2023 16:32
@RamIdeas RamIdeas closed this Oct 26, 2023
@RamIdeas RamIdeas reopened this Oct 26, 2023
unless log level is debug

change ProxyControllerLogger info override to log override
change WranglerLog info override to log override
-- this worksaround an internal Miniflare change
remote inspector websocket upgrade request required auth headers
so use `fetch` with `Upgrade: websocket` header instead of `new WebSocket`
This reverts commit 1e6879b.

This commit will be reapplied in the Milestone 2 PR.
for (Inspector)ProxyWorker
upon UserWorker restarts
previously, sequential cleanups fail to fully cleanup if earlier steps in the sequence fail
@RamIdeas RamIdeas force-pushed the startDevWorker-milestone-1-reboot branch from c1b209c to 2bf4d46 Compare October 31, 2023 15:35
remove assertion proxyWorker miniflare instance is different
@RamIdeas RamIdeas force-pushed the startDevWorker-milestone-1-reboot branch from 55fc364 to 7cf9069 Compare October 31, 2023 16:04
@RamIdeas RamIdeas force-pushed the startDevWorker-milestone-1-reboot branch from 436a320 to 9cc5516 Compare October 31, 2023 17:46
@RamIdeas RamIdeas requested a review from a team as a code owner November 1, 2023 12:40
@RamIdeas RamIdeas closed this Nov 2, 2023
@RamIdeas RamIdeas reopened this Nov 2, 2023
to force different port across reloads to workaround workerd bug on Windows
@RamIdeas RamIdeas force-pushed the startDevWorker-milestone-1-reboot branch from eae8bec to 6b99cab Compare November 2, 2023 15:50
@RamIdeas RamIdeas closed this Nov 2, 2023
@RamIdeas RamIdeas reopened this Nov 2, 2023
@RamIdeas
Copy link
Contributor Author

Hi @Cyb3r-Jak3! Thanks for your feedback and apologies for the delay. We used your test suite to analyse the stability of these changes. Github got a bit confused with this PR and so I closed this and opened a new PR #4413 – could you try the prerelease build from there and let us know how it goes please?

@RamIdeas
Copy link
Contributor Author

@jadbox although we are not focusing on pages dev directly, wrangler pages dev uses unstable_dev under-the-hood and therefore will benefit from the changes and stability improvements indirectly

@RamIdeas RamIdeas removed the awaiting Cloudflare response Awaiting response from workers-sdk maintainer team label Nov 22, 2023
@lrapoport-cf lrapoport-cf linked an issue Jan 10, 2024 that may be closed by this pull request
@lrapoport-cf lrapoport-cf added this to the Wrangler as a Library milestone Jan 10, 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.

🚀 Stabilizing unstable_dev and expanding Wrangler as an API
5 participants