[in-progress] feat: Update CBOR protocol #349
Draft
jterapin wants to merge 3 commits into
Draft
Conversation
Drop the base class in favor of a duck-typed interface documented on the standalone NoOpProtocol. Parse handlers now get context, so a protocol can reach request headers and operation errors.
One RpcV2Cbor object replaces the per-service plugin, its two handlers, and the separate stubber. Stubbing runs through config.protocol (the object doubles as its own stubber). AWS protocols follow in a separate PR, so their stubbing stays red on version-4 until then.
jterapin
force-pushed
the
update-cbor-protocol
branch
from
July 24, 2026 18:29
dbcb3a9 to
bddc3d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Follows #348 (generic Protocol plugin, define-only). That PR added the mechanism but nothing consumed it. CBOR was still served by a per-service plugin (
Plugins::RpcV2Cbor) with its serialization split across two handler classes and a separate stubber, none of which used the new interface.Description
Retrofit RPC v2 CBOR onto the generic Protocol plugin, making it the first real consumer and taking the mechanism live:
Client::RpcV2Cborreplaces the old plugin, its two handlers (Handler+ErrorHandler), and the separate CBOR stubber, implementing the 5-method interface (build_request/parse_data/parse_error/stub_data/stub_error).Protocolbase class; the interface is now duck-typed and documented on the standaloneNoOpProtocol, which also carries the stubbing methods. The genericParseHandlerpassescontext(not the bare response) so a protocol can reach request headers, operation errors, and the client's errors module.config.protocolinstead of a separate:stubberoption; the protocol object doubles as its own stubber.add_protocolsweld hook populatesclient.protocolsat codegen, replacing the test-only registry scaffold from feat: Add generic Protocol plugin and protocol interface #348.parse_errorreproduces the oldErrorHandler'son_done(200..599)gate with an early return, so signaled transport errors (status 0) pass through untouched.Testing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.