Skip to content

Rename azd extension/tool UPGRADE commands to UPDATE - #9370

Open
hyoshis wants to merge 11 commits into
mainfrom
hyoshis-rename-upgrade-to-update
Open

Rename azd extension/tool UPGRADE commands to UPDATE#9370
hyoshis wants to merge 11 commits into
mainfrom
hyoshis-rename-upgrade-to-update

Conversation

@hyoshis

@hyoshis hyoshis commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Why

The upgrade verb was inconsistent with the rest of azd's user-facing vocabulary,
where "update" is the common term for moving to a newer version. This renames the
two user-facing upgrade commands to update so the CLI reads consistently.

What changed

  • Renamed azd extension upgrade -> azd extension update and
    azd tool upgrade -> azd tool update. The old upgrade names still work as
    cobra aliases, so existing scripts and muscle memory keep working.
  • Updated all displayed help text, flag descriptions, prompts, spinner/progress
    messages, done/summary headers, suggestions, and error strings from
    "Upgrade/Upgrading/Upgraded" to "Update/Updating/Updated".
  • Updated user-facing docs (extension-framework.md,
    extension-resolution-and-versioning.md, creating-an-extension.md) to the new
    command names, noting the upgrade alias.
  • Regenerated usage and figspec snapshots; renamed the *-upgrade.snap testdata
    files to *-update.snap and fixed affected test assertions.
  • Added a CHANGELOG entry under Unreleased.

Scope / non-goals

To keep this a user-facing rename only, the following were intentionally left
unchanged:

  • Go identifiers (types, functions, struct fields such as UpgradeOptions,
    .Upgrade()).
  • Telemetry field/event key constants (ext.upgrade, tool.upgrade.*) and
    changelog history.
  • The --no-dependency-upgrades flag name (a stable flag identifier).

Note: the auto-derived telemetry command span name follows the command path, so it
shifts to cmd.tool.update / cmd.extension.update. The explicit telemetry field
keys above are unchanged.

hyoshis and others added 3 commits July 30, 2026 11:21
Rename the user-facing 'azd extension upgrade' and 'azd tool upgrade' commands to 'update', keeping 'upgrade' as a cobra alias for backward compatibility. Update all displayed help text, flag descriptions, prompts, progress and summary messages, error strings, docs, and regenerate usage/figspec snapshots. Go identifiers, telemetry field-key constants, and the --no-dependency-upgrades flag name are unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds two sets of UX guidance to the azd style guides:

1. Responsive list/table layouts for list commands, documented as part of the core azd design patterns in azd-style-guide.md.

2. Agentic (AI / GitHub Copilot) UX patterns, moved into a dedicated agentic-ux-style-guide.md so the core guide focuses solely on core azd design patterns (which extensions may follow for consistency, but are not enforced).

Adds cross-references in the core guide's overview and in cli/azd/AGENTS.md so agents reference the correct file for the flow they're working on.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 656aee2e-29aa-4b53-965c-63543c1dd44a
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: be625a8a-0787-45ea-b3d9-a782d4c2651f
@hyoshis
hyoshis requested a review from kristenwomack July 30, 2026 18:36
@hyoshis hyoshis self-assigned this Jul 30, 2026
Copilot AI review requested due to automatic review settings July 30, 2026 18:36
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
21 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Renames extension/tool upgrade commands to update while retaining aliases, and refreshes related UX, documentation, tests, and snapshots.

Changes:

  • Adds canonical extension update and tool update commands.
  • Updates user-facing terminology and generated snapshots.
  • Adds broader CLI and agentic UX guidance.
Show a summary per file
File Description
docs/guides/creating-an-extension.md Updates promotion guidance.
cli/azd/docs/style-guidelines/azd-style-guide.md Adds responsive-layout guidance.
cli/azd/docs/style-guidelines/agentic-ux-style-guide.md Adds agentic UX guidance.
cli/azd/docs/extensions/extension-resolution-and-versioning.md Updates extension commands and terminology.
cli/azd/docs/extensions/extension-framework.md Documents extension update and alias.
cli/azd/cmd/tool.go Renames the tool command and output.
cli/azd/cmd/tool_test.go Updates expected result messages.
cli/azd/cmd/testdata/TestUsage-azd-tool.snap Updates tool command listing.
cli/azd/cmd/testdata/TestUsage-azd-tool-update.snap Captures update-command help.
cli/azd/cmd/testdata/TestUsage-azd-tool-check.snap Updates check help wording.
cli/azd/cmd/testdata/TestUsage-azd-extension.snap Updates extension command listing.
cli/azd/cmd/testdata/TestUsage-azd-extension-update.snap Captures update-command help.
cli/azd/cmd/testdata/TestFigSpec.ts Updates completion specifications.
cli/azd/cmd/extension.go Renames extension command and output.
cli/azd/cmd/extension_upgrade_test.go Updates failure assertions.
cli/azd/cmd/extension_test.go Updates summary assertions.
cli/azd/CHANGELOG.md Records the command rename.
cli/azd/AGENTS.md References expanded UX guidance.

Review details

Comments suppressed due to low confidence (1)

cli/azd/cmd/tool.go:1537

  • Changing this value to update changes the serialized action field in --dry-run --output json; the normal update path makes the same change at line 1362. Existing automation invoking the backward-compatible upgrade alias can therefore break even though the command still resolves. Decouple the human-facing verb from the stable JSON value, or explicitly version and document this machine-output contract change.
		action := "update"
  • Files reviewed: 18/18 changed files
  • Comments generated: 6
  • Review effort level: Medium

{
name: ['upgrade'],
description: 'Upgrade installed extensions to the latest version.',
name: ['update', 'upgrade'],
Comment thread cli/azd/cmd/extension.go
Comment on lines +117 to +121
// azd extension update <extension-id>
group.Add("update", &actions.ActionDescriptorOptions{
Command: &cobra.Command{
Use: "upgrade [extension-id]",
Short: "Upgrade installed extensions to the latest version.",
Long: `Upgrade one or more installed extensions.
Use: "update [extension-id]",
Aliases: []string{"upgrade"},
Comment thread cli/azd/cmd/tool.go
| Status text | Meaning | Color helper |
| ------------------- | ----------------------------- | ------------------- |
| `Installed` / `Up to date` | Present and current | `WithSuccessFormat` |
| `Upgrade available` | Installed but outdated | `WithWarningFormat` |
Comment thread cli/azd/docs/extensions/extension-resolution-and-versioning.md
Comment on lines +1 to +5
# Azure Developer CLI (`azd`) Agentic UX Style Guide

## Overview

This guide covers the **agentic (AI / GitHub Copilot) UX patterns** for the Azure Developer CLI. These are a **deliberately distinct visual system** from the core azd flows documented in [azd-style-guide.md](./azd-style-guide.md).
@hyoshis hyoshis linked an issue Jul 30, 2026 that may be closed by this pull request
3 tasks

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two of the failing CI checks trace directly to this diff, and both are quick fixes.

golangci-lint fails with a single issue: cmd/extension.go:1061:1: File is not properly formatted (gofmt). The reindented return in the dependency-upgrade error path lost a tab. Inline suggestion below.

cspell fails on tabwriter at docs/style-guidelines/azd-style-guide.md:308, :375, and :422. Those lines come from the new responsive-table section in this PR, so the word needs to go in the cspell dictionary (or be wrapped so cspell skips it). Inline comment below.

Two smaller things that don't block:

--docs builds its deep link from c.CommandPath() (cmd/cobra_builder.go), so azd extension update --docs and azd tool update --docs now resolve to https://learn.microsoft.com/azure/developer/azure-developer-cli/reference#azd-extension-update and #azd-tool-update. Cobra reports the canonical path for alias invocations too, so azd extension upgrade --docs lands on the new anchor as well. Is the learn.microsoft.com reference page regenerated from this repo automatically, or does that anchor need a separate docs PR? Right now both the new name and the old alias point at an anchor that doesn't exist yet.

cli/azd/extensions/azure.coding-agent/README.md:32 still tells users to run azd extension upgrade azure.coding-agent. It keeps working via the alias, but it's user-facing copy in the same rename scope.

Comment thread cli/azd/cmd/extension.go Outdated
if err != nil {
a.console.StopSpinner(ctx, stepMessage, input.StepFailed)
return nil, wrapDependencyError(fmt.Errorf("failed to upgrade extension: %w", err))
return nil, wrapDependencyError(fmt.Errorf("failed to update extension: %w", err))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

golangci-lint fails on exactly this line: cmd/extension.go:1061:1: File is not properly formatted (gofmt). It's the only lint issue in the run. This return needs one more tab to sit inside the if err != nil block.

Suggested change
return nil, wrapDependencyError(fmt.Errorf("failed to update extension: %w", err))
return nil, wrapDependencyError(fmt.Errorf("failed to update extension: %w", err))

gofmt -w ./cmd/extension.go fixes it.


### Responsive List & Table Layouts

Commands that print a list of items — `azd tool list`, `azd tool check`, `azd extension list` (and its alias `azd ext list`), `azd extension source list`, `azd template list`, `azd template source list`, `azd copilot consent list` — render through the shared responsive formatter rather than hand-rolling their own `tabwriter` output. This keeps column names, colors, and layout behavior consistent, and gives every list command a layout that adapts to the terminal width.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cspell-lint fails here and at lines 375 and 422 with Unknown word (tabwriter). All three come from this new section, so the check goes red on this PR. Add tabwriter to the repo cspell dictionary (.vscode/cspell.yaml or wherever the shared word list lives) so the term stays usable in prose.

Address review feedback, complete customer-facing terminology updates, preserve compatibility, and remove unrelated documentation changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 21cd8119-a644-4b3c-8c99-3f89f63a9968
Copilot AI review requested due to automatic review settings August 1, 2026 03:45
@github-actions github-actions Bot added ext-agents azure.ai.agents extension ext-coding-agent azure.coding-agent extension labels Aug 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (7)

cli/azd/cmd/tool.go:1563

  • [azd-code-reviewer] This compatibility rewrite also changes skip (not installed) rows to upgrade. Before this change, skipped tools kept their skip action in --dry-run --output json; now consumers are incorrectly told every row will be upgraded. Only translate rows whose action is update.
		for i := range rows {
			rows[i].Action = "upgrade"

cli/azd/docs/tracing-in-azd.md:246

  • [azd-code-reviewer] The telemetry guide is only partially renamed: line 210 still describes active azd tool operations as install/upgrade/check/show, rows 237–245 use install/upgrade, and row 247 says “Single-target upgrade.” These describe the canonical command, not the intentionally stable tool.upgrade.* keys, so update the prose throughout this section while retaining the key names.
| `tool.upgrade.from_version` | string | Single-target update | Pre-update installed version. Captured via detection on both the explicit-args (`azd tool update <id>`) and auto-detect (`azd tool update`) paths. Unset only when detection failed or the tool was not previously installed. |

docs/specs/metrics-audit/feature-telemetry-matrix.md:33

  • [azd-code-reviewer] The adjacent Extensions row still says direct source locations apply to extension “install/upgrade,” even though the canonical command is now extension update. Update that command description while keeping the ext.upgrade and extension.upgrade.* telemetry keys unchanged.
    docs/reference/telemetry-data.md:710
  • [azd-code-reviewer] This public reference is only partially updated. The extension field table still names azd extension ... upgrade at line 455, and the tool-management section at lines 467–507 still documents active install/upgrade operations. Keep the stable *.upgrade telemetry keys, but rename the command/operation prose to update so it matches cmd.tool.update and the CLI.
    docs/specs/metrics-audit/telemetry-schema.md:20
  • [azd-code-reviewer] The event description now says “update,” but this schema still documents active azd tool commands as install/upgrade/check at lines 288 and 312, with upgrade-command wording in the field notes below. Preserve the tool.upgrade.* field names, but update the operation prose so the authoritative schema matches the renamed command.
    cli/azd/extensions/azure.coding-agent/README.md:29
  • [azd-code-reviewer] The command is renamed here, but the immediately preceding sentence still says “if you already the ... installed” and “want to upgrade.” Use the new vocabulary and fix the missing “have” so the installation instructions read consistently.
azd extension update azure.coding-agent

cli/azd/CHANGELOG.md:7

  • Repository guidance defers changelog entries for feature/fix PRs to release or version-bump PRs (cli/azd/AGENTS.md:227-235). This PR is not preparing a release, so remove this entry and let the release process add it to avoid recurring changelog conflicts.
- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility.
  • Files reviewed: 45/45 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Resolve the extension update conflict while preserving source and version flags in retry guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 21cd8119-a644-4b3c-8c99-3f89f63a9968
Copilot AI review requested due to automatic review settings August 1, 2026 05:42
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (7)

cli/azd/cmd/tool.go:1563

  • azd-code-reviewer: This loop also rewrites "skip (not installed)" rows to "upgrade", so JSON dry runs falsely report that an uninstalled tool would be upgraded. Only translate the new "update" action value when preserving the legacy JSON contract.
		for i := range rows {
			rows[i].Action = "upgrade"

docs/reference/telemetry-data.md:710

  • azd-code-reviewer: The canonical span is updated here, but the same reference still documents the old operation name: line 455 lists azd extension ... upgrade, and lines 467 and 492–507 describe active tool upgrade operations. Keep immutable keys such as ext.upgrade and tool.upgrade.*, but update the prose and command references so this authoritative telemetry reference is internally consistent.
    cli/azd/docs/tracing-in-azd.md:233
  • azd-code-reviewer: This heading now says tool update, but the introduction at line 210 and nearly every “Emitted by” entry at lines 237–247 still call the operation upgrade. Preserve tool.upgrade.* as telemetry keys, but rename the surrounding prose to update so the tracing contract does not describe a command that is now only an alias.
The `tool install` / `tool update` / `tool check` / `tool show` actions emit:

docs/specs/metrics-audit/feature-telemetry-matrix.md:33

  • azd-code-reviewer: The Extensions (dynamic) row above still says extension.source.kind applies to extension ... upgrade. Update that canonical command reference too; the telemetry field/event keys can remain upgrade as intended.
    cli/azd/docs/extensions/extension-resolution-and-versioning.md:514
  • azd-code-reviewer: This document is still inconsistent with the changed behavior: line 172 says the install confirmation prompt displays Upgrade to <version>, but versionTransitionVerb now emits Update to <version>. Lines 142–143 also retain “upgrade azd” guidance. Update those passages so the documented output matches the CLI.
# Output: my.extension updated from 1.0.0-beta.2 (dev) → 1.0.0 (azd)

cli/azd/extensions/azure.coding-agent/README.md:32

  • azd-code-reviewer: The sentence immediately above this example still tells users they “want to upgrade,” which leaves the old user-facing vocabulary in place and conflicts with the new command. Update that sentence as part of the rename.
azd extension update azure.coding-agent

cli/azd/CHANGELOG.md:7

  • cli/azd/AGENTS.md:232 says changelog entries should be deferred to release/version-bump PRs. This command-rename PR is not preparing a release, so remove this entry and let the release process add it.
- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility.
  • Files reviewed: 45/45 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is red on all three BuildCLI legs. I reproduced it locally on 6a59b2d: two test assertions didn't get updated with the rename, and both fail in ./cmd.

  • cmd/extension_bundle_test.go:202 expects Upgrade to 2.0.0, but versionTransitionVerb now emits Update to 2.0.0. The sibling table in TestVersionTransitionVerb got updated, this one in TestConfirmSourceChange/UpgradeShowsTargetVersion didn't.
  • cmd/extension_upgrade_test.go:294 expects Upgraded, but dependencyChangeVerb now returns Updated.

I applied both one-line fixes locally and go test ./cmd/... goes green. Neither line sits inside a diff hunk, so I anchored the comments on the production lines that changed the expected strings.

Comment thread cli/azd/cmd/extension.go
Comment thread cli/azd/cmd/extension.go
hyoshis added 3 commits August 3, 2026 10:32
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 21cd8119-a644-4b3c-8c99-3f89f63a9968
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 21cd8119-a644-4b3c-8c99-3f89f63a9968
Copilot AI review requested due to automatic review settings August 3, 2026 18:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (6)

cli/azd/CHANGELOG.md:7

  • azd-code-reviewer: This changelog entry should be deferred to the release/version-bump PR. cli/azd/AGENTS.md:232 says feature changes generally should not update CHANGELOG.md, and this PR is not preparing a release.
- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility.

docs/specs/metrics-audit/telemetry-schema.md:20

  • azd-code-reviewer: This updates only the event description, but the authoritative schema still calls these operations “upgrade” throughout the extension fields (lines 207–216) and tool-management section (lines 288–327). Update those headings, field labels, and descriptions to “update” while retaining the stable *.upgrade.* keys; otherwise the telemetry docs use conflicting terminology for the renamed commands.
    docs/specs/metrics-audit/feature-telemetry-matrix.md:33
  • azd-code-reviewer: The extension row immediately above still says extension.source.kind applies to list/show/install/upgrade, while the detailed row now uses update. Use the canonical command name consistently here; keep only the stable telemetry keys as upgrade.
    cli/azd/extensions/azure.coding-agent/README.md:32
  • azd-code-reviewer: The introductory sentence still tells users they “want to upgrade” immediately before showing the new update command, and it is missing “have.” Align the prose with the renamed command to avoid a contradictory example.
azd extension update azure.coding-agent

cli/azd/docs/extensions/extension-framework.md:1214

  • azd-code-reviewer: This guide still describes requiredAzdVersion filtering as “install/upgrade” on line 1095 and dependency resolution as “installs or upgrades” on line 1191. Update those remaining operation descriptions so this user-facing guide consistently uses the new command vocabulary.
Pack manifests must include at least one dependency. They may omit `capabilities`, `namespace`, `entryPoint`, `usage`, and `examples` when the pack has no commands of its own. Installing a pack installs its dependencies recursively from the same extension source as the pack. Dependency versions in the manifest support semver constraints, but command-line `--version` values for `azd extension install` and `azd extension update` are exact versions.

cli/azd/pkg/tool/installer.go:1407

  • azd-code-reviewer: runSkillAgentCommand still sets its operation verb to "upgrade" at line 1932, so a missing plugin update command now surfaces agent … has no upgrade command configured from line 1936. Change that diagnostic verb to "update" so this error path matches the renamed command and the other updated error strings.
  • Files reviewed: 45/45 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copilot AI review requested due to automatic review settings August 3, 2026 21:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 21cd8119-a644-4b3c-8c99-3f89f63a9968

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (6)

cli/azd/pkg/tool/installer.go:1153

  • [azd-code-reviewer] The rename is incomplete in this file: runSkillAgentCommand at lines 1929-1937 still builds the user-facing error agent %q has no upgrade command configured. An azd tool update failure can therefore still surface the old verb. Change that display verb to update while retaining internal upgrade identifiers.
    docs/specs/metrics-audit/feature-telemetry-matrix.md:35
  • [azd-code-reviewer] This matrix update misses the Extensions summary at line 33, which still says extension.source.kind applies to list/show/install/upgrade. Change that command reference to list/show/install/update; the ext.upgrade event and extension.upgrade.* keys should remain unchanged.
    cli/azd/extensions/azure.coding-agent/README.md:32
  • [azd-code-reviewer] The command was updated, but its lead-in still says “want to upgrade” and is missing “have” (“if you already the extension installed”). Update the sentence too so the example is grammatical and uses the new vocabulary.
azd extension update azure.coding-agent

cli/azd/docs/extensions/extension-framework.md:1214

  • [azd-code-reviewer] The extension framework still uses the old current-operation terminology in several places, including install/upgrade for requiredAzdVersion (line 1095), “installs or upgrades” for dependency resolution (line 1191), and the “Version Upgrade Path” section (lines 772-806). Update this prose to match the renamed command while leaving historical references and stable identifiers unchanged.
Pack manifests must include at least one dependency. They may omit `capabilities`, `namespace`, `entryPoint`, `usage`, and `examples` when the pack has no commands of its own. Installing a pack installs its dependencies recursively from the same extension source as the pack. Dependency versions in the manifest support semver constraints, but command-line `--version` values for `azd extension install` and `azd extension update` are exact versions.

cli/azd/CHANGELOG.md:7

  • Feature and fix PRs generally defer changelog edits to the release/version-bump workflow to avoid conflicts (cli/azd/AGENTS.md:235-243). This PR is not preparing a release, so remove this entry and let release tooling add it later.
### Other Changes

- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility.

docs/specs/metrics-audit/telemetry-schema.md:20

  • [azd-code-reviewer] The schema is still internally inconsistent: line 19 says “install/upgrade event,” and lines 207-216 plus 288-327 describe current extension/tool operations as “upgrade” in prose and section titles. Rename those labels and descriptions to “update” while retaining stable OTel keys and enum values such as extension.upgrade.* and upgraded.
  • Files reviewed: 46/46 changed files
  • Comments generated: 2
  • Review effort level: Balanced

Comment thread cli/azd/cmd/extension.go
Comment thread cli/azd/cmd/tool.go
Use: "upgrade [tool-name...]",
Short: "Upgrade installed tools.",
Use: "update [tool-name...]",
Aliases: []string{"upgrade"},

@jongio jongio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two notes inline: a changelog wording suggestion about JSON output, and a correction on the lifecycle hooks concern raised earlier on this PR.

Comment thread cli/azd/CHANGELOG.md

### Other Changes

- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth calling out that --output json intentionally keeps the old vocabulary, since that's the part script authors are most likely to get wrong. azd tool update --output json still emits "action": "upgrade" (cmd/tool.go:1388 and :1563), and the extension side still emits "upgraded" plus the dependencyUpgrades key (pkg/extensions/upgrade_result.go:29 and :81). Someone reading this entry could reasonably assume the JSON followed the rename and preemptively rewrite their jq filters.

There's precedent for spelling out JSON impact in this file: the #9045 entry at line 43 ends with "Update scripts and JSON consumers accordingly."

Suggested change
- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility.
- Rename the `azd extension upgrade` and `azd tool upgrade` commands to `azd extension update` and `azd tool update`. The former `upgrade` names continue to work as aliases for backward compatibility. Machine-readable `--output json` fields are unchanged, so existing scripts keep working.

Comment thread cli/azd/cmd/extension.go
Copilot AI review requested due to automatic review settings August 4, 2026 00:06
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 21cd8119-a644-4b3c-8c99-3f89f63a9968

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

Suppressed comments (4)

cli/azd/cmd/extension.go:2595

  • The user-facing rename is incomplete for skipped dependency rows. This line appends child.SkipReason, and pkg/extensions/manager.go:1159 still produces dependency upgrades disabled; ... available, so azd extension update --no-dependency-upgrades continues to display the old verb. Update that source string and its assertions to say dependency updates disabled.
				"%s%s Updating %s dependency",

cli/azd/extensions/azure.coding-agent/README.md:29

  • The sentence introducing this updated command still says users “want to upgrade” and is missing “have,” leaving this README inconsistent with the new command vocabulary. Update the introduction along with the command example.
azd extension update azure.coding-agent

docs/specs/metrics-audit/feature-telemetry-matrix.md:33

  • The command inventory is still inconsistent: the Extensions row above this updated Tool row lists extension list/show/install/upgrade. Change that command-facing reference to update; the ext.upgrade event and extension.upgrade.* keys should remain unchanged.
    docs/specs/metrics-audit/telemetry-schema.md:20
  • The telemetry schema terminology update is incomplete. Line 19 still calls ext.install an install/upgrade event, lines 207-216 describe extension updates as upgrades, and lines 288, 312, and 320-327 still describe the azd tool command as upgrade. Update those command-facing headings and descriptions to “update” while retaining the intentionally stable ext.upgrade and tool.upgrade.* keys.
  • Files reviewed: 48/48 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@JeffreyCA JeffreyCA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can go a bit further and use update everywhere in the code and output, and keep upgrade only where we really need backward compatibility.

Specifically, I think we can:

  • Rename all Go identifiers, exported APIs, interfaces, tests, and filenames that belong to these extension and tool update flows from Upgrade to Update. I don't see any external consumers using those exported APIs.
  • Rename telemetry to ext.update, tool.update.*, and the matching Update constants. The command span names (cmd.extension.update) already change, so keeping the old telemetry names would leave us with mixed terms.
  • Rename extension update JSON from "upgraded" to "updated", "upgraded" counts to "updated", and dependencyUpgrades to dependencyUpdates.
  • Rename tool update JSON, including --dry-run, from "action": "upgrade" to "action": "update".
  • Add --no-dependency-updates as the new flag while keeping --no-dependency-upgrades as a hidden alias for existing scripts.
  • Keep azd extension upgrade and azd tool upgrade as command aliases.
  • Keep upgrade for terms owned by other tools or protocols, such as helm upgrade, package-manager or pip upgrade arguments, WebSocket upgrades, existing URLs, etc.

The JSON changes only affect extension update -o json, extension update --all -o json, and the matching tool update result and dry-run output, which I think this is an acceptable break - I don't see any occurrences users running azd ext upgrade or azd tool upgrade with --output json in our telemetry.

I also think we can also remove the hook compatibility change. The extension and tool commands do not use HooksMiddleware, so those old hook names never worked. The middleware change affects other commands and is not needed for this rename.

@jongio

jongio commented Aug 4, 2026

Copy link
Copy Markdown
Member

@JeffreyCA I agree on dropping the hook compatibility change, and I think the case is stronger than "those names never worked".

HooksMiddleware is registered on exactly ten commands: restore, build, provision, package, deploy, publish, up and down in cli/azd/cmd/root.go, plus infra create and infra delete in cli/azd/cmd/infra.go. None of them declare cobra Aliases. The new commandHookNames helper only appends entries when aliases is non-empty, so for every command that actually runs the middleware it returns []string{commandPath}, which is exactly what the two lines it replaced returned.

So it isn't only that tool and extension don't register the middleware, which is what I noted earlier on extension.go. The helper is unreachable across the whole command tree as it stands. Test_CommandHooks_Middleware_WithQualifiedCmdAlias constructs the middleware directly with Aliases: []string{"upgrade"} so it passes, but nothing in the real command tree can produce that input.

Dropping hooks.go and hooks_test.go would remove the only non-mechanical change here and leave this as a pure rename.

Unrelated to the code: the failing azure-dev - cli check isn't from this PR. It's been failing on main for the last three builds (259ce35, f2449f7, 980665a), and 980665a fails on the same BuildAndTest BuildCLI Linux job. Building and running the unit suite at this PR's HEAD locally is clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions Extensions (general) ext-agents azure.ai.agents extension ext-coding-agent azure.coding-agent extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Extension] Rename upgrade to update

5 participants