Skip to content

New registry package - #2377

Draft
cedric-cordenier wants to merge 3 commits into
mainfrom
new-registry-package
Draft

New registry package#2377
cedric-cordenier wants to merge 3 commits into
mainfrom
new-registry-package

Conversation

@cedric-cordenier

Copy link
Copy Markdown
Contributor

Requires

Supports

…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.
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