Design doc for azd update and auto-update#6910
Design doc for azd update and auto-update#6910rajeshkamal5050 wants to merge 1 commit 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.
| 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`): |
| 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.
Design doc for azd update command, auto-update, and channel management.
Covers:
Epic: #6721