Cloud-SDK extraction B/C/D — PR 1: IaCStateBackend.Configure RPC + host wiring#679
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a missing configuration-passing hook for plugin-served IaC state backends by introducing a new IaCStateBackend.Configure RPC and wiring it into the host’s iac.state module initialization flow.
Changes:
- Added
IaCStateBackend.Configure(ConfigureRequest{backend_name, config_json})toiac.protoand regenerated Go protobuf + gRPC bindings. - Implemented host-side wiring so
IaCModule.Init()configures a resolved plugin backend by sending the JSON-encoded module config before exposing the store. - Added/updated unit tests covering generated types and the new Configure wiring (happy-path + error propagation).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugin/external/proto/iac.proto | Adds Configure RPC and request/response messages for IaC state backends. |
| plugin/external/proto/iac.pb.go | Regenerated protobuf Go types to include ConfigureRequest/Response. |
| plugin/external/proto/iac_grpc.pb.go | Regenerated gRPC client/server interfaces and service descriptor including Configure. |
| plugin/external/proto/iac_statebackend_test.go | Ensures new generated types exist/compile. |
| module/iac_state_plugin_registry_test.go | Updates client stub to satisfy the expanded IaCStateBackendClient interface. |
| module/iac_state_grpc_client.go | Adds grpcIaCStateStore.Configure to call the plugin’s Configure RPC. |
| module/iac_state_grpc_client_test.go | Adds a unit test validating Configure request contents/JSON round-trip. |
| module/iac_module.go | Calls Configure during iac.state init when resolving a plugin backend. |
| module/iac_module_test.go | New tests covering IaCModule.Init() Configure wiring and error wrapping behavior. |
Files not reviewed (2)
- plugin/external/proto/iac.pb.go: Language not supported
- plugin/external/proto/iac_grpc.pb.go: Language not supported
| store := newGRPCIaCStateStore(client) | ||
| if err := store.Configure(context.Background(), m.backend, m.config); err != nil { | ||
| return fmt.Errorf("iac.state %q: backend %q: configure plugin backend: %w", m.name, m.backend, err) | ||
| } |
There was a problem hiding this comment.
Implemented in 6e17cb5 — IaCModule.Init() now detects status.Code(err) == codes.Unimplemented from the Configure call and returns an actionable "upgrade the backend plugin" error citing decisions/0036; other gRPC codes keep the generic path. New TestIaCModuleConfigureUnimplemented covers it.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
When a plugin-served iac.state backend is an older build whose Configure RPC returns gRPC codes.Unimplemented, IaCModule.Init() now returns an actionable error telling the operator to upgrade the backend plugin to a version that supports Configure (decisions/0036 co-deploy requirement). Other gRPC codes keep the existing generic configure-failed error path. codecov note: the codecov/patch failure on #679 is a repo-config gap, not a PR-1 defect. The patch is dominated by generated *.pb.go (iac.pb.go + iac_grpc.pb.go, ~270 lines, 0% coverage) and the repo has no codecov.yml /.codecov.yml ignoring generated files. The real new lines (iac_module.go default arm + grpcIaCStateStore.Configure) are covered by unit tests; only the defensive json.Marshal error branch is uncovered. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
IaCStateBackend.ConfigureRPC (ConfigureRequest{backend_name, config_json bytes}) — Phase A's contract shipped with no config-passing RPC, so plugin-served IaC state backends round-trip state but can't receive their bucket/credential config. Seedecisions/0036.iac_module.go'sInit()default arm now callsConfigurewith the JSON-encoded module config before wrapping the plugin client.InitializeRequest.config_jsonpattern — JSON bytes, nostructpb/Any(theiac.protohard invariant).Plan PR 1 of the cloud-SDK-extraction B/C/D plan. Gates every plugin PR (they pin this merge commit) + PR 2 (azure
Configureretrofit).Test plan
GOWORK=off go build ./...green;Configure|StateBackend|IaCStatetests across./module+./plugin/...PASSTestIaCModuleConfigureWiring+TestIaCModuleConfigureErrorPASS (config round-trip, error-wrap, store-nil-on-failure)iac.stateconfig🤖 Generated with Claude Code