Skip to content

Commit 81ec85b

Browse files
committed
Merge remote-tracking branch 'origin/main' into feature/azure-ai-projects/2.3.0
2 parents 0fa136a + 89c1029 commit 81ec85b

175 files changed

Lines changed: 56732 additions & 105 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/skills/azsdk-common-prepare-release-plan/SKILL.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ DO NOT USE FOR: SDK code generation, pipeline troubleshooting, API review feedba
2323
- Do not display Azure DevOps work item URLs; only provide the Release Plan Link and ID.
2424
- Require an API spec PR link or a TypeSpec project path before creating or updating a plan.
2525
- Validate that the spec PR repository matches the requested API release type before creation.
26+
- Release plan tools accept **either** a Release Plan ID or an Azure DevOps work item ID — pass whichever the user provides. Each tool resolves the value automatically (trying it as a Release Plan ID first, then as a work item ID), so you do not need to call `azure-sdk-mcp:azsdk_get_release_plan` first just to translate one ID into the other.
2627

2728
## MCP Tools
2829

@@ -116,10 +117,10 @@ DO NOT USE FOR: SDK code generation, pipeline troubleshooting, API review feedba
116117

117118
**Steps**:
118119

119-
1. **Identify Plan** — Get the release plan work item ID from the user.
120+
1. **Identify Plan** — Get the Release Plan ID or work item ID from the user (either is accepted).
120121
2. **Identify TypeSpec Project** — Get or confirm the TypeSpec project path.
121122
3. **Update** — Run `azure-sdk-mcp:azsdk_update_sdk_details_in_release_plan` with:
122-
- `releasePlanWorkItemId` (required)
123+
- `workItemId` (required — accepts either the Release Plan ID or the work item ID)
123124
- `typeSpecProjectPath` (required)
124125

125126
**Tool**: `azure-sdk-mcp:azsdk_update_sdk_details_in_release_plan`
@@ -147,12 +148,12 @@ DO NOT USE FOR: SDK code generation, pipeline troubleshooting, API review feedba
147148

148149
**Steps**:
149150

150-
1. **Identify Plan** — Get the work item ID or release plan ID.
151+
1. **Identify Plan** — Get the Release Plan ID or work item ID from the user (either is accepted).
151152
2. **Collect PR Info** — Get the SDK pull request URL and language from the user.
152153
3. **Link** — Run `azure-sdk-mcp:azsdk_link_sdk_pull_request_to_release_plan` with:
153154
- `pullRequestUrl` (required)
154155
- `language` (required — e.g., ".NET", "Java", "JavaScript", "Python", "Go")
155-
- `workItemId` or `releasePlanId`
156+
- `workItemId` or `releasePlanId` (either accepts the Release Plan ID or the work item ID)
156157
4. **Repeat** — If multiple SDK PRs exist for different languages, repeat for each.
157158

158159
**Tool**: `azure-sdk-mcp:azsdk_link_sdk_pull_request_to_release_plan`
@@ -174,5 +175,5 @@ DO NOT USE FOR: SDK code generation, pipeline troubleshooting, API review feedba
174175

175176
- Requires `azure-sdk-mcp` server; no CLI fallback — prompt user to configure MCP if unavailable.
176177
- If creation fails, verify spec PR URL and Service Tree IDs.
177-
- If update fails, ensure the work item ID or release plan ID is correct and the plan is not already abandoned.
178+
- If update fails, ensure the Release Plan ID or work item ID is correct and the plan is not already abandoned.
178179
- If linking fails, verify the SDK PR URL is valid and the language matches a supported value.

.github/skills/azsdk-common-prepare-release-plan/evals/eval.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ stimuli:
3939
config:
4040
substring: "release plan"
4141

42+
# Regression for issue #15988: when the user provides a Release Plan ID, the
43+
# agent can pass it directly to azsdk_update_sdk_details_in_release_plan. The
44+
# tool resolves either a Release Plan ID or a work item ID, so the agent should
45+
# NOT need a separate azsdk_get_release_plan call just to translate the ID.
46+
- name: release-plan-resolve-work-item-id-001
47+
prompt: "Update the SDK details in release plan 50001 for the TypeSpec project specification/contosowidgetmanager/Contoso.WidgetManager."
48+
graders:
49+
- type: tool-calls
50+
config:
51+
required:
52+
- name: azure-sdk-mcp-azsdk_update_sdk_details_in_release_plan
53+
4254
- name: release-plan-negative-001
4355
prompt: "Release the azure-mgmt-compute Python package to PyPI now."
4456
graders:

.github/skills/azsdk-common-prepare-release-plan/references/release-plan-details.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
> **CRITICAL**: Do not mention or display Azure DevOps work item links/URLs. Only provide Release Plan Link and Release Plan ID to the user. All manual updates must be made through the Release Planner Tool (https://aka.ms/sdk-release-planner).
44
5+
## Release Plan ID vs Work Item ID
6+
7+
A release plan has two distinct identifiers:
8+
9+
- **Release Plan ID**: the value users typically refer to (e.g. in a prompt), shown in the Release Planner.
10+
- **Work Item ID**: the Azure DevOps work item backing the release plan.
11+
12+
The release plan tools (update release plan, update SDK details, run SDK
13+
generation, link SDK PR) accept **either** value — pass whichever the user gives
14+
you. Each tool resolves the supplied number automatically, trying it as a
15+
Release Plan ID first and then as a work item ID, so you do **not** need to run
16+
`azsdk_get_release_plan` first just to translate one ID into the other.
17+
518
## Required Information
619

720
Collect these details (do not use temporary values):
@@ -25,7 +38,7 @@ If user provides an invalid combination, inform them of the correct pairing.
2538

2639
To update SDK details in the release plan:
2740

28-
- Run `azsdk_update_sdk_details_in_release_plan` with the release plan work item ID and TypeSpec project path
41+
- Run `azsdk_update_sdk_details_in_release_plan` with the `workItemId` (either the Release Plan ID or the work item ID is accepted) and TypeSpec project path.
2942

3043
## Namespace Approval (Management Plane Only)
3144

@@ -40,4 +53,4 @@ For first release of management plane SDK:
4053
If SDK PRs exist:
4154

4255
1. Ensure GitHub CLI authentication (`gh auth login`)
43-
2. Run `azsdk_link_sdk_pull_request_to_release_plan` for each PR
56+
2. Run `azsdk_link_sdk_pull_request_to_release_plan` for each PR, passing the Release Plan ID or work item ID as `workItemId` (or as `releasePlanId`) — either value is accepted.

.github/skills/create-package-skill/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: create-package-skill
3-
description: 'Interactive wizard that walks service teams through creating a package-specific skill for their Azure SDK package. Scans the package, detects customization patterns, scaffolds a SKILL.md with references, validates with vally lint, and registers in find-package-skill. WHEN: create package skill; add service skill; bootstrap skill for package; new package skill; skill for my SDK package; write skill for search; write skill for cosmos.'
3+
description: 'Interactive wizard that walks service teams through creating a package-specific skill for their Azure SDK package. Scans the package, detects customization patterns, scaffolds a SKILL.md with references, and validates with vally lint. The skill is placed inside the package''s .github/skills/ directory so find-package-skill discovers it automatically. WHEN: create package skill; add service skill; bootstrap skill for package; new package skill; skill for my SDK package; write skill for search; write skill for cosmos.'
44
---
55

66
# Create Package Skill Wizard
@@ -33,7 +33,7 @@ Run each phase in order. **Progressive loading:** Read only the current phase fi
3333
| **Phase 1** | 📝 Scaffold SKILL.md — generate skill with step-by-step post-regen workflow (Option A) or reference-manual structure (Option B) | [phases/01-scaffold-skill.md](phases/01-scaffold-skill.md) |
3434
| **Phase 2** | 📚 Generate References — create customizations.md (required) and optionally architecture.md | [phases/02-generate-references.md](phases/02-generate-references.md) |
3535
| **Phase 3** | Validate -- run vally lint | [phases/03-validate.md](phases/03-validate.md) |
36-
| **Phase 4** | 📋 Registeradd to find-package-skill table | [phases/04-register.md](phases/04-register.md) |
36+
| **Phase 4** | 📋 Finalizeconfirm discoverable location, summarize | [phases/04-finalize.md](phases/04-finalize.md) |
3737

3838
## Guardrails
3939

.github/skills/create-package-skill/phases/03-validate.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ If over budget, split content into additional reference files (for example, brea
3434
## Step 3 — DECIDE
3535

3636
Present validation results. If all pass:
37-
Question: "Validation passed. Proceed to register the skill?"
37+
Question: "Validation passed. Proceed to finalize the skill?"
3838

3939
If failures exist, present them and ask:
4040
Question: "These issues need fixing. Fix now, or skip validation?"
4141

4242
📍 **Phase 3 complete** | Validation: pass/fail | Next: Phase 4
4343

4444
---
45-
## → Next: Phase 4 — Register
46-
Read [04-register.md](04-register.md) and begin immediately.
45+
## → Next: Phase 4 — Finalize
46+
Read [04-finalize.md](04-finalize.md) and begin immediately.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Phase 4: Finalize 📋
2+
3+
> 📍 **Phase 4 — Finalize** | Confirm the skill is in its discoverable location and summarize.
4+
5+
## Step 1 — Confirm discoverable location
6+
7+
Package skills are discovered automatically by `find-package-skill`, which looks
8+
for a `.github/skills/` directory **inside the package directory**. There is no
9+
central registry to update — placement *is* registration.
10+
11+
Verify the skill lives at:
12+
13+
```
14+
sdk/<service>/<package-name>/.github/skills/<package-name>/SKILL.md
15+
```
16+
17+
If it's there, it will be discovered for that package. No further wiring needed.
18+
19+
## Step 2 — Summary
20+
21+
Print a summary of everything created:
22+
23+
📋 **Package Skill Created**
24+
25+
| Item | Path | Status |
26+
|---|---|---|
27+
| SKILL.md | `sdk/<service>/<package-name>/.github/skills/<package-name>/SKILL.md` | Created |
28+
| architecture.md | `...references/architecture.md` | Created/Skipped |
29+
| customizations.md | `...references/customizations.md` | Created/Skipped |
30+
| find-package-skill | discovers automatically via package `.github/skills/` | No action |
31+
| vally lint | 3/3 checks | Passed |
32+
33+
**Next steps for the service team:**
34+
1. Fill in any `<!-- TODO -->` sections with domain-specific knowledge.
35+
2. Test the skill by asking an agent to regenerate your package
36+
3. Iterate: agent gets something wrong → update skill → test again.
37+
4. Submit a PR.
38+
39+
**Maintaining your skill:**
40+
- When your package's customizations change, update the skill.
41+
- Keep content static — no version numbers or release-specific info
42+
43+
## Step 3 — CONFIRM
44+
45+
Question: "The skill is in place and will be discovered automatically. Anything else to adjust?"
46+
47+
📍 **Phase 4 complete** | Skill in place and discoverable | Wizard done 🎉

.github/skills/create-package-skill/phases/04-register.md

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
---
22
name: find-package-skill
3-
description: '**UTILITY SKILL** — Must be consulted before making any changes to packages under sdk/. Provides package-specific domain knowledge that prevents common mistakes. WHEN: "add feature to package", "fix bug in package", "modify package code", "regenerate from typespec", "change client library".'
3+
description: '**UTILITY SKILL** — Must be consulted before making any changes to packages under sdk/. Discovers and loads package-specific domain knowledge that prevents common mistakes. WHEN: "add feature to package", "fix bug in package", "modify package code", "regenerate from typespec", "change client library".'
44
---
55

66
# Find Package Skill
77

8-
Before modifying any SDK package in this monorepo, check this registry to see
9-
if a package-specific skill exists. Package skills contain tribal knowledge
10-
(architecture, data flows, type mappings, pitfalls) that prevents common mistakes.
8+
Some SDK packages in this monorepo have **package-specific skills** — tribal
9+
knowledge (architecture, data flows, type mappings, pitfalls) that prevents
10+
common mistakes. Before modifying any SDK package, check whether a skill exists
11+
for it using the steps below.
1112

12-
Always check this registry before modifying any SDK package — even if you think
13-
you already know the package well.
13+
## How to Discover Package Skills
1414

15-
## How to Use
15+
1. **Determine the package directory.** If you already know the file path you're
16+
modifying, extract the package directory from it (e.g., a file at
17+
`sdk/search/azure-search-documents/azure/search/documents/_search_client.py`
18+
belongs to the package at `sdk/search/azure-search-documents/`). If you only
19+
have a package name, search for a matching directory under `sdk/` (package
20+
directories are named after the distribution package name, e.g.,
21+
`azure-search-documents``sdk/search/azure-search-documents/`).
1622

17-
1. Find the package you're modifying in the table below.
18-
2. Read the SKILL.md at the listed path using the Read tool. Then read all files under the `references/` directory next to it for additional context.
19-
3. If the package isn't listed, no package-specific skill exists yet — proceed normally.
23+
2. **Check for a `.github/skills/` directory** inside the package directory. For
24+
example, check whether `sdk/search/azure-search-documents/.github/skills/` exists.
2025

21-
## Package Skills
26+
3. **If it exists**, read every `SKILL.md` found under that directory. If a
27+
`references/` subdirectory exists next to a `SKILL.md`, read all files in it
28+
too for additional context.
2229

23-
| Package | Path |
24-
| ------------------------- | --------------------------------------------------------------------------- |
25-
| `azure-search-documents` | `sdk/search/azure-search-documents/.github/skills/azure-search-documents/SKILL.md` |
30+
4. **If no `.github/skills/` directory exists** for the package, no
31+
package-specific skill has been created yet — proceed normally.

eng/common/mcp/azure-sdk-mcp.ps1

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,27 +106,51 @@ $tempInstallDirectory = Join-Path $tmp "azsdk-install-$($guid)"
106106

107107
# If already installed, use first class version mechanism
108108
$azsdkCmd = Get-Command -ErrorAction Ignore $packageName
109+
# Also check the default install directory (~/bin) in case it's not on PATH
110+
if (!$azsdkCmd -and !$InstallDirectory) {
111+
$existingExe = Join-Path $toolInstallDirectory ($IsWindows ? "$packageName.exe" : $packageName)
112+
if (Test-Path -PathType Leaf $existingExe) {
113+
$azsdkCmd = Get-Command -ErrorAction Ignore $existingExe
114+
}
115+
}
109116
if ($azsdkCmd -and !$InstallDirectory) {
110-
$ErrorActionPreference = "Stop"
111-
$upgrade = & $packageName upgrade --check --output json | out-string
112-
if (!$LASTEXITCODE) {
113-
$ErrorActionPreference = 'Ignore'
114-
$localVersion = $upgrade | ConvertFrom-Json -AsHashtable
115-
$ErrorActionPreference = 'Stop'
116-
if ($localVersion -and $localVersion.old_version -and $localVersion.old_version -eq ($Version ? $Version : $localVersion.new_version)) {
117-
log "Version up to date at $($localVersion.old_version)"
118-
if ($Run) {
119-
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $azsdkCmd.Path -ArgumentList 'mcp' -NoNewWindow -Wait
120-
exit $proc.ExitCode
117+
try {
118+
$ErrorActionPreference = "Stop"
119+
$upgrade = & $azsdkCmd.Path upgrade --check --output json | out-string
120+
if (!$LASTEXITCODE) {
121+
$ErrorActionPreference = 'Ignore'
122+
$localVersion = $upgrade | ConvertFrom-Json -AsHashtable
123+
$ErrorActionPreference = 'Stop'
124+
if ($localVersion -and $localVersion.old_version -and $localVersion.old_version -eq ($Version ? $Version : $localVersion.new_version)) {
125+
log "Version up to date at $($localVersion.old_version)"
126+
if ($Run) {
127+
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $azsdkCmd.Path -ArgumentList 'mcp' -NoNewWindow -Wait
128+
exit $proc.ExitCode
129+
}
130+
exit 0
131+
}
132+
if ($localVersion) {
133+
log "Version not up to date at " + $localVersion.old_version
134+
} else {
135+
log "Failed to parse version:"
136+
log $upgrade
121137
}
122-
exit 0
138+
} elseif ($Run) {
139+
# Upgrade check failed (e.g. network error, rate limit, timeout),
140+
# but the binary already exists — fall back to running it as-is
141+
# rather than attempting a fresh install that will likely also fail.
142+
log -warn "Upgrade check failed, falling back to existing installation at '$($azsdkCmd.Path)'"
143+
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $azsdkCmd.Path -ArgumentList 'mcp' -NoNewWindow -Wait
144+
exit $proc.ExitCode
123145
}
124-
if ($localVersion) {
125-
log "Version not up to date at " + $localVersion.old_version
126-
} else {
127-
log "Failed to parse version:"
128-
log $upgrade
146+
}
147+
catch {
148+
if ($Run) {
149+
log -warn "Upgrade check error: $($_.Exception.Message). Falling back to existing installation."
150+
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $azsdkCmd.Path -ArgumentList 'mcp' -NoNewWindow -Wait
151+
exit $proc.ExitCode
129152
}
153+
throw
130154
}
131155
}
132156

@@ -147,6 +171,14 @@ if ($mcpMode) {
147171
}
148172
catch {
149173
log -err $_
174+
# If install failed but an existing binary is available, fall back to it
175+
# instead of exiting (which causes the MCP client to respawn in a loop).
176+
$existingExe = Join-Path $toolInstallDirectory ($IsWindows ? "$packageName.exe" : $packageName)
177+
if ($Run -and (Test-Path -PathType Leaf $existingExe)) {
178+
log -warn "Installation failed, falling back to existing installation at '$existingExe'"
179+
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $existingExe -ArgumentList 'mcp' -NoNewWindow -Wait
180+
exit $proc.ExitCode
181+
}
150182
exit 1
151183
}
152184
}

0 commit comments

Comments
 (0)