Skip to content

Commit fdb5660

Browse files
Merge remote-tracking branch 'upstream/main' into wangamber/transcription
2 parents 414e8af + 8542424 commit fdb5660

File tree

200 files changed

+9135
-777
lines changed

Some content is hidden

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

200 files changed

+9135
-777
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,11 @@
276276
# AzureSdkOwners: @samvaity
277277
# ServiceOwners: @assafi
278278

279+
# PRLabel: %Cognitive - Translator
280+
/sdk/translation/ @jrjrguo @SG-MS @Azure/azure-java-sdk
281+
279282
# ServiceLabel: %Cognitive - Translator
280-
# ServiceOwners: @swmachan @MikeyMCZ
283+
# ServiceOwners: @swmachan @jrjrguo @SG-MS
281284

282285
# ServiceLabel: %Commerce
283286
# ServiceOwners: @ms-premp @qiaozha
@@ -851,12 +854,6 @@
851854
# AzureSdkOwners: @jairmyree
852855
# ServiceOwners: @klaaslanghout
853856

854-
# PRLabel: %Text Translation
855-
/sdk/translation/azure-ai-translation-text/ @MikeyMCZ @Azure/azure-java-sdk
856-
857-
# ServiceLabel: %Text Translation
858-
# ServiceOwners: @MikeyMCZ
859-
860857
# ServiceLabel: %TimeseriesInsights
861858
# ServiceOwners: @Shipra1Mishra
862859

.github/copilot-instructions.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ The Azure SDK for Java repository contains client libraries for Azure services,
2525
### Prerequisites
2626

2727
- To use Azure MCP tool calls, users must have PowerShell installed. Provide [PowerShell installation instructions](https://learn.microsoft.com/powershell/scripting/install/installing-powershell) if not installed, and recommend restarting the IDE to start the MCP server.
28-
- Always run the [`azsdk_verify_setup`](../eng/common/instructions/azsdk-tools/verify-setup.instructions.md) tool to check the user's development environment setup for using SDK MCP tools. DO NOT PROCEED with running other tools before completing this step. Only skip for queries that don't need tools.
28+
- When using Copilot from Visual Studio or VS Code (not applicable when using Coding Agent on Github.com):
29+
- **Always run** the [`azsdk_verify_setup`](../eng/common/instructions/azsdk-tools/verify-setup.instructions.md) tool first to validate the user's development environment for SDK MCP tools.
30+
- **Do not proceed** with any other tool execution until this step is complete.
31+
- **Skip this check only** for queries that do not require tool execution.
2932

3033
## Behavior
3134

eng/common/instructions/azsdk-tools/check-package-readiness.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Check the release readiness of an SDK package by collecting the required informa
1515
- Go
1616

1717
2. **Execute Readiness Check**:
18-
- Use the `azsdk_check_package_release_readiness` tool with the provided package name and selected language
18+
- Use the `azsdk_release_sdk` tool with the provided package name, selected language, and set checkReady to true.
1919
- Do not check for existing pull requests to run this step.
2020
- Do not ask the user to create a release plan to run this step.
2121

eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,16 @@ description: "Guide the user to generate and build SDKs locally for a TypeSpec b
55
# Goal
66

77
Help the user generate and build SDKs locally from TypeSpec API specifications using the `azure-sdk-mcp` tools.
8+
High level steps involved:
9+
1. Generate SDK locally
10+
2. Build / Compile SDK locally
11+
3. Run package checks
12+
4. Run package tests
13+
5. Update change log, metadata and version
814

915
---
1016

11-
## Part A: Generate SDK Locally
17+
## Generate SDK Locally
1218

1319
### Step 1: Outline workflow
1420

@@ -20,9 +26,10 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u
2026
2. Verify SDK repository
2127
3. Validate repository path
2228
4. Identify path to configuration file
23-
5. Generate SDK using `azsdk_package_generate_code` MCP tool
24-
6. Identify SDK project path
25-
7. Build/Compile SDK using `azsdk_package_build_code` MCP tool
29+
5. Verify setup for the selected language
30+
6. Generate SDK using `azsdk_package_generate_code` MCP tool
31+
7. Identify SDK project path
32+
8. Build/Compile SDK using `azsdk_package_build_code` MCP tool
2633
- Ask the user to confirm readiness to proceed.
2734

2835
---
@@ -89,15 +96,20 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u
8996

9097
---
9198

92-
### Step 6: Generate SDK
93-
99+
### Step 6: Verify setup for selected language
94100
**Actions**:
101+
- Run `azsdk_verify_setup` MCP tool to ensure the local environment is correctly configured for the selected SDK language.
102+
103+
---
95104

105+
### Step 7: Generate SDK
106+
107+
**Actions**:
96108
- Run `azsdk_package_generate_code` MCP tool to generate the SDK locally.
97109

98110
---
99111

100-
## Part B: Build / Compile SDK Locally
112+
## Build / Compile SDK Locally
101113

102114
### Step 1: Identify SDK project path
103115

@@ -117,3 +129,29 @@ Help the user generate and build SDKs locally from TypeSpec API specifications u
117129
**Actions**:
118130

119131
- Run `azsdk_package_build_code` MCP tool to compile the SDK in the identified project directory.
132+
133+
---
134+
135+
### Step 3: Run package validation
136+
137+
**Actions**:
138+
139+
- Run `azsdk_package_run_check` MCP tool to validate the generated SDK package in the identified project directory.
140+
141+
---
142+
143+
### Step 4: Run package tests
144+
145+
**Actions**:
146+
147+
- Run `azsdk_package_run_tests` MCP tool to run tests on the generated SDK package in the identified project directory.
148+
149+
---
150+
151+
### Step 5: Update change log, metadata and version
152+
153+
**Actions**:
154+
155+
- Run `azsdk_package_update_metadata` MCP tool to update metadata in the identified project directory.
156+
- Run `azsdk_package_update_changelog_content` MCP tool to update change log in the identified project directory.
157+
- Run `azsdk_package_update_version` MCP tool to update version in the identified project directory.

eng/common/instructions/azsdk-tools/typespec-to-sdk.instructions.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,28 @@ Pre-requisites:
1717
# SDK generation steps
1818

1919
## Step: Generate SDKs
20-
**Goal**: Generate SDKs
21-
**Message to user**: "SDK generation will take approximately 15-20 minutes. Currently, SDKs are generated using the Azure DevOps pipeline. SDK generation is supported only from a merged API spec or from an API spec pull request in the https://github.com/Azure/azure-rest-api-specs repository."
20+
21+
As a first step, you must prompt the user to understand the intention of SDK generation. Based on the user input, you can either run SDK generation locally or use SDK generation pipeline.
22+
23+
Generate SDK locally in cases below:
24+
- If the user wants to walk through each SDK generation step locally. This approach requires user to have the setup for each language to generate SDK locally. User can create a pull request for each language after completing all the steps in SDK generation successfully to get the generated SDK reviewed and merged.
25+
- If SDK or client.tsp customizations are needed before creating a pull request.
26+
- If the user wants to add tests, samples or any customization to the generated SDK.
27+
28+
Generate SDK using pipeline:
29+
- If the user wants to generate SDK and get a PR automatically created in Azure SDK language repositories. This approach can be followed if the user does not want to setup local environment for each language.
30+
31+
### Generate SDK locally:
32+
33+
**Condition**: If user chooses to generate SDK locally
34+
**Message to user**: "Generating SDKs locally requires you to have the development environment set up for each language. Prompt the user to create a pull request for each language after completing the following steps successfully: generation, validation, build, test and update of metadata, change log, and version."
35+
**Actions**:
36+
Follow the steps in #file:local-sdk-workflow.instructions.md to generate and build SDKs locally from TypeSpec project.
37+
38+
### Generate SDK using pipeline:
39+
40+
**Condition**: If user chooses to generate the SDK using pipeline or when generating SDK by GitHub coding agent
41+
**Message to user**: "SDK generation will take approximately 15-20 minutes. SDKs are generated using the Azure DevOps pipeline. SDK generation is supported only from a merged API spec or from an API spec pull request in the https://github.com/Azure/azure-rest-api-specs repository."
2242
**Actions**:
2343
1. Identify whether TypeSpec is for Management Plane or Data Plane based on project structure and files. tspconfig.yaml file contains `resource-manager` for management plane and `data-plane` for data plane as resource provider.
2444
- Execute the SDK generation pipeline with the following required parameters for all languages:
@@ -33,7 +53,8 @@ Pre-requisites:
3353
2. Monitor pipeline status after 15 minutes and provide updates. If pipeline is in progress, inform user that it may take additional time and check the status later.
3454
3. Display generated SDK PR links when available. If pipeline fails, inform user with error details and suggest to check pipeline logs for more information.
3555
4. If SDK pull request is available for all languages, ask user to review generated SDK pull request and mark them as ready for review when they are ready to get them reviewed and merged.
36-
5. If SDK pull request was created for test purposes, inform user to close the test SDK pull request.
56+
5. Inform the user that they can checkout generated SDK pull request locally and add more tests, samples or code customizations if needed using local SDK generation tools.
57+
6. If SDK pull request was created for test purposes, inform user to close the test SDK pull request.
3758
**Success Criteria**: SDK generation pipeline initiated and SDKs generated
3859

3960
## Step: SDK release plan

eng/common/instructions/azsdk-tools/verify-setup.instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: 'Verify Setup'
55
## Goal
66
This tool verifies the developer's environment for SDK development and release tasks. It returns what requirements are missing for the specified languages and repo, or success if all requirements are satisfied.
77

8-
Your goal is to identify the project repo root, and pass in the `packagePath` to the Verify Setup tool. For a language repo, pass in the language of the repo.
8+
Your goal is to identify the project repo root, and pass in the `packagePath` to the Verify Setup tool. For a language repo, pass in the language of the repo.
99

1010
## Examples
1111
- in `azure-sdk-for-js`, run `azsdk_verify_setup` with `(langs=javascript, packagePath=<path>/azure-sdk-for-js)`.
@@ -14,6 +14,8 @@ Your goal is to identify the project repo root, and pass in the `packagePath` to
1414
The user can specify multiple languages to check. If the user wants to check all languages, pass in ALL supported languages. Passing in no languages will only check the core requirements.
1515

1616
## Output
17-
Display results in a user-friendly and concise format, highlighting any missing dependencies that need to be addressed and how to resolve them.
17+
Display clear, step-by-step instructions on how to resolve any missing requirements identified. Explain why the requirement is necessary if it has a `reason` field. Organize requirements into categorical sections.
18+
19+
Based on the user's shell environment, enhance the tool instructions with shell-specific commands for resolving missing dependencies.
1820

1921
When Python tool requirements fail, inform the user about the `AZSDKTOOLS_PYTHON_VENV_PATH` environment variable if they have setup issues. The verify-setup tool can only check Python requirements within the virtual environment specified by this environment variable.

eng/common/pipelines/ai-evals-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
trigger: none
2-
3-
pr:
1+
trigger:
42
branches:
53
include:
64
- main
@@ -9,6 +7,8 @@ pr:
97
- .github/copilot-instructions.md
108
- eng/common/instructions/azsdk-tools/**
119

10+
pr: none
11+
1212
parameters:
1313
- name: EvalProject
1414
type: string
@@ -45,4 +45,4 @@ extends:
4545
EvalRepoCommit: ${{ parameters.EvalRepoCommit }}
4646
TargetRepoOwner: $(TargetRepoOwner)
4747
TargetRepoName: $(TargetRepoName)
48-
TargetRepoCommit: $(TargetRepoCommit)
48+
TargetRepoCommit: $(TargetRepoCommit)

eng/common/pipelines/templates/steps/create-apireview.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,30 +37,29 @@ steps:
3737
parameters:
3838
WorkingDirectory: ${{ parameters.SourceRootPath }}
3939

40-
- task: Powershell@2
41-
inputs:
42-
filePath: ${{ parameters.SourceRootPath }}/eng/common/scripts/Create-APIReview.ps1
43-
# PackageInfoFiles example: @('a/file1.json','a/file2.json')
44-
arguments: >
45-
-PackageInfoFiles @('${{ join(''',''', parameters.PackageInfoFiles) }}')
46-
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
47-
-ArtifactPath '${{parameters.ArtifactPath}}'
48-
-ArtifactName ${{ parameters.ArtifactName }}
49-
-APIKey '$(azuresdk-apiview-apikey)'
50-
-PackageName '${{parameters.PackageName}}'
51-
-SourceBranch '$(Build.SourceBranchName)'
52-
-DefaultBranch '$(DefaultBranch)'
53-
-ConfigFileDir '${{parameters.ConfigFileDir}}'
54-
-BuildId '$(Build.BuildId)'
55-
-RepoName '$(Build.Repository.Name)'
56-
-MarkPackageAsShipped $${{parameters.MarkPackageAsShipped}}
57-
pwsh: true
58-
displayName: Create API Review
59-
condition: >-
60-
and(
61-
succeededOrFailed(),
62-
ne(variables['Skip.CreateApiReview'], 'true'),
63-
ne(variables['Build.Reason'],'PullRequest'),
64-
eq(variables['System.TeamProject'], 'internal'),
65-
not(endsWith(variables['Build.Repository.Name'], '-pr'))
66-
)
40+
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest'), not(endsWith(variables['Build.Repository.Name'], '-pr'))) }}:
41+
- task: AzureCLI@2
42+
inputs:
43+
azureSubscription: 'APIView prod deployment'
44+
scriptType: pscore
45+
scriptLocation: scriptPath
46+
scriptPath: ${{ parameters.SourceRootPath }}/eng/common/scripts/Create-APIReview.ps1
47+
# PackageInfoFiles example: @('a/file1.json','a/file2.json')
48+
arguments: >
49+
-PackageInfoFiles @('${{ join(''',''', parameters.PackageInfoFiles) }}')
50+
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
51+
-ArtifactPath '${{parameters.ArtifactPath}}'
52+
-ArtifactName ${{ parameters.ArtifactName }}
53+
-PackageName '${{parameters.PackageName}}'
54+
-SourceBranch '$(Build.SourceBranchName)'
55+
-DefaultBranch '$(DefaultBranch)'
56+
-ConfigFileDir '${{parameters.ConfigFileDir}}'
57+
-BuildId '$(Build.BuildId)'
58+
-RepoName '$(Build.Repository.Name)'
59+
-MarkPackageAsShipped $${{parameters.MarkPackageAsShipped}}
60+
displayName: Create API Review
61+
condition: >-
62+
and(
63+
succeededOrFailed(),
64+
ne(variables['Skip.CreateApiReview'], 'true')
65+
)

eng/common/pipelines/templates/steps/set-test-pipeline-version.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ parameters:
1414
- name: TestPipeline
1515
type: boolean
1616
default: false
17-
- name: ArtifactsJson
18-
type: string
19-
default: ''
17+
- name: Artifacts
18+
type: object
19+
default: []
2020

2121
steps:
2222
- ${{ if eq(parameters.TestPipeline, true) }}:
@@ -31,5 +31,5 @@ steps:
3131
-PackageNames '${{ coalesce(parameters.PackageName, parameters.PackageNames) }}'
3232
-ServiceDirectory '${{ parameters.ServiceDirectory }}'
3333
-TagSeparator '${{ parameters.TagSeparator }}'
34-
-ArtifactsJson '${{ parameters.ArtifactsJson }}'
34+
-Artifacts @('${{ replace(convertToJson(parameters.Artifacts), '''', '`''') }}' | ConvertFrom-Json)
3535
pwsh: true

eng/common/scripts/Create-APIReview.ps1

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,42 @@ Param (
44
[array] $ArtifactList,
55
[Parameter(Mandatory=$True)]
66
[string] $ArtifactPath,
7-
[Parameter(Mandatory=$True)]
8-
[string] $APIKey,
97
[string] $SourceBranch,
108
[string] $DefaultBranch,
119
[string] $RepoName,
1210
[string] $BuildId,
1311
[string] $PackageName = "",
1412
[string] $ConfigFileDir = "",
15-
[string] $APIViewUri = "https://apiview.dev/AutoReview",
13+
[string] $APIViewUri = "https://apiview.dev/autoreview",
1614
[string] $ArtifactName = "packages",
1715
[bool] $MarkPackageAsShipped = $false,
1816
[Parameter(Mandatory=$False)]
1917
[array] $PackageInfoFiles
2018
)
2119

2220
Set-StrictMode -Version 3
21+
2322
. (Join-Path $PSScriptRoot common.ps1)
2423
. (Join-Path $PSScriptRoot Helpers ApiView-Helpers.ps1)
2524

25+
# Get Bearer token for APIView authentication
26+
# In Azure DevOps, this uses the service connection's Managed Identity/Service Principal
27+
function Get-ApiViewBearerToken()
28+
{
29+
try {
30+
$tokenResponse = az account get-access-token --resource "api://apiview" --output json 2>&1
31+
if ($LASTEXITCODE -ne 0) {
32+
Write-Error "Failed to acquire access token: $tokenResponse"
33+
return $null
34+
}
35+
return ($tokenResponse | ConvertFrom-Json).accessToken
36+
}
37+
catch {
38+
Write-Error "Failed to acquire access token: $($_.Exception.Message)"
39+
return $null
40+
}
41+
}
42+
2643
# Submit API review request and return status whether current revision is approved or pending or failed to create review
2744
function Upload-SourceArtifact($filePath, $apiLabel, $releaseStatus, $packageVersion, $packageType)
2845
{
@@ -78,9 +95,17 @@ function Upload-SourceArtifact($filePath, $apiLabel, $releaseStatus, $packageVer
7895
Write-Host "Request param, compareAllRevisions: true"
7996
}
8097

81-
$uri = "${APIViewUri}/UploadAutoReview"
98+
$uri = "${APIViewUri}/upload"
99+
100+
# Get Bearer token for authentication
101+
$bearerToken = Get-ApiViewBearerToken
102+
if (-not $bearerToken) {
103+
Write-Error "Failed to acquire Bearer token for APIView authentication."
104+
return [System.Net.HttpStatusCode]::Unauthorized
105+
}
106+
82107
$headers = @{
83-
"ApiKey" = $apiKey;
108+
"Authorization" = "Bearer $bearerToken";
84109
"content-type" = "multipart/form-data"
85110
}
86111

@@ -115,20 +140,28 @@ function Upload-ReviewTokenFile($packageName, $apiLabel, $releaseStatus, $review
115140
if($MarkPackageAsShipped) {
116141
$params += "&setReleaseTag=true"
117142
}
118-
$uri = "${APIViewUri}/CreateApiReview?${params}"
143+
$uri = "${APIViewUri}/create?${params}"
119144
if ($releaseStatus -and ($releaseStatus -ne "Unreleased"))
120145
{
121146
$uri += "&compareAllRevisions=true"
122147
}
123148

124149
Write-Host "Request to APIView: $uri"
150+
151+
# Get Bearer token for authentication
152+
$bearerToken = Get-ApiViewBearerToken
153+
if (-not $bearerToken) {
154+
Write-Error "Failed to acquire Bearer token for APIView authentication."
155+
return [System.Net.HttpStatusCode]::Unauthorized
156+
}
157+
125158
$headers = @{
126-
"ApiKey" = $APIKey;
159+
"Authorization" = "Bearer $bearerToken"
127160
}
128161

129162
try
130163
{
131-
$Response = Invoke-WebRequest -Method 'GET' -Uri $uri -Headers $headers
164+
$Response = Invoke-WebRequest -Method 'POST' -Uri $uri -Headers $headers
132165
Write-Host "API review: $($Response.Content)"
133166
$StatusCode = $Response.StatusCode
134167
}

0 commit comments

Comments
 (0)