Repository navigation
Update capnproto and adapt to kj::HttpMethod becoming a class - #8910
Conversation
There was a problem hiding this comment.
Superseded by the review of
af618844.
This review, of ebebb28c
💬 Approved with comments — The adaptation to kj::HttpMethod becoming a class is mechanically correct and keeps behavior the same. The only notes are an untested new refusal path in RustWorkerInterface and its synchronous throw; neither blocks.
Findings: 1 info · 1 suggestion (2 are inline comments on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info · 1 suggestion
The adaptation is correct. The new refusal of methods kj doesn't list in RustWorkerInterface has no test, and it throws synchronously.
Recommendation: 💬 Optional Nits
- [INFO] No test covers the new refusal of
Known::OTHERmethods inRustWorkerInterface::request. (src/rust/worker/bridge.h:116) - [SUGGESTION]
KJ_REQUIREin a function that returns a promise throws synchronously instead of returning a rejected promise. (src/rust/worker/bridge.h:116)
View full review
The switch to method.known(), the casts in trace.c++, and the rewrapping at the Rust-to-C++ boundaries (kj-hyper, worker/ffi.h, worker-factory-rpc.c++) all look correct. There are two small points about the new guard in RustWorkerInterface::request (src/rust/worker/bridge.h:116):
- No test covers the new refusal of
Known::OTHERmethods. KJ_REQUIREthrows before a promise exists, so the failure doesn't reach the caller as a rejected promise.
✅ All other checks passed
🔒 Security: ✅ LGTM
The method allowlist in Request::constructor still holds: a method kj doesn't list maps to Known::OTHER, falls into default, and is rejected. RustWorkerInterface refuses OTHER methods before they reach Rust, so the check fails closed. validateMethod in trace.c++ still bounds the capnp value at BAN before the cast.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: ebebb28c
ebebb28 to
af61884
Compare
There was a problem hiding this comment.
Superseded by the review of
7fe5d7dd.
This review, of af618844
💬 Approved with comments — The capnproto bump and the adaptation to kj::HttpMethod becoming a class are correct and keep behavior the same. The two remaining notes on the new refusal path in RustWorkerInterface are an INFO and a SUGGESTION, and neither blocks.
Findings: 1 info · 1 suggestion
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info · 1 suggestion
The adaptation is correct. Two minor notes remain on the new guard in RustWorkerInterface::request.
Recommendation: 💬 Optional Nits
- [INFO] No test covers the new refusal of
Known::OTHERmethods inRustWorkerInterface::request. (src/rust/worker/bridge.h:116) - [SUGGESTION]
KJ_REQUIREin a function that returns a promise throws synchronously instead of returning a rejected promise. (src/rust/worker/bridge.h:116)
View full review
The only files changed since the last review are the capnproto pin bump in MODULE.bazel.lock and build/deps/gen/deps.MODULE.bazel. The commit, URL, strip_prefix and sha256 match between the two files.
The two earlier notes on src/rust/worker/bridge.h:116 still apply:
- No test covers the refusal of
Known::OTHERmethods. KJ_REQUIREthrows synchronously from a function that returns a promise.
✅ All other checks passed
🔒 Security: ✅ LGTM
The method allowlist in Request::constructor still fails closed. A method kj doesn't list maps to Known::OTHER, falls into default, and is rejected.
RustWorkerInterface refuses OTHER methods before they reach Rust. validateMethod in trace.c++ still bounds the capnp value at BAN before the cast.
The capnproto archive stays pinned by sha256 at the new commit.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: af618844
capnproto bd9bff30 makes kj::HttpMethod a value class that can also hold methods kj doesn't list (HttpMethod::Known::OTHER). Adapt to it without changing behavior: - Switch on method.known() rather than on the method itself. - Trace.FetchEventInfo still casts between kj and capnp method values, now through method.known(). - HttpMethod can no longer be forward-declared as an enum, so trace.h includes <kj/compat/http.h>. - The Rust bridge's HttpMethod mirrors kj::HttpMethod::Known, so Rust still sees only the methods kj lists. RustWorkerInterface refuses a request with any other method rather than pass it to Rust. - Request::getMethod() returns an ArrayPtr<const char>, as KJ_STRINGIFY(kj::HttpMethod) now does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
af61884 to
7fe5d7d
Compare
There was a problem hiding this comment.
💬 Approved with comments — The capnproto bump and the adaptation to kj::HttpMethod becoming a class are correct and keep behavior the same. The two remaining notes on the new refusal path in RustWorkerInterface are an INFO and a SUGGESTION, and neither blocks.
Findings: 1 info · 1 suggestion
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info · 1 suggestion
The adaptation is correct. Two minor notes remain on the new guard in RustWorkerInterface::request.
Recommendation: 💬 Optional Nits
- [INFO] No test covers the new refusal of
Known::OTHERmethods inRustWorkerInterface::request. (src/rust/worker/bridge.h:116) - [SUGGESTION]
KJ_REQUIREin a function that returns a promise throws synchronously instead of returning a rejected promise. (src/rust/worker/bridge.h:116)
View full review
The only files changed since the last review are the capnproto pin bump in MODULE.bazel.lock and build/deps/gen/deps.MODULE.bazel. The commit, URL, strip_prefix and sha256 match between the two files.
The two earlier notes on src/rust/worker/bridge.h:116 still apply:
- No test covers the refusal of
Known::OTHERmethods. KJ_REQUIREthrows synchronously from a function that returns a promise.
✅ All other checks passed
🔒 Security: ✅ LGTM
The method allowlist in Request::constructor still fails closed. A method kj doesn't list maps to Known::OTHER, falls into default, and is rejected.
RustWorkerInterface refuses OTHER methods before they reach Rust. validateMethod in trace.c++ still bounds the capnp value at BAN before the cast.
The capnproto archive stays pinned by sha256 at the new commit.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 7fe5d7dd — same changes as af618844, so this is that commit's review (no new review was run; line numbers are as of af618844)
capnproto bd9bff30 makes kj::HttpMethod a value class that can also hold methods kj doesn't list (HttpMethod::Known::OTHER). Adapt to it without changing behavior: