Skip to content

Commit b424ad1

Browse files
author
Andrew Mathew
committed
merged files
2 parents 173a676 + b328d88 commit b424ad1

File tree

2,416 files changed

+139541
-113823
lines changed

Some content is hidden

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

2,416 files changed

+139541
-113823
lines changed

Diff for: .github/CODEOWNERS

+3-4
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
/sdk/keyvault/ @mccoyp
179179

180180
# PRLabel: %Load Test Service
181-
/sdk/loadtesting/azure-developer-loadtesting/ @msyyc @iscai-msft
181+
/sdk/loadtesting/azure-developer-loadtesting/ @prativen @mitsha-microsoft @ninallam
182182

183183
# PRLabel: %Monitor
184184
/sdk/loganalytics/azure-loganalytics/ @azmonapplicationinsights @pvaneck
@@ -306,20 +306,19 @@
306306
/sdk/mixedreality/azure-mixedreality-authentication/ @RamonArguelles
307307
/sdk/remoterendering/ @FlorianBorn71
308308

309-
# AzureSdkOwners: @kristapratico
310309
# ServiceLabel: %OpenAI
311310
# ServiceOwners: @trrwilson
312311

313312
# PRLabel: %OpenAI
314-
/sdk/openai/ @kristapratico @glecaros
313+
/sdk/openai/ @trrwilson
315314

316315
# ServiceLabel: %Operator Nexus - Network Cloud
317316
# PRLabel: %Operator Nexus - Network Cloud
318317
/sdk/networkcloud/ @Azure/azure-sdk-write-networkcloud
319318

320319
# ServiceLabel: %Purview
321320
# PRLabel: %Purview
322-
/sdk/purview/ @saxenarahulMs
321+
/sdk/purview/ @saxenarahulMs @adyabansal-ms
323322

324323
# ServiceLabel: %Recovery Services
325324
# ServiceOwners: @Daya-Patil @Sharmistha-Rai

Diff for: .vscode/cspell.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"sdk/ai/azure-ai-inference/samples/hello_how_are_you.mp3",
3737
"sdk/ai/azure-ai-inference/tests/hello_how_are_you.mp3",
3838
"sdk/ai/azure-ai-projects/samples/agents/nifty_500_quarterly_results.csv",
39+
"sdk/ai/azure-ai-projects/samples/agents/tripadvisor_openapi.json",
3940
"/sdk/ai/azure-ai-projects/samples/evaluations/async_samples/data/**",
4041
"/sdk/ai/azure-ai-projects/samples/evaluations/data/**",
4142
"sdk/ai/azure-ai-resources/azure/ai/resources/_index/_langchain/vendor/**",
@@ -68,6 +69,7 @@
6869
"sdk/digitaltwins/azure-digitaltwins-core/**",
6970
"sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_vendor/**",
7071
"sdk/evaluation/azure-ai-evaluation/tests/**",
72+
"sdk/evaluation/azure-ai-evaluation/samples/agent_evaluators/**",
7173
"sdk/eventhub/azure-eventhub-checkpointstoretable/**",
7274
"sdk/eventhub/azure-eventhub-checkpointstoreblob-aio/**",
7375
"sdk/eventhub/azure-eventhub/**",
@@ -403,6 +405,7 @@
403405
"rtsp",
404406
"rtype",
405407
"rwdlacu",
408+
"sansiohttppolicy",
406409
"scbedd",
407410
"sdist",
408411
"sdpath",
@@ -1342,6 +1345,10 @@
13421345
{
13431346
"filename": "sdk/ai/azure-ai-projects/**",
13441347
"words": [
1348+
"coso",
1349+
"longtitude",
1350+
"abbrev",
1351+
"accommodations",
13451352
"ENTRAID",
13461353
"entraid",
13471354
"aiservices",
@@ -1400,7 +1407,10 @@
14001407
"upia",
14011408
"xpia",
14021409
"expirable",
1403-
"ralphe"
1410+
"ralphe",
1411+
"Inadherent",
1412+
"nbformat",
1413+
"nbconvert",
14041414
]
14051415
},
14061416
{

Diff for: doc/dev/ai/ai_prompt_workflow.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# AI Prompt Workflow
2+
3+
4+
1. In Copilot **Agent** mode, click on `Add Context` and select `prompt` from the dropdown.
5+
6+
*Note*: Agent mode is currently only available in [VSCode Insiders](https://code.visualstudio.com/insiders/).
7+
8+
![Agent Mode](step1.png)
9+
10+
2. Select `next-pylint.prompt.md` or associated prompt for your task.
11+
12+
![Select Prompt](step2.png)
13+
14+
3. Send the prompt to the agent. Follow the instructions provided by the agent to complete the task.
15+
16+
![Hit Enter!](step3.png)

Diff for: doc/dev/ai/step1.png

233 KB
Loading

Diff for: doc/dev/ai/step2.png

17.5 KB
Loading

Diff for: doc/dev/ai/step3.png

20.6 KB
Loading

Diff for: eng/apiview_reqs.txt

+17-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1-
apiview-stub-generator==0.3.16
2-
azure-pylint-guidelines-checker==0.0.7
3-
pylint<3.0.0
1+
astroid==2.15.8
2+
charset-normalizer==3.4.1
3+
dill==0.3.9
4+
isodate==0.6.1
5+
isort==5.13.2
6+
lazy-object-proxy==1.10.0
7+
mccabe==0.7.0
8+
pkginfo==1.12.1.2
9+
platformdirs==4.3.6
10+
pylint==2.17.7
11+
pylint-guidelines-checker==0.0.7
12+
six==1.17.0
13+
tomli==2.2.1
14+
tomlkit==0.13.2
15+
typing_extensions==4.12.2
16+
wrapt==1.17.2
17+
apiview-stub-generator==0.3.18

Diff for: eng/common/TestResources/New-TestResources.ps1

+40-2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ param (
9393
})]
9494
[array] $AllowIpRanges = @(),
9595

96+
# Instead of running the post script, create a wrapped file to run it with parameters
97+
# so that CI can run it in a subsequent step with a refreshed azure login
98+
[Parameter()]
99+
[string] $SelfContainedPostScript,
100+
96101
[Parameter()]
97102
[switch] $CI = ($null -ne $env:SYSTEM_TEAMPROJECTID),
98103

@@ -625,9 +630,42 @@ try {
625630
SetResourceNetworkAccessRules -ResourceGroupName $ResourceGroupName -AllowIpRanges $AllowIpRanges -CI:$CI
626631

627632
$postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path -ChildPath "$ResourceType-resources-post.ps1"
633+
634+
if ($SelfContainedPostScript -and !(Test-Path $postDeploymentScript)) {
635+
throw "-SelfContainedPostScript is not supported if there is no 'test-resources-post.ps1' script in the deployment template directory"
636+
}
637+
628638
if (Test-Path $postDeploymentScript) {
629-
Log "Invoking post-deployment script '$postDeploymentScript'"
630-
&$postDeploymentScript -ResourceGroupName $ResourceGroupName -DeploymentOutputs $deploymentOutputs @PSBoundParameters
639+
if ($SelfContainedPostScript) {
640+
Log "Creating invokable post-deployment script '$SelfContainedPostScript' from '$postDeploymentScript'"
641+
642+
$deserialized = @{}
643+
foreach ($parameter in $PSBoundParameters.GetEnumerator()) {
644+
if ($parameter.Value -is [System.Management.Automation.SwitchParameter]) {
645+
$deserialized[$parameter.Key] = $parameter.Value.ToBool()
646+
} else {
647+
$deserialized[$parameter.Key] = $parameter.Value
648+
}
649+
}
650+
$deserialized['ResourceGroupName'] = $ResourceGroupName
651+
$deserialized['DeploymentOutputs'] = $deploymentOutputs
652+
$serialized = $deserialized | ConvertTo-Json
653+
654+
$outScript = @"
655+
`$parameters = `@'
656+
$serialized
657+
'`@ | ConvertFrom-Json -AsHashtable
658+
# Set global variables that aren't always passed as parameters
659+
`$ResourceGroupName = `$parameters.ResourceGroupName
660+
`$AdditionalParameters = `$parameters.AdditionalParameters
661+
`$DeploymentOutputs = `$parameters.DeploymentOutputs
662+
$postDeploymentScript `@parameters
663+
"@
664+
$outScript | Out-File $SelfContainedPostScript
665+
} else {
666+
Log "Invoking post-deployment script '$postDeploymentScript'"
667+
&$postDeploymentScript -ResourceGroupName $ResourceGroupName -DeploymentOutputs $deploymentOutputs @PSBoundParameters
668+
}
631669
}
632670

633671
if ($templateFile.jsonFilePath.EndsWith('.compiled.json')) {

Diff for: eng/common/TestResources/deploy-test-resources.yml

+25
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ parameters:
99
ResourceType: test
1010
UseFederatedAuth: true
1111
PersistOidcToken: false
12+
SelfContainedPostScript: self-contained-test-resources-post.ps1
1213

1314
# SubscriptionConfiguration will be splatted into the parameters of the test
1415
# resources script. It should be JSON in the form:
@@ -89,6 +90,8 @@ steps:
8990
# Write the new SubscriptionConfiguration to be used by the remove test resources
9091
Write-Host "##vso[task.setvariable variable=SubscriptionConfiguration;]$($subscriptionConfiguration | ConvertTo-Json -Compress)"
9192
93+
$postScriptPath = $${{ parameters.PersistOidcToken }} ? '$(Agent.TempDirectory)/${{ parameters.SelfContainedPostScript }}' : $null
94+
9295
# The subscriptionConfiguration may have ArmTemplateParameters defined, so
9396
# pass those in via the ArmTemplateParameters flag, and handle any
9497
# additional parameters from the pipelines via AdditionalParameters
@@ -100,10 +103,32 @@ steps:
100103
@subscriptionConfiguration `
101104
-AdditionalParameters ${{ parameters.ArmTemplateParameters }} `
102105
-AllowIpRanges ('$(azsdk-corp-net-ip-ranges)' -split ',') `
106+
-SelfContainedPostScript $postScriptPath `
103107
-CI `
104108
-Force `
105109
-Verbose | Out-Null
106110
111+
- ${{ if eq(parameters.PersistOidcToken, true) }}:
112+
# ARM deployments that take longer than 10-15 minutes (e.g. HSM) can
113+
# cause post scripts to fail with expired credentials.
114+
# Add a new task with a refreshed token as a workaround to this issue.
115+
- task: AzureCLI@2
116+
displayName: Test Resources Post with refreshed login
117+
env:
118+
${{ insert }}: ${{ parameters.EnvVars }}
119+
inputs:
120+
azureSubscription: ${{ parameters.ServiceConnection }}
121+
addSpnToEnvironment: true
122+
scriptLocation: inlineScript
123+
scriptType: pscore
124+
inlineScript: |
125+
eng/common/scripts/Import-AzModules.ps1 # Support post scripts using az powershell instead of az cli
126+
$env:ARM_OIDC_TOKEN = $env:idToken
127+
$scriptPath = '$(Agent.TempDirectory)/${{ parameters.SelfContainedPostScript }}'
128+
Write-Host "Executing self contained test resources post script '$scriptPath'"
129+
& $scriptPath
130+
Remove-Item $scriptPath # avoid any possible complications when we run multiple deploy templates
131+
107132
- ${{ else }}:
108133
- pwsh: |
109134
eng/common/scripts/Import-AzModules.ps1

Diff for: eng/common/pipelines/templates/jobs/generate-job-matrix.yml

+6
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ parameters:
4545
- name: EnablePRGeneration
4646
type: boolean
4747
default: false
48+
# name of the variable that will be added when creating batches for the PR Job Matrix
4849
- name: PRMatrixSetting
4950
type: string
5051
default: 'ArtifactPackageNames'
52+
# name of the key in PackageInfo that will be used to get the identifier when generating matrix batches
53+
- name: PRMatrixKey
54+
type: string
55+
default: 'ArtifactName'
5156
- name: PRJobBatchSize
5257
type: number
5358
default: 10
@@ -141,6 +146,7 @@ jobs:
141146
-PackagePropertiesFolder $(Build.ArtifactStagingDirectory)/PackageInfo `
142147
-PRMatrixFile matrix.json `
143148
-PRMatrixSetting ${{ parameters.PRMatrixSetting }} `
149+
-PRMatrixKey ${{ parameters.PRMatrixKey }} `
144150
-DisplayNameFilter '$(displayNameFilter)' `
145151
-Filters '${{ join(''',''', parameters.MatrixFilters) }}', 'container=^$', 'SupportedClouds=^$|${{ parameters.CloudConfig.Cloud }}', 'Pool=${{ pool.filter }}' `
146152
-IndirectFilters '${{ join(''',''', parameters.PRMatrixIndirectFilters) }}' `

Diff for: eng/common/pipelines/templates/stages/archetype-sdk-tool-pwsh.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ parameters:
1010
- name: TargetTags
1111
type: string
1212
default: ''
13+
- name: PreTestSteps
14+
type: object
15+
default: []
1316

1417
variables:
1518
- template: /eng/pipelines/templates/variables/globals.yml
@@ -36,6 +39,8 @@ stages:
3639
vmImage: $(Image)
3740

3841
steps:
42+
- ${{ parameters.PreTestSteps }}
43+
3944
- template: /eng/common/pipelines/templates/steps/run-pester-tests.yml
4045
parameters:
4146
TargetDirectory: ${{ parameters.TargetDirectory }}

Diff for: eng/common/scripts/Delete-RemoteTag.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ catch
3030
{
3131
LogError "Remove-GitHubSourceReferences failed with exception:`n$_"
3232
exit 1
33-
}
33+
}

Diff for: eng/common/scripts/Helpers/ApiView-Helpers.ps1

+111
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,114 @@ function Process-ReviewStatusCode($statusCode, $packageName, $apiApprovalStatus,
117117
$packageNameStatus.IsApproved = $packageNameApproved
118118
$packageNameStatus.Details = $packageNameApprovalDetails
119119
}
120+
121+
function Set-ApiViewCommentForRelatedIssues {
122+
param (
123+
[Parameter(Mandatory = $true)]
124+
[string]$HeadCommitish,
125+
[string]$APIViewHost = "https://apiview.dev",
126+
[ValidateNotNullOrEmpty()]
127+
[Parameter(Mandatory = $true)]
128+
$AuthToken
129+
)
130+
. ${PSScriptRoot}\..\common.ps1
131+
$issuesForCommit = $null
132+
try {
133+
$issuesForCommit = Search-GitHubIssues -CommitHash $HeadCommitish
134+
if ($issuesForCommit.items.Count -eq 0) {
135+
LogError "No issues found for commit: $HeadCommitish"
136+
exit 1
137+
}
138+
} catch {
139+
LogError "No issues found for commit: $HeadCommitish"
140+
exit 1
141+
}
142+
$issuesForCommit.items | ForEach-Object {
143+
$urlParts = $_.url -split "/"
144+
Set-ApiViewCommentForPR -RepoOwner $urlParts[4] -RepoName $urlParts[5] -PrNumber $urlParts[7] -HeadCommitish $HeadCommitish -APIViewHost $APIViewHost -AuthToken $AuthToken
145+
}
146+
}
147+
148+
function Set-ApiViewCommentForPR {
149+
param (
150+
[Parameter(Mandatory = $true)]
151+
[string]$RepoOwner,
152+
[Parameter(Mandatory = $true)]
153+
[string]$RepoName,
154+
[Parameter(Mandatory = $true)]
155+
[string]$PrNumber,
156+
[Parameter(Mandatory = $true)]
157+
[string]$HeadCommitish,
158+
[Parameter(Mandatory = $true)]
159+
[string]$APIViewHost,
160+
[ValidateNotNullOrEmpty()]
161+
[Parameter(Mandatory = $true)]
162+
$AuthToken
163+
)
164+
$repoFullName = "$RepoOwner/$RepoName"
165+
$apiviewEndpoint = "$APIViewHost/api/pullrequests?pullRequestNumber=$PrNumber&repoName=$repoFullName&commitSHA=$HeadCommitish"
166+
LogDebug "Get APIView information for PR using endpoint: $apiviewEndpoint"
167+
168+
$commentText = @()
169+
$commentText += "## API Change Check"
170+
try {
171+
$response = Invoke-WebRequest -Uri $apiviewEndpoint -Method Get -MaximumRetryCount 3
172+
if ($response.StatusCode -ne 200) {
173+
LogWarning "API changes are not detected in this pull request."
174+
$commentText += ""
175+
$commentText += "API changes are not detected in this pull request."
176+
}
177+
else {
178+
LogSuccess "APIView identified API level changes in this PR and created $($response.Count) API reviews"
179+
$commentText += ""
180+
$commentText += "APIView identified API level changes in this PR and created the following API reviews"
181+
$commentText += ""
182+
183+
$responseContent = $response.Content | ConvertFrom-Json
184+
if ($RepoName.StartsWith(("azure-sdk-for-"))) {
185+
$responseContent | ForEach-Object {
186+
$commentText += "[$($_.packageName)]($($_.url))"
187+
}
188+
} else {
189+
$commentText += "| Language | API Review for Package |"
190+
$commentText += "|----------|---------|"
191+
$responseContent | ForEach-Object {
192+
$commentText += "| $($_.language) | [$($_.packageName)]($($_.url)) |"
193+
}
194+
}
195+
}
196+
} catch{
197+
LogError "Failed to get API View information for PR: $PrNumber in repo: $repoFullName with commitSHA: $Commitish. Error: $_"
198+
exit 1
199+
}
200+
201+
$commentText += "<!-- Fetch URI: $apiviewEndpoint -->"
202+
$commentText = $commentText -join "`r`n"
203+
$existingComment = $null;
204+
$existingAPIViewComment = $null;
205+
206+
try {
207+
$existingComment = Get-GitHubIssueComments -RepoOwner $RepoOwner -RepoName $RepoName -IssueNumber $PrNumber -AuthToken $AuthToken
208+
$existingAPIViewComment = $existingComment | Where-Object {
209+
$_.body.StartsWith("**API Change Check**", [StringComparison]::OrdinalIgnoreCase) -or $_.body.StartsWith("## API Change Check", [StringComparison]::OrdinalIgnoreCase) }
210+
} catch {
211+
LogWarning "Failed to get comments from Pull Request: $PrNumber in repo: $repoFullName"
212+
}
213+
214+
try {
215+
if ($existingAPIViewComment) {
216+
LogDebug "Updating existing APIView comment..."
217+
Update-GitHubIssueComment -RepoOwner $RepoOwner -RepoName $RepoName `
218+
-CommentId $existingAPIViewComment.id -Comment $commentText `
219+
-AuthToken $AuthToken
220+
} else {
221+
LogDebug "Creating new APIView comment..."
222+
Add-GitHubIssueComment -RepoOwner $RepoOwner -RepoName $RepoName `
223+
-IssueNumber $PrNumber -Comment $commentText `
224+
-AuthToken $AuthToken
225+
}
226+
} catch {
227+
LogError "Failed to set PR comment for APIView. Error: $_"
228+
exit 1
229+
}
230+
}

0 commit comments

Comments
 (0)