Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ If any details are missing, prompt the user accordingly:
- **Service Tree ID**: GUID format identifier for the service in Service Tree. Before creating release plan, always show the value to user and ask them to confirm it's a valid value in service tree.
- **Product Service Tree ID**: GUID format identifier for the product in Service Tree. Before creating release plan, always show the value to user and ask them to confirm it's a valid value in service tree.
- **Expected Release Timeline**: Format must be in "Month YYYY"
- **API Version**: The version of the API being released
- **SDK Release Type**: Value must be beta or stable.
- "beta" for preview API versions
- "stable" for GA API versions
- "beta"
- "stable"

## Step 4: Create Release Plan
- If the user doesn't know the required details, direct them to create a release plan using the release planner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u
High level steps involved:
1. Generate SDK locally
2. Build / Compile SDK locally
3. Run package checks
4. Run package tests
5. Update change log, metadata and version
3. Commit generated changes checkpoint
4. Run package checks
5. Run package tests
6. Update changelog, metadata and version
7. Commit final changes checkpoint

---

Expand All @@ -21,7 +23,7 @@ High level steps involved:
**Goal**: Ensure the user understands the overall SDK generation and build process before starting.
**Actions**:

- Present the high-level steps involved in generating and building SDK locally:
- **MUST** present the high-level steps involved in generating and building SDK locally:
1. Select target language
2. Verify SDK repository
3. Validate repository path
Expand All @@ -30,7 +32,11 @@ High level steps involved:
6. Generate SDK using `azsdk_package_generate_code` MCP tool
7. Identify SDK project path
8. Build/Compile SDK using `azsdk_package_build_code` MCP tool
- Ask the user to confirm readiness to proceed.
9. Commit generated changes checkpoint
10. Run package checks
11. Run package tests
12. Update changelog, metadata and version
13. Commit final changes checkpoint

---

Expand Down Expand Up @@ -132,26 +138,58 @@ High level steps involved:

---

### Step 3: Run package validation
### Step 3: Stage checkpoint — Commit generated changes

**Goal**: Prompt the user to commit the changes produced by the generation and build steps before proceeding to validation and testing.
**Actions**:

- **MUST** inform the user that SDK generation and build have completed successfully.
- **MUST** prompt the user to decide if they want to commit the changes now. Do NOT skip this prompt.
- If the user chooses to commit:
- Check if the user is on the `main` branch. If so, prompt: *"You are currently on the main branch. Please create a new branch using `git checkout -b <branch-name>` before proceeding."* Suggest a reasonable default branch name based on the generation context (e.g., `sdk/<service-name>/<package-name>`) and provide the exact `git checkout -b <branch-name>` command for the user to run. Allow the user to provide a preferred branch name instead. Wait for user confirmation before continuing.
- Run `git add <modified-files>` to stage the changed files.
- Prompt the user for a commit message.
- Run `git commit -m "<user-provided-message>"`.
- If the user chooses to skip, acknowledge and proceed to the next step.

---

### Step 4: Run package checks

**Actions**:

- Run `azsdk_package_run_check` MCP tool to validate the generated SDK package in the identified project directory.

---

### Step 4: Run package tests
### Step 5: Run package tests

**Actions**:

- Run `azsdk_package_run_tests` MCP tool to run tests on the generated SDK package in the identified project directory.

---

### Step 5: Update change log, metadata and version
### Step 6: Update changelog, metadata and version

**Actions**:

- Run `azsdk_package_update_changelog_content` MCP tool to update changelog in the identified project directory.
- Run `azsdk_package_update_metadata` MCP tool to update metadata in the identified project directory.
- Run `azsdk_package_update_changelog_content` MCP tool to update change log in the identified project directory.
- Run `azsdk_package_update_version` MCP tool to update version in the identified project directory.
- Run `azsdk_package_update_version` MCP tool to update version in the identified project directory.

---

### Step 7: Stage checkpoint — Commit final changes

**Goal**: Prompt the user to commit the final set of changes after all updates are complete.
**Actions**:

- **MUST** inform the user that changelog, metadata, and version updates are complete.
- **MUST** prompt the user to decide if they want to commit the changes now. Do NOT skip this prompt.
- If the user chooses to commit:
- Check if the user is on the `main` branch. If so, prompt: *"You are currently on the main branch. Please create a new branch using `git checkout -b <branch-name>` before proceeding."* Suggest a reasonable default branch name based on the generation context (e.g., `sdk/<service-name>/<package-name>`) and provide the exact `git checkout -b <branch-name>` command for the user to run. Allow the user to provide a preferred branch name instead. Wait for user confirmation before continuing.
- Run `git add <modified-files>` to stage the changed files.
- Prompt the user for a commit message.
- Run `git commit -m "<user-provided-message>"`.
- If the user chooses to skip, acknowledge and proceed.
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
---
description: 'Identify languages configured in the TypeSpec project and add it to release plan'
description: 'Update SDK details in a release plan from a TypeSpec project'
---
# Step 1: Find the list of languages and package names
**Goal**: Identify languages configured in the TypeSpec project and generate the json object with language and package name.
1. Identify the language emitter configuration in the `tspconfig.yaml` file in the TypeSpec project root.
2. Identify the package name or namespace for each language emitter.
- For Java and Python, use `emitter-output-dir` for package name if it exists. Otherwise use `package-dir` to get the package name as fallback approach.
- For .NET, use namespace property to get package name.
- For JavaScript, use `packagedetails:name` property to get package name.
- For Go, use module name and remove `github.com/Azure/azure-sdk-for-go/` to get package name.
3. Map the language name in emitter to one of the following in Pascal case(except .NET):
- .NET
- Java
- Python
- JavaScript
- Go
4. Create a JSON array object with the following structure:
```json
[
{
"language": "<LanguageName>",
"packageName": "<PackageName>"
},
...
]
```
5. If no languages are configured, inform the user: "No languages configured in TypeSpec project. Please add at least one language emitter in tspconfig.yaml."
**Success Criteria**: JSON object with languages and package names created.
# Step 1: Identify the TypeSpec project path
**Goal**: Identify the path to the TypeSpec project that contains the `tspconfig.yaml` file.
1. Identify the TypeSpec project directory that contains a `tspconfig.yaml` file.
2. If a TypeSpec project path is not provided or known, ask the user for the path.
3. If no `tspconfig.yaml` exists at the given path, inform the user: "No tspconfig.yaml found at the given path. Please provide a valid TypeSpec project path."
**Success Criteria**: Valid TypeSpec project path identified.

# Step 2: Check if release plan exists
**Goal**: Determine if a release plan exists for the API spec pull request or work item Id or release plan Id in current context.
Expand All @@ -36,17 +16,7 @@ description: 'Identify languages configured in the TypeSpec project and add it t
**Success Criteria**: Release plan exists or user informed to create one.

# Step 3: Update Release Plan with SDK Information
> **(MANDATORY - DO NOT SKIP) ALWAYS validate all package names against the format rules AND the examples table before calling any update tool, even if the user provides SDK details directly. Auto-correct and inform the user of invalid package names.**
> - **JavaScript**: Must start with `@azure/`
> - **Go**: Must start with `sdk/`
>
> **Valid package name examples (compare against these to catch invalid formats):**
> | Language | Valid | Invalid |
> |----------|-------|---------|
> | JavaScript | `@azure/arm-compute` | `arm-compute`, `azure/arm-compute`,`@azure-arm-compute` |
> | Go (management plane) | `sdk/resourcemanager/compute/armcompute` | `sdk/armcompute`, `/sdk/compute`, `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute` |

**Goal**: Update the release plan with the languages and package names identified in Step 1.
1. Use `azsdk_update_sdk_details_in_release_plan` to update the release plan work item with the JSON object created in Step 1.
**Goal**: Update the release plan with the SDK package names resolved from the TypeSpec project.
1. Use `azsdk_update_sdk_details_in_release_plan` with the release plan work item ID and the TypeSpec project path from Step 1.
2. Confirm successful update of the release plan with the SDK information and summary of languages and package names.
**Success Criteria**: Release plan updated with languages and package names.
**Success Criteria**: Release plan updated with languages and package names resolved from the TypeSpec project.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Follow the steps in #file:local-sdk-workflow.instructions.md to generate and bui
- Execute the SDK generation pipeline with the following required parameters for all languages:
- TypeSpec project root path
- API spec pull request number (if the API spec is not merged to the main branch, otherwise use 0)
- API version
- API version (optional)
- SDK release type (`beta` for preview API versions, `stable` otherwise)
- Language options:
For management plane: `Python`, `.NET`, `JavaScript`, `Java`, `Go`
Expand Down

This file was deleted.

46 changes: 37 additions & 9 deletions eng/common/mcp/azure-sdk-mcp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#Requires -PSEdition Core

param(
[string]$FileName = 'Azure.Sdk.Tools.Cli',
[string]$Package = 'azsdk',
[string]$Version, # Default to latest
[string]$InstallDirectory = '',
[string]$Repository = 'Azure/azure-sdk-tools',
Expand All @@ -15,11 +13,14 @@ param(
[switch]$UpdatePathInProfile
)

$ErrorActionPreference = "Stop"
$ErrorActionPreference = 'Stop'
. (Join-Path $PSScriptRoot '..' 'scripts' 'Helpers' 'AzSdkTool-Helpers.ps1')

$toolInstallDirectory = $InstallDirectory ? $InstallDirectory : (Get-CommonInstallDirectory)

$packageName = 'azsdk'
$packageFileName = 'Azure.Sdk.Tools.Cli'

$mcpMode = $Run

# Log to console or MCP client json-rpc
Expand Down Expand Up @@ -103,14 +104,40 @@ $tmp = $env:TEMP ? $env:TEMP : [System.IO.Path]::GetTempPath()
$guid = [System.Guid]::NewGuid()
$tempInstallDirectory = Join-Path $tmp "azsdk-install-$($guid)"

# If already installed, use first class version mechanism
$azsdkCmd = Get-Command -ErrorAction Ignore $packageName
if ($azsdkCmd -and !$InstallDirectory) {
$ErrorActionPreference = "Stop"
$upgrade = & $packageName upgrade --check --output json | out-string
if (!$LASTEXITCODE) {
$ErrorActionPreference = 'Ignore'
$localVersion = $upgrade | ConvertFrom-Json -AsHashtable
$ErrorActionPreference = 'Stop'
if ($localVersion -and $localVersion.old_version -and $localVersion.old_version -eq ($Version ? $Version : $localVersion.new_version)) {
log "Version up to date at $($localVersion.old_version)"
if ($Run) {
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $azsdkCmd.Path -ArgumentList 'mcp' -NoNewWindow -Wait
exit $proc.ExitCode
}
exit 0
}
if ($localVersion) {
log "Version not up to date at " + $localVersion.old_version
} else {
log "Failed to parse version:"
log $upgrade
}
}
}

if ($mcpMode) {
try {
# Swallow all output and re-log so we can wrap any
# output from the inner function as json-rpc
$tempExe = Install-Standalone-Tool `
-Version $Version `
-FileName $FileName `
-Package $Package `
-FileName $packageFileName `
-Package $packageName `
-Directory $tempInstallDirectory `
-Repository $Repository `
*>&1
Expand All @@ -126,8 +153,8 @@ if ($mcpMode) {
else {
$tempExe = Install-Standalone-Tool `
-Version $Version `
-FileName $FileName `
-Package $Package `
-FileName $packageFileName `
-Package $packageName `
-Directory $tempInstallDirectory `
-Repository $Repository `

Expand Down Expand Up @@ -164,7 +191,7 @@ if (Test-Path $tempInstallDirectory) {
}

if ($updateSucceeded) {
log "Executable $package is installed at $exeDestination"
log "Executable $packageName is installed at $exeDestination"
}
if (!$UpdatePathInProfile) {
log -warn "To add the tool to PATH for new shell sessions, re-run with -UpdatePathInProfile to modify the shell profile file."
Expand All @@ -175,5 +202,6 @@ else {
}

if ($Run) {
Start-Process -WorkingDirectory $RunDirectory -FilePath $exeDestination -ArgumentList 'start' -NoNewWindow -Wait
$proc = Start-Process -PassThru -WorkingDirectory $RunDirectory -FilePath $exeDestination -ArgumentList 'mcp' -NoNewWindow -Wait
exit $proc.ExitCode
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ jobs:
}
"rust" {
$generatePublicCIPipeline = 'false'
$internalVariableGroups = '$(AzureSDK_CratesIo_Release_Pipeline_Secrets) $(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations) $(Secrets_for_Resource_Provisioner)'
$generateUnifiedWeekly = 'true'
$internalVariableGroups = '$(Release_Secrets_for_GitHub) $(APIReview_AutoCreate_Configurations)'
}
"net" {
$generatePublicCIPipeline = 'false'
Expand Down
11 changes: 0 additions & 11 deletions eng/common/pipelines/templates/steps/bypass-local-dns.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:
New-Item -Path $parentFolder -ItemType Directory | Out-Null
}

$content = "registry=${{ parameters.registryUrl }}`n`nalways-auth=true"
$content = "registry=${{ parameters.registryUrl }}"
$content | Out-File '${{ parameters.npmrcPath }}'
displayName: 'Create .npmrc'
condition: ${{ parameters.CustomCondition }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ steps:
timeoutInMinutes: 5
env:
GH_TOKEN: $(azuresdk-github-pat)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
${{ if ne(parameters.NpmConfigUserConfig, '') }}:
NPM_CONFIG_USERCONFIG: ${{ parameters.NpmConfigUserConfig }}
${{ if ne(parameters.NpmConfigRegistry, '') }}:
Expand Down
Loading
Loading