feat: add service-target deployment preview SDK contracts - #10055
FanH (Siglud) wants to merge 3 commits into
Conversation
Add optional provider capability registration, preview protocol messages, and isolated SDK preview dispatch with tests and documentation. Defer CLI integration and first-party provider implementation until after the SDK release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> � Conflicts: � cli/azd/grpc/proto/azd/extensions/v1/service_target.proto � cli/azd/pkg/azdext/contracts/v1/service_target.pb.go
|
Azure Pipelines: Successfully started running 1 pipeline(s). 22 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The exported Register signature change breaks existing interfaces and method values.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds SDK and protobuf contracts for opt-in, read-only service-target deployment previews.
Changes:
- Adds preview capability registration, dispatch, and fresh provider creation.
- Extends stable and beta protobuf contracts.
- Adds tests and extension documentation.
File summaries
| File | Description |
|---|---|
.vscode/launch.json |
Normalizes the final newline. |
docs/guides/creating-an-extension.md |
Documents preview providers. |
docs/architecture/extension-framework.md |
Summarizes the SDK contract. |
cli/azd/docs/extensions/extension-framework.md |
Provides detailed provider guidance. |
cli/azd/grpc/proto/azd/extensions/v1/service_target.proto |
Adds stable preview messages. |
cli/azd/grpc/proto/azd/extensions/v1beta/service_target.proto |
Adds beta preview messages. |
cli/azd/pkg/azdext/contracts/v1/service_target.pb.go |
Regenerates stable bindings. |
cli/azd/pkg/azdext/contracts/v1beta/service_target.pb.go |
Regenerates beta bindings. |
cli/azd/pkg/azdext/contracts_v1_aliases.go |
Exposes preview facade aliases. |
cli/azd/pkg/azdext/component_manager.go |
Creates uncached provider instances. |
cli/azd/pkg/azdext/component_manager_test.go |
Tests instance isolation and concurrency. |
cli/azd/pkg/azdext/extension_host.go |
Adds explicit preview registration. |
cli/azd/pkg/azdext/extension_host_test.go |
Tests capability registration. |
cli/azd/pkg/azdext/service_target_envelope.go |
Unwraps preview messages. |
cli/azd/pkg/azdext/service_target_manager.go |
Dispatches preview requests. |
cli/azd/pkg/azdext/service_target_manager_test.go |
Tests preview lifecycle behavior. |
cli/azd/pkg/azdext/service_target_manager_integration_test.go |
Tests in-memory gRPC dispatch. |
cli/azd/pkg/azdext/service_target.pb_test.go |
Tests preview wire round trips. |
Review details
Files not reviewed (3)
- cli/azd/pkg/azdext/contracts/v1/service_target.pb.go: Generated file
- cli/azd/pkg/azdext/contracts/v1beta/service_target.pb.go: Generated file
- cli/azd/pkg/azdext/contracts_v1_aliases.go: Generated file
- Files reviewed: 14/18 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Azure Pipelines: Successfully started running 1 pipeline(s). 22 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
🟡 Changes recommended
The exported Register signature remains source-incompatible with existing interface implementations and method values.
Get a fresh assessment by requesting another Copilot review.
Review details
Files not reviewed (3)
- cli/azd/pkg/azdext/contracts/v1/service_target.pb.go: Generated file
- cli/azd/pkg/azdext/contracts/v1beta/service_target.pb.go: Generated file
- cli/azd/pkg/azdext/contracts_v1_aliases.go: Generated file
- Files reviewed: 14/17 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fixes #7750 Part.1
Summary
Add the extension SDK and protobuf prerequisites for read-only service-target deployment previews.
This is the SDK-only portion split out of #10041, supporting #8549. It does not enable
azd deploy --previewor implement the Foundry agent comparison. Those changes will follow after this SDK contract is merged and published.Why split this out?
First-party extensions consume a released azd SDK through their own Go module dependencies. Adding SDK APIs and consuming them in the same PR leaves independently built extensions referencing APIs absent from their pinned release.
The intended sequence is:
This PR contains no temporary local SDK
replacedirective or extension dependency changes.Implementation
Explicit, optional provider capability
ServiceTargetPreviewProviderwith aPreview(context.Context, *ServiceConfig)method returning*ServiceDeployPreviewResult.ExtensionHost.WithServiceTargetPreviewto opt a service target into preview support.SupportsPreviewthrough registration and advertise it assupports_preview. Existing registrations default to false; existing calls toServiceTargetManager.Registerremain valid without the optional argument.Separate preview protocol and dispatch
v1andv1beta), keeping stable a compatible subset of beta.Isolated provider lifecycle
ComponentManager.CreateInstanceto invoke the registered factory without reading or updating cached deployment instances.Initializeor deployment preparation methods.Scope boundaries
Deferred to the implementation PR:
azd deploy --previewflag, command action, and host-side capability checks.Normal deployment and login behavior are unchanged by this SDK work.
Validation
Validated locally on Windows after rebasing onto the versioned-contract changes, using Go 1.26.4 with
GOWORK=off:golangci-lint run ./pkg/azdext/...-- zero issues.go fix -diff ./pkg/azdext/...-- no changes.git diff --check.No live Azure resources were provisioned, and no end-to-end CLI preview test is claimed: the CLI implementation is intentionally not part of this PR.