New registry package - #2377
Draft
cedric-cordenier wants to merge 3 commits into
Draft
Conversation
…thOwner Brings in the addressable registry (local.go, remote.go), the capability surface client/server over plain gRPC targets, the registry_service proto, and the core interface split (ReadOnlyBase, AddressableRegistryBase, AddressableCapabilitiesRegistry, OCRConfigRegistry) that backs it.
The loop's go-plugin capability client/server (base, executable, trigger) is the same wire code as the plain-gRPC registry's, differing only in the broker: clients are built over broker connections that re-dial on restart, and servers are given the broker to hold the connection. Move the shared implementation to pkg/capabilities/registry/remote and make pkg/loop/internal/core/services/capability a thin adapter over it: - remote.Wrap builds the surface a capability type promises from a conn and exposes GetState when the conn does, preserving the registry's state-based replace logic; Unknown types wrap base-only. - remote.RegisterCapability replaces the loop's pbRegisterCapability, type checking the capability and logging instead of silently serving a nil impl. - InfoToReply/InfoReplyToInfo now live in capabilities/pb, shared by both transports and standard_capabilities.go.
The go-plugin registry client/server and the plain-gRPC registry client decoded the same wire records with their own copies. Route both through the shared package: - DONFromProto/NodeFromProto decode the DON and node records of either protocol, written against the getter shape both generated packages share (with type-switch fallbacks for the fields the two protos name differently, and workflow metadata only the registry proto carries). - TargetClient (moved from the registry package) and the loop's capabilitiesRegistryClient both resolve through remote.Wrap/Resolve and the shared decoders; the loop keeps only its broker-specific wiring (lazy re-dialable client conns, ServeNew) and its server-side encoders. - CapabilityConfigToProto joins CapabilityConfigFromProto as the single config encoder; the loop's inline decode/encode (~230 lines) is gone. The registry package now composes: LocalRegistry holds values, TargetClient reaches the address-based registry behind it.
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.
Requires
Supports