feat(iac): add provider region lister contract#819
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new optional IaC gRPC contract (IaCProviderRegionLister) and wires it through the plugin SDK, wfctl typed adapter, and infra-admin so provider-sourced regions are preferred when available, with a fallback to the host-side local region catalog.
Changes:
- Introduces
IaCProviderRegionLister+ request/response messages in the IaC proto and regenerates Go bindings. - Auto-registers/advertises the optional service via the IaC plugin SDK and ContractRegistry, and adds wfctl typed-adapter support (
RegionLister()+ListProviderRegions). - Updates infra-admin ListProviders to call the optional region lister when available and successful, falling back to local catalog regions otherwise (with tests and updated proto comments).
Reviewed changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| plugin/external/sdk/iacserver.go | Auto-registers IaCProviderRegionLister when the provider implements the service. |
| plugin/external/sdk/contracts_iac_test.go | Extends ContractRegistry advertisement tests to include the new optional service. |
| plugin/external/proto/iac.proto | Adds the IaCProviderRegionLister service and region listing messages. |
| plugin/external/proto/iac.pb.go | Regenerated protobuf Go bindings for the new service/messages. |
| plugin/external/proto/iac_grpc.pb.go | Regenerated gRPC Go bindings for the new service. |
| plugin/external/proto/iac_proto_test.go | Ensures optional IaC service interfaces remain distinct, including the new service. |
| iac/admin/proto/infra_admin.proto | Updates AdminProviderSummary comments to reflect provider-lister vs local-catalog sourcing. |
| iac/admin/proto/infra_admin.pb.go | Regenerated Go bindings reflecting updated proto comments. |
| iac/admin/handler/list_providers.go | Prefers provider-sourced regions via an optional host-side interface; normalizes and sets regions_source. |
| iac/admin/handler/list_providers_test.go | Adds coverage for provider-lister success path and error fallback to local catalog. |
| cmd/wfctl/iac_typed_adapter.go | Adds the region-lister service constant, client wiring, and ListProviderRegions helper. |
| cmd/wfctl/iac_typed_adapter_test.go | Adds tests for region lister presence and ListProviderRegions behavior. |
| cmd/wfctl/iac_typed_fixture_test.go | Extends typed-adapter test fixture to register IaCProviderRegionLister. |
| docs/plans/2026-06-01-iac-provider-region-lister.md | Documents the implementation plan and verification steps for the new contract and consumer behavior. |
Files not reviewed (2)
- iac/admin/proto/infra_admin.pb.go: Language not supported
- plugin/external/proto/iac_grpc.pb.go: Language not supported
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 15 changed files in this pull request and generated no new comments.
Files not reviewed (2)
- iac/admin/proto/infra_admin.pb.go: Language not supported
- plugin/external/proto/iac_grpc.pb.go: Language not supported
Summary
IaCProviderRegionListergRPC service and generated bindingsCloses part of #813. Provider plugin implementations will cascade after this core contract PR lands.
Verification
GOWORK=off go test ./plugin/external/proto -run TestOptionalServicesHaveDistinctInterfaces -count=1GOWORK=off go test ./plugin/external/sdk -run TestBuildContractRegistry_AdvertisesRegisteredIaCServices -count=1GOWORK=off go test ./cmd/wfctl -run 'TestTypedAdapter_(OptionalReturnsUnimplementedSentinel|RegionLister|ListProviderRegions)' -count=1\n-GOWORK=off go test ./iac/admin/handler -run 'TestListProviders_(UsesProviderRegionListerWhenAvailable|RegionListerErrorFallsBackToLocalCatalog|PopulatesRegionsAndEnginesAndTypes)' -count=1\n-GOWORK=off go test ./plugin/external/... ./iac/admin/... -count=1\n-GOWORK=off go test ./cmd/wfctl -run 'TestTypedAdapter|TestInfraAdminCLI_ListProvidersOutput_RoundTrip' -count=1\n-GOWORK=off golangci-lint run ./plugin/external/... ./iac/admin/... ./cmd/wfctl\n-GOWORK=off go build -o /tmp/wfctl-813 ./cmd/wfctl\n-GOWORK=off go test ./cmd/wfctl -count=1 -timeout 300s\n-git diff --check\n\n## Notes\n-buf lintstill fails on existing repo-wide proto lint drift (package/version/service-name conventions); the new service intentionally follows existing IaC service naming.