Add Go module versioning to ship SDK with CLI releases#7403
Conversation
Add Go-module-compatible version tags (cli/azd/vX.Y.Z) alongside each CLI release so extension developers can use standard semver instead of pseudo-versions in their go.mod files. Changes: - Add pipeline step to create Go module tag during release (publish-cli.yml) - Update azdext SDK version to mirror CLI version (version.go) - Auto-sync SDK version during release bumps (Update-CliVersion.ps1) - Add SDK versioning reference docs (docs/sdk-versioning.md) - Document Go module versioning in AGENTS.md Closes #5837 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Go-module-friendly version tags for cli/azd so external extension developers can depend on released semver tags (instead of pseudo-versions), and aligns the azdext package version constant with CLI releases.
Changes:
- Adds an AzDO publish step that creates
cli/azd/vX.Y.ZGit tags via the GitHub API after the CLI GitHub release tag is created. - Updates
pkg/azdext/version.goto mirror the CLI version and adds automation inUpdate-CliVersion.ps1to keep it in sync. - Adds documentation describing the new Go module versioning/tagging approach and updates
AGENTS.mdto reference it.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| eng/scripts/Update-CliVersion.ps1 | Auto-updates pkg/azdext/version.go when bumping cli/version.txt. |
| eng/pipelines/templates/steps/publish-cli.yml | Creates cli/azd/vX.Y.Z Go module tags alongside existing CLI release tags. |
| cli/azd/pkg/azdext/version.go | Updates SDK version constant and documents that it mirrors the CLI version. |
| cli/azd/docs/sdk-versioning.md | New reference doc for extension developers on semver module consumption and local dev. |
| cli/azd/AGENTS.md | Documents the module-tagging/version-sync mechanism and links the new doc. |
- Use Get-Content -Raw and -Encoding utf8 to preserve line endings in version.go updates (Update-CliVersion.ps1) - Add race-condition handling for concurrent tag creation in the Go module tag pipeline step (publish-cli.yml) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jongio
left a comment
There was a problem hiding this comment.
PR Review - #7403
Add Go module versioning to ship SDK with CLI releases by @wbreza
Summary
What: Adds cli/azd/vX.Y.Z Go module tags alongside each CLI release so extension devs can use proper semver in go.mod instead of pseudo-versions. Syncs the pkg/azdext/version.go constant with the CLI version and auto-updates it during the release process.
Why: Extension developers currently need pseudo-version references (v0.0.0-20260305...) which are hard to read and manage. Resolves #5837.
Assessment: Approach is solid - piggybacks on the existing release pipeline with good idempotency and race-condition handling. Two issues need addressing before merge: a test that will break from the version constant change, and a missing error check in the pipeline script.
Findings
| Category | Critical | High | Medium | Low |
|---|---|---|---|---|
| Tests | 0 | 1 | 0 | 0 |
| Error Handling | 0 | 0 | 1 | 0 |
| Total | 0 | 1 | 1 | 0 |
Key Findings
- [HIGH] Tests:
run_coverage_test.go:116hasrequire.Equal(t, "0.1.0", Version)that will break on this change and every future version bump. - [MEDIUM] Error Handling: Pipeline script doesn't validate that the release tag SHA resolved before creating the Go module tag.
Test Coverage Estimate
- No new application code, so no test gaps from new functionality.
- The version constant change breaks an existing test (
run_coverage_test.go:116). extension_command_test.gouses "0.1.0" as a test fixture value (not the constant) - won't break.
What's Done Well
- Idempotent tag creation with proper pre-check and race-condition recovery.
- Annotated tag dereferencing ensures the Go module tag always points to the actual commit.
- Clean documentation with useful version mapping table and local dev guidance.
- Auto-sync via
Update-CliVersion.ps1prevents version drift between CLI and SDK.
2 inline comments below.
- Replace hardcoded version assertion with semver format validation since Update-CliVersion.ps1 auto-bumps the version on each release - Add SHA validation after resolving release tag to surface clear error when the gh API call fails Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace hardcoded version assertion with semver format validation since Update-CliVersion.ps1 auto-bumps the version on each release - Add SHA validation after resolving release tag to surface clear error when the gh API call fails Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jongio
left a comment
There was a problem hiding this comment.
Previous comments addressed. Semver regex test is resilient to future version bumps, and the SHA null check catches resolution failures at the right point. LGTM.
Run go mod tidy on extensions with replace directives (azure.appservice, microsoft.azd.concurx) to pick up dependency changes from the parent cli/azd module. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Created Go module tag cli/azd/v1.23.13 on the latest CLI release - Updated all 6 extensions to reference v1.23.13 instead of pseudo-versions - Removed replace directives from azure.appservice and microsoft.azd.concurx - Fixed azure.coding-agent build: adapted to NewGitHubCli signature change Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate MockPromptServiceClient to include 4 new methods: - PromptAiModel - PromptAiDeployment - PromptAiLocationWithQuota - PromptAiModelLocationWithQuota Also regenerate MockConsole to fix method ordering (go fix). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
If someone is adding something new to the extension framework to be used by an extension, e.g. a new gRPC service, will we now have to release a new version of azd core for the extension to consume the new interface changes in A slight concern is we haven't really been following semver strictly: we've been on 1.23.x since January despite new changes going into I think we should also start calling out SDK changes separately in our changelogs |
|
Great questions. We have two options: version the SDK with the CLI, or version it independently. Both have pros and cons. I think the easiest path to start is versioning with CLI releases — it's simple, predictable, and gives us a foundation. As we get more adoption and the SDK surface stabilizes, we can revisit decoupling the SDK version if that makes more sense. For day-to-day development on the extension framework, the recommended approach is to use a On the changelog front — agreed, we should start calling out SDK/azdext changes separately. I'll look into adding an SDK section to the release notes. |
JeffreyCA
left a comment
There was a problem hiding this comment.
Changes under cli/azd LGTM
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
jongio
left a comment
There was a problem hiding this comment.
Previous comments addressed. New commits since last review are mechanical - go.mod semver updates, replace directive removal, mock regeneration. Checked all 6 extension go.mod changes and the coding-agent signature adaptation. LGTM.
Summary
Adds Go-module-compatible version tags alongside each CLI release so extension developers can use standard semver instead of pseudo-versions in their go.mod files. The Go module version mirrors the CLI version for a simple mental model.
Changes
Pipeline
Version Synchronization
Documentation
Issue References
Resolves #5837
Testing
Notes
Post-merge steps required: