Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/agents/changelog-core.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
name: Generate changelog (azd core)
description: Update azd core release changelog and version based on merged PRs.
infer: true
---

# Changelog (azd core)

You maintain the Azure Developer CLI (azd) release changelog.

## Scope

- Update **only**:
- `cli/azd/CHANGELOG.md`
- `cli/version.txt`
- `cli/azd/.vscode/cspell*` (if needed for spell checking)
- Repository: `Azure/azure-dev`

## Goal

Prepare a high-quality release entry that is accurate, user-facing, and consistent with the existing changelog style.

## Process

### 1. Prepare the version header

1. In `cli/azd/CHANGELOG.md`, find the top-most unreleased section (typically `## X.Y.Z-beta.1 (Unreleased)` if present).
2. Convert it to a release entry:
- Remove `-beta.*` and `(Unreleased)`.
- Add the release date in `YYYY-MM-DD` format, matching existing entries (e.g., `## 1.22.1 (2025-12-10)`).
3. Update `cli/version.txt` to the same released version.

### 2. Identify commits to include

1. Find the cutoff commit by inspecting recent changelog edits:
```bash
git --no-pager log -n 3 --follow -p -- cli/azd/CHANGELOG.md
```
In the diff output, identify the commit SHA that **added the previous released version’s notes** (the last non-empty release section).

Note: ignore automation/bot commits that only add a placeholder unreleased section like:
`## 1.x.y-beta.1 (Unreleased)` with empty categories.
2. List commits newer than the cutoff (increase `-20` as needed):
```bash
git --no-pager log --oneline --pretty=format:"%h (%ad)%d %s" --date=short -20 origin/main
```

### 3. Process changes one PR at a time (no batching)

For **each** commit newer than the cutoff, do this workflow fully (steps 1-6) before moving to the next commit. **DO NOT** batch process multiple commits/PRs, skip PRs, or cut the process short due to time constraints.

1. Extract PR number from the commit subject (`(#1234)`). If missing, find the PR another way (e.g., search by commit SHA).
2. Fetch PR details (owner: `Azure`, repo: `azure-dev`) using GitHub MCP.
3. Determine whether the PR author is an external contributor:
- Get the PR author handle.
- Consider them "core" if their handle appears in `.github/CODEOWNERS`; otherwise treat as external.
4. Identify linked issues from the PR description/body and fetch issue details using GitHub MCP when needed to understand user impact.
5. Decide if it belongs in the changelog. Exclude changes that are primarily:
- Tests or test infrastructure
- Documentation-only changes (`*.md`, `CODEOWNERS`, etc.)
- Pure refactors/cleanup/renames with no user impact
- CI/build/release infrastructure changes
- Automated dependency bumps that are purely dependency maintenance (updates to tools like Bicep CLI, GitHub CLI can remain in the changelog)
- Extension-only changes under `cli/azd/extensions/` (e.g. azure.ai.agent, microsoft.azd.demo, etc.)
6. Write the changelog entry to `CHANGELOG.md`:
- Categorize into one of: `### Features Added`, `### Bugs Fixed`, `### Other Changes`
- Add a bullet using the exact format: `- [[#PR]](https://github.com/Azure/azure-dev/pull/PR) User-facing description.`
- Guidelines: start with a verb (**Add**, **Fix**, **Update**, **Improve**); describe user impact; keep it short; prefer bug phrasing like "Fix <user-visible problem> …".
- Attribution: if the PR is from an external contributor, append: ` Thanks @handle for the contribution!`

### 4. Finalize

1. Remove any empty categories in the new release section.
2. Ensure formatting matches existing releases.
3. Spell check:
```bash
cspell lint "cli/azd/CHANGELOG.md" --relative --config cli/azd/.vscode/cspell.yaml --no-progress
```
If new names/handles trip cspell, update `cli/azd/.vscode/cspell-github-user-aliases.txt`.
95 changes: 95 additions & 0 deletions .github/agents/changelog-extension.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
name: Generate changelog (extensions)
description: Update an azd extension changelog and bump its version.
infer: true
---

# Changelog (extensions)

You maintain release notes for **azd extensions** under `cli/azd/extensions/`.

## Scope

For the **target extension folder** (for example `cli/azd/extensions/microsoft.azd.demo`), update **only**:

- `<extension>/CHANGELOG.md`
- `<extension>/version.txt`
- `<extension>/extension.yaml` (the `version:` field)

**DO NOT** update the core CLI changelog (`cli/azd/CHANGELOG.md`) or `registry.json`.

## Goal

Produce a user-facing release entry for the extension and ensure the extension's version is consistent across files.

## Process

### 1. Identify the target extension

1. Determine which extension is being released (folder under `cli/azd/extensions/`).
2. Confirm it contains:
- `CHANGELOG.md`
- `version.txt`
- `extension.yaml`

### 2. Bump the version

1. Choose the new version according to the extension's existing conventions (SemVer, and optional suffix like `-preview`).
2. Update **both**:
- `<extension>/version.txt`
- `<extension>/extension.yaml` (`version:`)

Keep them exactly in sync.

### 3. Prepare the changelog header

In `<extension>/CHANGELOG.md`, add a new top entry for the new version with today's date in `YYYY-MM-DD`, matching the file's existing formatting.

- If the changelog uses category headings (e.g., `### Features Added`), follow that style.
- If it uses simple bullet lists (no categories), keep it consistent.

### 4. Gather commits affecting the extension

1. Find the cutoff commit for the previous release entry, use the extension changelog history:

```bash
git --no-pager log -n 2 --follow -p -- <extension>/CHANGELOG.md
```

Identify the commit that added the previous version section, then only consider commits newer than that cutoff.

2. List commits newer than the cutoff:
```bash
git --no-pager log --oneline --pretty=format:"%h (%ad)%d %s" --date=short -10 origin/main -- <extension>/
```

### 5. Process changes one PR at a time (no batching)

For each commit/PR in scope, do the full workflow (steps 1-6) before moving to the next:

1. Extract PR number from the commit subject (`(#1234)`), or locate the PR by commit SHA.
2. Fetch PR details (owner: `Azure`, repo: `azure-dev`) using GitHub MCP.
3. Identify linked issues and fetch issue details if needed to understand user impact.
4. Decide if it belongs in the extension changelog. Exclude changes that are primarily:
- Tests or test infrastructure
- Documentation-only changes
- Pure refactors/cleanup/renames with no user impact
- CI/build/release infra changes
6. Write the changelog entry to `CHANGELOG.md`:

Add concise, user-facing bullets under the new version section.

- Start with a verb (**Add**, **Fix**, **Update**, **Improve**).
- Describe user impact (what changes for someone using the extension).
- Include PR link when available, using the format:
- `- [[#PR]](https://github.com/Azure/azure-dev/pull/PR) Description.`

### 6. Finalize

1. Ensure the new changelog entry matches the extension's existing style.
2. Ensure `<extension>/version.txt` and `<extension>/extension.yaml` versions match exactly.
3. Run spellcheck on the extension changelog if it's in scope for release:

```bash
cspell lint "<extension>/CHANGELOG.md" --relative --config cli/azd/.vscode/cspell.yaml --no-progress
```
48 changes: 3 additions & 45 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,48 +195,6 @@ func TestMyFunction(t *testing.T) {

## Changelog updates for releases

When preparing a new release changelog, update `cli/azd/CHANGELOG.md` and `cli/version.txt`:

### Step 1: Prepare version header
Rename any existing `## 1.x.x-beta.1 (Unreleased)` section to the version being released, without the `-beta.1` and `Unreleased` parts. Do the same for `cli/version.txt`.

### Step 2: Gather commits
**Find cutoff commit**:
```bash
git --no-pager log --grep="Increment CLI version" --invert-grep -n 3 --follow -p -- cli/azd/CHANGELOG.md
```
Review the diff output to find the most recent commit that added the previous version's changelog - this is the cutoff commit. Focus on the actual changelog changes in the diff instead of the commit messages themselves.

**Get commits to process**:
```bash
git --no-pager log --oneline --pretty=format:"%h (%ad) %s" --date=short -20 origin/main
```
Increase `-20` if needed to find the cutoff commit. `git log` shows commits in reverse chronological order (newest first). You must identify the cutoff commit and only take commits newer than (above) it.

### Step 3: Gather context and write changelog entry
**CRITICAL INSTRUCTION: Process each commit individually and sequentially. Complete the full workflow (extract PR, fetch details, categorize, write entry, save) one entry at a time. DO NOT batch process multiple commits/PRs, skip PRs, or cut the process short due to time constraints.**

1. **Extract PR number**: Look for `(#XXXX)` pattern in commit message
2. **Fetch PR details** using GitHub tools: owner: `Azure`, repo: `azure-dev`, pullNumber: `PR#`
- Get the GitHub handle of the PR owner, and determine whether the owner is outside the core team (handle not in `.github/CODEOWNERS`)
3. **Identify linked issues**: Scan PR details for GitHub issue references
4. **Fetch linked issue details** using GitHub tools: owner: `Azure`, repo: `azure-dev`, issue_number: `XXXX`
5. **Categorize change**: Features Added, Bugs Fixed, Other Changes
6. **Add changelog entry to CHANGELOG.md**:
- **Format**: `- [[PR#]](https://github.com/Azure/azure-dev/pull/PR#) User-friendly description.`
- **Process**: Read PR description and linked issue carefully to understand the user impact
- **Guidelines**:
- Be brief. Start with action verbs (Add, Fix, Update, etc.) and describe user impact. Follow existing changelog entries for style.
- For bugs, phrase the changelog entry in terms of the issue that was fixed when possible. Example: "Fix PowerShell 7 suggestion text not showing for service-level hooks."
- **Attribution**: For PRs from contributors outside the core team, append: " Thanks @handle for the contribution!"
7. **Exclude the following types of changes** from the changelog:
- Test-related changes and test infrastructure updates
- Documentation updates (README.md, .md files, CODEOWNERS)
- Automated dependency bumps and CVE fixes that are purely dependency updates (updates to tools like Bicep CLI, GitHub CLI should remain in the changelog)
- Internal refactoring, code cleanup, and variable renames without user impact
- Build/release infrastructure and CI/CD pipeline changes
- Changes exclusively under `cli/azd/extensions/` directory (extension-specific updates)

### Step 4: Organize and finalize
1. **Remove empty categories** and **validate formatting**
2. **Spell check**: Run `cspell lint "cli/azd/CHANGELOG.md" --relative --config cli/azd/.vscode/cspell.yaml --no-progress` and update `.vscode/cspell-github-user-aliases.txt` if needed
When asked to prepare a release changelog, use the appropriate custom agent instructions:
- `.github/agents/changelog-core.agent.md` for core CLI releases
- `.github/agents/changelog-extension.agent.md` for extension releases
7 changes: 3 additions & 4 deletions .github/policies/resourceManagement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ configuration:
reply: "Hi @${issueAuthor}. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing \"/reopen\" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the \"no-recent-activity\" label; otherwise, this is likely to be closed again with the next cleanup pass. "
- description:
frequencies:
- weekday:
day: Friday
time: 5:0
- hourly:
hour: 6
filters:
- isOpen
- isNotLabeledWith:
label: no-recent-activity
- noActivitySince:
days: 60
days: 7
- isPullRequest
actions:
- addLabel:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/ext-registry-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ext-registry-ci

on:
pull_request:
paths:
- "cli/azd/extensions/registry.json"
- ".github/workflows/ext-registry-ci.yml"
branches: [main]

# If two events are triggered within a short time in the same PR, cancel the run of the oldest event
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

jobs:
snapshot-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli/azd
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "^1.25"
cache-dependency-path: |
cli/azd/go.sum

- name: Build azd
run: go build .

- name: Run FigSpec snapshot test
run: go test ./cmd -v -run TestFigSpec

- name: Run Usage snapshot test
run: go test ./cmd -v -run TestUsage

- name: Check snapshot test results
if: failure()
run: |
echo "::error::Snapshots may be out of date. Run the following locally to update them:"
echo ""
echo " cd cli/azd"
echo " UPDATE_SNAPSHOTS=true go test ./cmd -run 'TestFigSpec|TestUsage'"
exit 1
3 changes: 2 additions & 1 deletion .github/workflows/stale-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ jobs:
# Exclude PRs from closing or being marked as stale
days-before-pr-stale: -1
days-before-pr-close: -1

operations-per-run: 500

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ cli/azd/extensions/microsoft.azd.ai.builder/microsoft.azd.ai.builder
cli/azd/extensions/microsoft.azd.ai.builder/microsoft.azd.ai.builder.exe
cli/azd/extensions/microsoft.azd.demo/microsoft.azd.demo
cli/azd/extensions/microsoft.azd.demo/microsoft.azd.demo.exe
cli/azd/extensions/microsoft.azd.concurx/concurx
cli/azd/extensions/microsoft.azd.concurx/concurx.exe
cli/azd/azd-test
1 change: 1 addition & 0 deletions .vscode/cspell-github-user-aliases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ vivazqu
weilim
Yionse
Saipriya
Menghua1
4 changes: 4 additions & 0 deletions cli/azd/.vscode/cspell-azd-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ BUILDID
BUILDNUMBER
buildpacks
byoi
callstack
cflags
charmbracelet
circleci
cmdrecord
cmdsubst
Cobo
cognitiveservices
concurx
conditionalize
consolesize
containeragent
Expand Down Expand Up @@ -150,6 +152,7 @@ jmes
jquery
keychain
kubelogin
langchain
langchaingo
LASTEXITCODE
ldflags
Expand Down Expand Up @@ -205,6 +208,7 @@ preinit
protogen
proxying
psanford
pseudonymized
psycopg
psycopgbinary
pulumi
Expand Down
12 changes: 12 additions & 0 deletions cli/azd/.vscode/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,18 @@ overrides:
- filename: pkg/project/service_target_dotnet_containerapp.go
words:
- IMAGENAME
- filename: extensions/microsoft.azd.extensions/internal/resources/languages/**/.gitignore
words:
- rsuser
- userosscache
- docstates
- dylib
- filename: docs/recording-functional-tests-guide.md
words:
- httptest
- Logf
- Getenv
- httptest
ignorePaths:
- "**/*_test.go"
- "**/mock*.go"
Expand Down
Loading
Loading