fix(plugin/external/sdk): register PluginService bridge in RegisterAllIaCProviderServices so wfctl can call GetContractRegistry on strict-cutover IaC plugins#623
Merged
Conversation
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
…lIaCProviderServices for GetContractRegistry support ServeIaCPlugin (used by DO plugin v1.0.0) calls RegisterAllIaCProviderServices which only registered typed IaC gRPC services. When wfctl's NewExternalPluginAdapter called GetContractRegistry via pb.NewPluginServiceClient, the plugin returned 'unknown service workflow.plugin.v1.PluginService', blocking the typedIaCAdapter load path in buildTypedIaCAdapterFrom. Fix: after registering IaC services, also register a minimal iacPluginServiceBridge as PluginServiceServer. The bridge's GetContractRegistry delegates to BuildContractRegistry(s) which enumerates all registered gRPC services on the server, returning the IaC service descriptors wfctl needs for optional-client construction. A guard prevents double-registration on mixed plugins that also run the SDK grpcServer. Tests: - TestRegisterAllIaCProviderServices_PluginServiceBridgeRegistered - TestRegisterAllIaCProviderServices_PluginServiceBridgeAnswersGetContractRegistry (end-to-end via live in-process gRPC client) - TestRegisterAllIaCProviderServices_PluginServiceAlreadyRegistered_NoPanic Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/8995eb0b-2f92-48fc-ac39-7b3b9a8a4c00 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix wfctl v0.50.1 dispatch of IaCProvider through legacy InvokeService
fix(plugin/external/sdk): register PluginService bridge in RegisterAllIaCProviderServices so wfctl can call GetContractRegistry on strict-cutover IaC plugins
May 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes strict-cutover typed IaC plugins served via sdk.ServeIaCPlugin failing to load in wfctl because PluginService (specifically GetContractRegistry) was never registered on the plugin’s gRPC server.
Changes:
- Register a minimal
PluginServicebridge fromRegisterAllIaCProviderServicesto serveGetContractRegistryfor typed IaC-only plugins. - Implement
iacPluginServiceBridge.GetContractRegistryby delegating toBuildContractRegistry(*grpc.Server). - Add tests validating the bridge is registered, responds end-to-end over gRPC, and does not double-register/panic on mixed-plugin servers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| plugin/external/sdk/iacserver.go | Registers a minimal PluginService bridge so wfctl can call GetContractRegistry on typed IaC plugins. |
| plugin/external/sdk/iacserver_test.go | Adds coverage for bridge registration, RPC behavior, and double-registration guard. |
Comment on lines
+225
to
+228
| grpcSrv := grpc.NewServer() | ||
| // Pre-register PluginService (simulates a mixed sdk.Serve + IaC plugin). | ||
| pb.RegisterPluginServiceServer(grpcSrv, &pb.UnimplementedPluginServiceServer{}) | ||
| // RegisterAllIaCProviderServices must not panic on double-registration. |
Contributor
|
@copilot apply changes based on the comments in this thread |
…bedded-by-value stub
- Replace hard-coded "workflow.plugin.v1.PluginService" string in
double-registration guard with pb.PluginService_ServiceDesc.ServiceName
so drift/typos if the proto package name changes are caught at compile time.
- In the NoPanic test, replace &pb.UnimplementedPluginServiceServer{} with a
local stub type that embeds UnimplementedPluginServiceServer by value,
matching the pattern the generated gRPC code recommends.
Agent-Logs-Url: https://github.com/GoCodeAlone/workflow/sessions/460fbd7b-0c6c-46f0-b681-e364ed8a8889
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Contributor
Author
Done in 7204a16:
|
4 tasks
intel352
added a commit
that referenced
this pull request
May 10, 2026
…utover IaC plugins (#627) NewExternalPluginAdapter currently fails outright when GetManifest returns codes.Unimplemented. PR #623 added the iacPluginServiceBridge that wires GetContractRegistry for strict-cutover IaC plugins (DO v1.0.0+), but the bridge intentionally leaves GetManifest unimplemented (per the bridge's inline comment). Loader-side adapter.go didn't get a matching relaxation, so DO v1.0.1 loads its gRPC server, then immediately fails: rpc error: code = Unimplemented desc = method GetManifest not implemented load plugin "digitalocean": get manifest from plugin digitalocean This blocks every consumer running typed-IaC dispatch against a strict-cutover plugin. Observed end-to-end via core-dump strict-contracts-smoke run 25642339926 against staging. Fix: when GetManifest returns codes.Unimplemented, synthesize a minimal Manifest{Name: name} from the param-passed plugin name. Downstream accessors (Name/Version/Description/etc.) return sensible values; the loader already keys off the param-passed name everywhere meaningful (adapter.go:111). Non-Unimplemented errors still fail as before. Tests: - TestNewExternalPluginAdapter_GetManifestUnimplemented_SynthesizesFromName - TestNewExternalPluginAdapter_GetManifestNonUnimplementedError_Fails Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
ServeIaCPlugin(the SDK entrypoint for DO v1.0.0-style plugins) callsRegisterAllIaCProviderServices, which only registered typed IaC gRPC services. wfctl'sNewExternalPluginAdapteralways callsGetContractRegistryviapb.NewPluginServiceClientto discover optional capabilities — butPluginServicewas never registered, so every load attempt died with:This blocked
buildTypedIaCAdapterFrombefore it could even check forIaCProviderRequired, making the fully-typed dispatch path unreachable for any strict-cutover plugin.Changes
plugin/external/sdk/iacserver.go— addiacPluginServiceBridge, a minimalpb.PluginServiceServerthat implements onlyGetContractRegistryby delegating toBuildContractRegistry(s), which enumerates the gRPC services already registered on the server.RegisterAllIaCProviderServicesregisters the bridge at the end, guarded against double-registration for mixed plugins that also callsdk.Serve.plugin/external/sdk/iacserver_test.go— three new tests:…_PluginServiceBridgeRegistered: verifiesworkflow.plugin.v1.PluginServiceappears inGetServiceInfo()after registration…_PluginServiceBridgeAnswersGetContractRegistry: end-to-end via a live in-process gRPC client — confirmsGetContractRegistryreturnsIaCProviderRequiredin the registry (the exact checkbuildTypedIaCAdapterFromperforms)…_PluginServiceAlreadyRegistered_NoPanic: verifies the double-registration guard on mixed-plugin servers