feat(sdk): IaCServeOptions.TypedModules + .TypedSteps (future-prep for typed-Provider migration)#686
Merged
Merged
Conversation
…o providers Adds two new map fields to IaCServeOptions and extends mapBackedProvider to implement TypedModuleProvider + TypedStepProvider. Lets IaC plugins register strict-proto module/step providers (sdk.NewTypedModuleFactory / sdk.NewTypedStepFactory) through the existing IaC bridge — previously the bridge accepted only the legacy ModuleProvider/StepProvider surface so strict-typed providers were unreachable. The dispatch contract (per grpc_server.go's existing CreateModule / CreateStep handlers) is Typed-first → legacy-fallback: a type in typedModules wins; absence returns ErrTypedContractNotHandled which causes the dispatcher to try the legacy modules map. Coexistence is fully supported — plugins can mix the two surfaces during migration. mapBackedProvider.ModuleTypes / StepTypes stay legacy-only; the host GetModuleTypes / GetStepTypes RPCs already merge TypedModuleTypes + ModuleTypes via mergeTypeLists (typed-primary-first, then legacy-only extras), so the union surfaces correctly through the existing path. 6 new tests in iacserver_modules_test.go cover: - typed-only GetModuleTypes (no legacy map present) - typed + legacy GetModuleTypes / GetStepTypes union via set-equality - typed-first dispatch through CreateModule / CreateStep - legacy-fallback when a type is not in the typed map Existing legacy-only tests (ModulesAndSteps_Delegate, Deterministic, ZeroValueOptions, NilBroker) continue to pass — backwards-compatible. Full sdk + full workflow test suite green under -race; vet clean. See decisions/0039 (forthcoming).
Contributor
There was a problem hiding this comment.
Pull request overview
Adds typed module and step provider support to the IaC plugin SDK bridge, preparing IaC plugins for future strict-proto provider migration while preserving legacy provider fallback behavior.
Changes:
- Extends
IaCServeOptionswithTypedModulesandTypedSteps. - Wires typed provider maps through
mapBackedProviderand typed-first/legacy-fallback dispatch. - Adds regression tests for typed discovery, typed dispatch, legacy fallback, and typed-only setup.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
plugin/external/sdk/iacserver.go |
Adds typed module/step option fields and map-backed typed provider implementations. |
plugin/external/sdk/iacserver_modules_test.go |
Adds tests covering typed IaC bridge discovery and dispatch behavior. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
intel352
added a commit
that referenced
this pull request
May 16, 2026
…affolding (#689) Records the resolution of two interlocking decisions made mid-execution of plan-2 (plugin-modules-on-iac): 1. (c1) for plan-2 plugin shipping: aws + gcp v1.1.0 carry strict descriptors backing legacy ModuleProvider Go impls, satisfying wfctl plugin audit without forcing an eager typed-Provider migration. 2. SDK Typed-fields scaffolding (PR #686 #683): IaCServeOptions now carries TypedModules + TypedSteps alongside Modules + Steps; mapBackedProvider implements both contracts; grpc_server's Typed-first → legacy-fallback path is reused. (c2) — relaxing the validator — rejected as eroding the strict-cutover value (decisions/0024). (B1) — eager typed migration — rejected as blocking the Phase B/C deletions per the user's "just get the remaining plugins finished up" mandate. 🤖 Generated with [Claude Code](https://claude.com/claude-code) 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.
Summary
IaCServeOptionswithTypedModules map[string]TypedModuleProvider+TypedSteps map[string]TypedStepProvider(parallel to the legacyModules/Stepsfields shipped in plan-2 PR 1).mapBackedProvidernow implementsTypedModuleProvider+TypedStepProvideralongside the existingModuleProvider+StepProviderimpls.CreateTypedModule/CreateTypedStepreturnErrTypedContractNotHandledwhen the type isn't in the typed map →grpc_serverfalls through to legacyCreateModule/CreateStep(Typed-first → legacy-fallback contract thatgrpc_serveralready implements).protoc-generated config types from each plugin'sinternal/contracts/.Test plan
iacserver_modules_test.go: TypedModules/TypedSteps GetTypes union; CreateTypedModule/Step typed-first dispatch + legacy fallback; typed-only-without-legacy-map caseGOWORK=off go build ./... && go test ./... -racegreen🤖 Generated with Claude Code