Skip to content

Update capnproto and adapt to kj::HttpMethod becoming a class - #8910

Merged
mar-cf merged 1 commit into
mainfrom
mar/bump-capnproto-http-method
Nov 25, 2026
Merged

mar-cf merged 1 commit into
mainfrom
mar/bump-capnproto-http-method

Conversation

@mar-cf

@mar-cf mar-cf commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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, as KJ_STRINGIFY(kj::HttpMethod) now does.

@mar-cf
mar-cf requested review from a team as code owners November 25, 2026 20:42

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::OTHER methods in RustWorkerInterface::request. (src/rust/worker/bridge.h:116)
  • [SUGGESTION] KJ_REQUIRE in 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::OTHER methods.
  • KJ_REQUIRE throws 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

Comment thread src/rust/worker/bridge.h Resolved
Comment thread src/rust/worker/bridge.h Resolved
@mar-cf
mar-cf force-pushed the mar/bump-capnproto-http-method branch from ebebb28 to af61884 Compare November 25, 2026 20:53

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::OTHER methods in RustWorkerInterface::request. (src/rust/worker/bridge.h:116)
  • [SUGGESTION] KJ_REQUIRE in 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::OTHER methods.
  • KJ_REQUIRE throws 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>
@mar-cf
mar-cf force-pushed the mar/bump-capnproto-http-method branch from af61884 to 7fe5d7d Compare November 25, 2026 21:14

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 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::OTHER methods in RustWorkerInterface::request. (src/rust/worker/bridge.h:116)
  • [SUGGESTION] KJ_REQUIRE in 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::OTHER methods.
  • KJ_REQUIRE throws 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)

@mar-cf
mar-cf merged commit 17ba6c1 into main Nov 25, 2026
24 checks passed
@mar-cf
mar-cf deleted the mar/bump-capnproto-http-method branch November 25, 2026 21:42
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