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

fix(system-test): fix isolates use of hono #2124

Conversation

NathanFlurry
Copy link
Member

Changes

Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2025

Deploying rivet with  Cloudflare Pages  Cloudflare Pages

Latest commit: a4a8905
Status:🚫  Build failed.

View logs

Copy link
Member Author

NathanFlurry commented Mar 6, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR refactors the system test implementation to properly integrate Hono's WebSocket functionality across both Deno and Node.js environments, with unified WebSocket handling and improved type safety.

  • Modified /examples/misc/system-test/src/isolate/main.ts to use Deno's WebSocket upgrader with proper KV API validation
  • Updated /examples/misc/system-test/src/shared/server.ts to support both Deno and Node.js environments with unified WebSocket handling
  • Reduced resource allocation in /examples/misc/system-test/tests/client.ts from 250/256 to 100 CPU/memory units for containers
  • Added Deno types in /examples/misc/system-test/tsconfig.json for proper type checking across runtimes
  • Changed build script path in /examples/misc/system-test/rivet.jsonc to point to correct entry point src/isolate/main.ts

8 file(s) reviewed, 5 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +14 to +15
"@types/deno": "^2.2.0",
"@types/node": "^22.13.9",
Copy link

Choose a reason for hiding this comment

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

style: Using both @types/deno and @types/node could cause type conflicts since they may define overlapping globals differently

import { createNodeWebSocket } from "@hono/node-ws";
import { serve } from "@hono/node-server";

let injectWebSocket: any;
Copy link

Choose a reason for hiding this comment

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

style: avoid using 'any' type - should define proper type for injectWebSocket from @hono/node-ws

Comment on lines +70 to +71
() => upgradeWebSocket,
);
Copy link

Choose a reason for hiding this comment

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

logic: upgradeWebSocket should be passed directly, not wrapped in an arrow function

Suggested change
() => upgradeWebSocket,
);
upgradeWebSocket,
);

// Setup auto-exit timer
setTimeout(() => {
console.error(
"Actor should've been destroyed by now. Automatically exiting.",
);
exitFn();
() => process.exit(1)
Copy link

Choose a reason for hiding this comment

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

logic: The process.exit(1) call is wrapped in an arrow function that is never executed

Suggested change
() => process.exit(1)
process.exit(1)


// Add WebSocket endpoint with handler
let upgradeWebSocket = getUpgradeWebSocket(app);
Copy link

Choose a reason for hiding this comment

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

style: let is used but the variable is never reassigned - should be const

@MasterPtato MasterPtato force-pushed the 03-06-fix_system-test_fix_isolates_use_of_hono branch from 3424da5 to ec9a121 Compare March 6, 2025 02:38
@NathanFlurry NathanFlurry force-pushed the 03-06-fix_system-test_fix_isolates_use_of_hono branch from ec9a121 to a4a8905 Compare March 6, 2025 03:30
@NathanFlurry NathanFlurry force-pushed the docs_add_helm_rollback_troubleshooting_guide branch from 2dc32f4 to a5ffea8 Compare March 6, 2025 03:30
Copy link
Contributor

graphite-app bot commented Mar 6, 2025

Merge activity

  • Mar 6, 4:30 AM EST: A user added this pull request to the Graphite merge queue.
  • Mar 6, 4:31 AM EST: CI is running for this PR on a draft PR: #2130
  • Mar 6, 4:32 AM EST: A user merged this pull request with the Graphite merge queue via draft PR: #2130.

graphite-app bot pushed a commit that referenced this pull request Mar 6, 2025
<!-- Please make sure there is an issue that this PR is correlated to. -->

## Changes

<!-- If there are frontend changes, please include screenshots. -->
@graphite-app graphite-app bot deleted the branch docs_add_helm_rollback_troubleshooting_guide March 6, 2025 09:32
@graphite-app graphite-app bot closed this Mar 6, 2025
@graphite-app graphite-app bot closed this Mar 6, 2025
@graphite-app graphite-app bot deleted the 03-06-fix_system-test_fix_isolates_use_of_hono branch March 6, 2025 09:32
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.

1 participant