[design] azd update command, auto-update, and channel management#6910
[design] azd update command, auto-update, and channel management#6910rajeshkamal5050 wants to merge 6 commits intoAzure:mainfrom
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a draft design document describing the proposed azd update command, opt-in auto-update behavior, and stable/daily channel management as part of Epic #6721.
Changes:
- Introduces a new design doc covering update command UX, configuration keys, and channel switching behavior.
- Documents install-method-aware update strategies (package manager vs direct binary replace) and elevation handling.
- Proposes daily build version tracking (build number) and an expanded update-check cache format.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cli/azd/docs/design/azd-update.md
Outdated
| cmd := exec.Command("sudo", "mv", stagedBinary, currentBinaryPath) | ||
| cmd.Stdin = os.Stdin | ||
| cmd.Stdout = os.Stdout | ||
| cmd.Stderr = os.Stderr |
There was a problem hiding this comment.
This section says to use the existing CommandRunner for elevation (sudo), but the snippet uses exec.Command directly. Consider rewriting the example to use CommandRunner (or label it as simplified pseudocode) so the guidance doesn’t conflict with the intended implementation approach.
| cmd := exec.Command("sudo", "mv", stagedBinary, currentBinaryPath) | |
| cmd.Stdin = os.Stdin | |
| cmd.Stdout = os.Stdout | |
| cmd.Stderr = os.Stderr | |
| // commandRunner is configured to pass through stdin/stdout/stderr so sudo | |
| // can prompt the user for their password as usual. | |
| err := commandRunner.Run(ctx, "sudo", "mv", stagedBinary, currentBinaryPath) | |
| if err != nil { | |
| // handle error | |
| } |
| | Installer | Value | Default Location | | ||
| |-----------|-------|------------------| | ||
| | Bash script | `install-azd.sh` | `/opt/microsoft/azd/` | | ||
| | PowerShell script | `install-azd.ps1` | `C:\Program Files\Azure Dev CLI\` (customizable via `-InstallFolder`) | | ||
| | Homebrew | `brew` | Homebrew prefix (e.g., `/usr/local/Cellar/azd/`) | |
There was a problem hiding this comment.
The markdown table syntax here uses a double leading pipe (e.g., || Installer | ...), which renders as an extra empty column in most markdown renderers. Consider changing to a single leading pipe (| Installer | ...) for correct formatting (same pattern appears in other tables in this doc).
| Two new config keys via `azd config`: | ||
|
|
||
| ```bash | ||
| azd config set updates.autoUpdate on # or "off" (default: off) | ||
| ``` |
There was a problem hiding this comment.
This section says “Two new config keys via azd config:” but the example only shows updates.autoUpdate. Since the design also introduces updates.checkIntervalHours (and persists updates.channel), update the text to reflect the full set of keys or adjust it to match what’s being proposed.
| - **Logic**: `main.go` → `fetchLatestVersion()` — async check at startup, cached in `~/.azd/update-check.json` | ||
| - **Skip**: `AZD_SKIP_UPDATE_CHECK=true` disables the check | ||
| - Already shows platform-specific upgrade instructions based on install method | ||
|
|
||
| **Current cache format** (`~/.azd/update-check.json`): |
There was a problem hiding this comment.
The cache location is described as ~/.azd/update-check.json, but the code uses config.GetUserConfigDir() which can be overridden via AZD_CONFIG_DIR. Consider describing it as {AZD_CONFIG_DIR or ~/.azd}/update-check.json to avoid documenting an incorrect path.
| - **Logic**: `main.go` → `fetchLatestVersion()` — async check at startup, cached in `~/.azd/update-check.json` | |
| - **Skip**: `AZD_SKIP_UPDATE_CHECK=true` disables the check | |
| - Already shows platform-specific upgrade instructions based on install method | |
| **Current cache format** (`~/.azd/update-check.json`): | |
| - **Logic**: `main.go` → `fetchLatestVersion()` — async check at startup, cached in `{AZD_CONFIG_DIR or ~/.azd}/update-check.json` | |
| - **Skip**: `AZD_SKIP_UPDATE_CHECK=true` disables the check | |
| - Already shows platform-specific upgrade instructions based on install method | |
| **Current cache format** (`{AZD_CONFIG_DIR or ~/.azd}/update-check.json`): |
cli/azd/docs/design/azd-update.md
Outdated
| Startup (every azd invocation): | ||
| 1. Check AZD_SKIP_UPDATE_CHECK / CI env vars → skip if set | ||
| 2. Check non-interactive terminal → skip if detected | ||
| 3. Background goroutine: check version (respecting channel-dependent cache TTL) | ||
| 4. If newer version available → download to ~/.azd/staging/ |
There was a problem hiding this comment.
The auto-update flow includes “Check non-interactive terminal → skip if detected”, but the explicit skip list later only mentions CI / --no-prompt / AZD_SKIP_UPDATE_CHECK. Please align these two sections by adding the non-interactive/TTY condition to the list (and defining detection) or removing it from the flow.
- Daily version format: single-line 1.24.0-beta.1-daily.5935787 - Code signing verification (macOS codesign, Windows Authenticode) - Elevation-aware auto-update with graceful fallback - Alpha feature toggle (alpha.update) for safe rollout - Telemetry fields and error codes including codeSignatureInvalid - Two-phase auto-update flow (stage + apply with re-exec) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Channel switch: bidirectional confirmation prompt (not just downgrade) - Cancellation UX: plain message instead of SUCCESS banner - Staged binary verification: codesign check before apply - copyFile fsync: flush data to disk to prevent corruption - Duplicate WARNING suppression: elevation warning suppresses out-of-date banner - Banner suppression for azd update and azd config commands - Fix telemetry code: update.signatureInvalid (not codeSignatureInvalid) - Version output: shows (daily) not (daily, build N), derived from binary Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…idance - Remove SHA256 checksum step (HTTPS provides integrity) - Windows: use MSI installer instead of direct binary replacement - Brew: document delegation to brew commands, no direct overwrite - Add update method column to elevation table Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Design doc for azd update command, auto-update, and channel management.
Covers:
azd updatecommand with channel switchingazd updateandazd configazd versionchannel suffix derived from binary version stringalpha.update, default off) for safe rolloutEpic: #6721