Skip to content

Commit e1f08b2

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into regenerate_keys
* 'master' of https://github.com/Azure/azure-sdk-for-python: (24 commits) rename FormField.type -> FormField.value_type (Azure#12708) 20200703 codereport (Azure#12361) Use the common Cosmos emulator template. (Azure#12678) Add azurestackhci ci.yml for pipeline generation. (Azure#12701) [ServiceBus] Resend received message (Azure#12457) AZURE_CLIENT_ID sets user-assigned managed identity for DefaultAzureCredential (Azure#12689) Add better autolockrenew on-failure handling capabilities. (Azure#12307) Update CODEOWNERS (Azure#12418) close client session in async tests (Azure#12656) Sync eng/common directory with azure-sdk-tools repository (Azure#12502) [Event Hubs] Use EventHubManagementClient to create test resources (Azure#12501) Increment package version after release of azure_identity (Azure#12675) [formrecognizer] include error code for errors that occur during polling (Azure#12621) Cross-language consistency changes (Azure#12669) Enable APIStubGen step (Azure#12615) Adding the ability to create a container with analytical storage turned on. (Azure#12408) [ServiceBus] Adjust user-agent following the guideline (Azure#12596) Release for Cognitive Services - Anomaly Detector (Azure#12582) [formrecognizer] Add type to FormField (Azure#12561) Add example summary for azure-identity readme.md (Azure#12509) ...
2 parents 5fd90da + 089151c commit e1f08b2

File tree

180 files changed

+5637
-2549
lines changed

Some content is hidden

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

180 files changed

+5637
-2549
lines changed

.github/CODEOWNERS

+51-4
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,83 @@
99
/sdk/ @mayurid @lmazuel
1010

1111
# Core
12+
# PRLabel: %Azure.Core
1213
/sdk/core/ @lmazuel @xiangyan99 @johanste @rakshith91
1314
/sdk/core/azure-core/ @xiangyan99 @lmazuel
1415

16+
####
1517
# Service team
18+
####
19+
# PRLabel: %Azure.Identity
1620
/sdk/identity/ @chlowell @schaabs
21+
22+
# PRLabel: %Event Hubs
1723
/sdk/eventhub/ @annatisch @yunhaoling @YijunXieMS
18-
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft
19-
/sdk/applicationinsights/ @alexeldeib
24+
25+
# PRLabel: %Storage
26+
/sdk/storage/ @amishra-dev @zezha-msft @annatisch @rakshith91 @xiafu-msft
27+
28+
/sdk/applicationinsights/ @alexeldeib
29+
30+
# PRLabel: %Batch
2031
/sdk/batch/ @bgklein @xingwu1
21-
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
32+
/sdk/cognitiveservices/azure-cognitiveservices-vision-customvision/ @areddish
33+
34+
# PRLabel: %KeyVault
2235
/sdk/keyvault/ @schaabs @chlowell @iscai-msft
36+
37+
# PRLabel: %Monitor - LogAnalytics
2338
/sdk/loganalytics/ @alexeldeib
39+
40+
# PRLabel: %Consumption
2441
/sdk/consumption/ @sandeepnl
42+
43+
# PRLabel: %Container Instances
2544
/sdk/containerinstance/ @samkreter @xizhamsft
45+
46+
# PRLabel: %Container Registry
2647
/sdk/containerregistry/ @djyou
2748
/sdk/containerservice/ @samkreter @zqingqing1 @GaneshaThirumurthi
49+
50+
# PRLabel: %Cosmos
2851
/sdk/cosmos/ @southpolesteve @zfoster
52+
53+
# PRLabel: %Data Factory
2954
/sdk/datafactory/ @hvermis
30-
/sdk/datalake/ @ro-joowan
55+
/sdk/datalake/ @ro-joowan
3156
/sdk/datadatamigration/ @vchske
57+
58+
# PRLabel: %Event Grid
3259
/sdk/eventgrid/ @kalyanaj
60+
61+
# PRLabel: %HDInsight
3362
/sdk/hdinsight/ @idear1203
63+
64+
# PRLabel: %Machine Learning Compute
3465
/sdk/machinelearningcompute/ @shutchings
66+
67+
# PRLabel: %Recovery Services
3568
/sdk/recoveryservices/ @DheerendraRathor
69+
70+
# PRLabel: %Search
3671
/sdk/search/ @xiangyan99 @rakshith91
72+
73+
# PRLabel: %Service Fabric
3774
/sdk/servicefabric/ @QingChenmsft @samedder
75+
76+
# PRLabel: %SQL
3877
/sql/sql/ @jaredmoo
78+
79+
# PRLabel: %Service Bus
3980
/sdk/servicebus/ @annatisch @yunhaoling @YijunXieMS @KieranBrantnerMagee
81+
82+
# PRLabel: %Synapse
4083
/sdk/synapse/ @aim-for-better @idear1203
84+
85+
# PRLabel: %Cognitive - Text Analytics
4186
/sdk/textanalytics/ @kristapratico @iscai-msft
87+
88+
# PRLabel: %Cognitive - Form Recognizer
4289
/sdk/formrecognizer/ @kristapratico @iscai-msft @rakshith91
4390

4491
# Smoke Tests

eng/common/TestResources/deploy-test-resources.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parameters:
1313
# "TestApplicationId": "<test app id>",
1414
# "TestApplicationSecret": "<test app secret>",
1515
# "ProvisionerApplicationId": "<provisoner app id>",
16-
# "ProvisoinerApplicationSecret": "<provisoner app secert>",
16+
# "ProvisionerApplicationSecret": "<provisoner app secert>",
1717
# "Environment": "AzureCloud | AzureGov | AzureChina | <other environment>"
1818
# }
1919

eng/common/TestResources/remove-test-resources.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ steps:
3232
-Force `
3333
-Verbose
3434
displayName: Remove test resources
35-
condition: and(ne(variables['AZURE_RESOURCEGROUP_NAME'], ''), succeededOrFailed())
35+
condition: ne(variables['AZURE_RESOURCEGROUP_NAME'], '')
3636
continueOnError: true

eng/common/pipelines/templates/steps/create-pull-request.yml

+17
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ parameters:
1212
WorkingDirectory: $(System.DefaultWorkingDirectory)
1313
PRTitle: not-specified
1414
ScriptDirectory: eng/common/scripts
15+
GHReviewersVariable: ''
16+
GHTeamReviewersVariable: ''
1517

1618
steps:
1719

@@ -63,3 +65,18 @@ steps:
6365
-PRBranch "${{ parameters.PRBranchName }}"
6466
-AuthToken "$(azuresdk-github-pat)"
6567
-PRTitle "${{ parameters.PRTitle }}"
68+
69+
- task: PowerShell@2
70+
displayName: Tag a Reviewer on PR
71+
condition: and(succeeded(), eq(variables['HasChanges'], 'true'))
72+
inputs:
73+
pwsh: true
74+
workingDirectory: ${{ parameters.WorkingDirectory }}
75+
filePath: ${{ parameters.ScriptDirectory }}/add-pullrequest-reviewers.ps1
76+
arguments: >
77+
-RepoOwner "${{ parameters.RepoOwner }}"
78+
-RepoName "${{ parameters.RepoName }}"
79+
-AuthToken "$(azuresdk-github-pat)"
80+
-GitHubUsers "$(${{ parameters.GHReviewersVariable }})"
81+
-GitHubTeams "$(${{ parameters.GHTeamReviewersVariable }})"
82+
-PRNumber "$(Submitted.PullRequest.Number)"

eng/common/pipelines/templates/steps/docs-metadata-release.yml

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ parameters:
1212
ArtifactName: ''
1313
Language: ''
1414
DocRepoDestinationPath: '' #usually docs-ref-services/
15+
GHReviewersVariable: ''
16+
GHTeamReviewersVariable: '' # externally set, as eng-common does not have the identity-resolver. Run as pre-step
1517

1618
steps:
1719
- pwsh: |
@@ -56,3 +58,5 @@ steps:
5658
BaseBranchName: smoke-test
5759
WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
5860
ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}
61+
GHReviewersVariable: ${{ parameters.GHReviewersVariable }}
62+
GHTeamReviewersVariable: ${{ parameters.GHTeamReviewersVariable }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
parameters:
2+
TargetVariable: ''
3+
ServiceDirectory: ''
4+
5+
steps:
6+
- pwsh: |
7+
git clone https://github.com/Azure/azure-sdk-tools.git $(Build.SourcesDirectory)/tools_repo
8+
cd $(Build.SourcesDirectory)/tools_repo
9+
git checkout 564ad63ae72d18422533fa1da9d396e7703c1cb5
10+
displayName: Setup Identity Resolver
11+
12+
- pwsh: |
13+
$result = dotnet run -v q -- `
14+
--aad-app-id-var APP_ID `
15+
--aad-app-secret-var APP_SECRET `
16+
--aad-tenant-var AAD_TENANT `
17+
--kusto-url-var KUSTO_URL `
18+
--kusto-database-var KUSTO_DB `
19+
--kusto-table-var KUSTO_TABLE `
20+
--identity "$(Build.QueuedBy)"
21+
$resolvedIdentity = $result[-1] | ConvertFrom-Json
22+
23+
Write-Host $resolvedIdentity
24+
25+
Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$($resolvedIdentity.GithubUserName)"
26+
displayName: 'Resolving Queuing User'
27+
workingDirectory: $(Build.SourcesDirectory)/tools_repo/tools/notification-configuration/identity-resolver
28+
env:
29+
APP_ID: $(notification-aad-app-id)
30+
APP_SECRET: $(notification-aad-secret)
31+
AAD_TENANT: $(notification-aad-tenant)
32+
KUSTO_URL: $(notification-kusto-url)
33+
KUSTO_DB: $(notification-kusto-db)
34+
KUSTO_TABLE: $(notification-kusto-table)
35+
36+
- pwsh: |
37+
Remove-Item -Force -Recurse $(Build.SourcesDirectory)/tools_repo
38+
displayName: Clean Up Cloned Tools Repo
39+
40+
- pwsh: |
41+
$originalValue = "$(${{ parameters.TargetVariable }})"
42+
$result = $(Build.SourcesDirectory)/eng/common/scripts/get-codeowners.ps1 -TargetDirectory /sdk/${{ parameters.ServiceDirectory }}/ -RootDirectory $(Build.SourcesDirectory)
43+
if ($result) {
44+
Write-Output "##vso[task.setvariable variable=${{ parameters.TargetVariable }}]$originalValue,$result"
45+
}
46+
displayName: Add CodeOwners if Present

eng/common/scripts/Submit-PullRequest.ps1

+6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ $resp | Write-Verbose
5858

5959
if ($resp.Count -gt 0) {
6060
Write-Host -f green "Pull request already exists $($resp[0].html_url)"
61+
62+
# setting variable to reference the pull request by number
63+
Write-Host "##vso[task.setvariable variable=Submitted.PullRequest.Number]$($resp[0].number)"
6164
}
6265
else {
6366
$data = @{
@@ -80,4 +83,7 @@ else {
8083

8184
$resp | Write-Verbose
8285
Write-Host -f green "Pull request created https://github.com/$RepoOwner/$RepoName/pull/$($resp.number)"
86+
87+
# setting variable to reference the pull request by number
88+
Write-Host "##vso[task.setvariable variable=Submitted.PullRequest.Number]$($resp.number)"
8389
}

eng/common/scripts/Verify-Links.ps1

+12-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,18 @@ function CheckLink ([System.Uri]$linkUri)
125125
}
126126
else {
127127
try {
128-
$response = Invoke-WebRequest -Uri $linkUri
128+
$headRequestSucceeded = $true
129+
try {
130+
# Attempt HEAD request first
131+
$response = Invoke-WebRequest -Uri $linkUri -Method HEAD
132+
}
133+
catch {
134+
$headRequestSucceeded = $false
135+
}
136+
if (!$headRequestSucceeded) {
137+
# Attempt a GET request if the HEAD request failed.
138+
$response = Invoke-WebRequest -Uri $linkUri -Method GET
139+
}
129140
$statusCode = $response.StatusCode
130141
if ($statusCode -ne 200) {
131142
Write-Host "[$statusCode] while requesting $linkUri"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
param(
2+
[Parameter(Mandatory = $true)]
3+
$RepoOwner,
4+
5+
[Parameter(Mandatory = $true)]
6+
$RepoName,
7+
8+
[Parameter(Mandatory = $false)]
9+
$GitHubUsers = "",
10+
11+
[Parameter(Mandatory = $false)]
12+
$GitHubTeams = "",
13+
14+
[Parameter(Mandatory = $true)]
15+
$PRNumber,
16+
17+
[Parameter(Mandatory = $true)]
18+
$AuthToken
19+
)
20+
21+
# at least one of these needs to be populated
22+
if (-not $GitHubUsers -and -not $GitHubTeams) {
23+
Write-Host "No user provided for addition, exiting."
24+
exit 0
25+
}
26+
27+
$userAdditions = @($GitHubUsers.Split(",") | % { $_.Trim() } | ? { return $_ })
28+
$teamAdditions = @($GitHubTeams.Split(",") | % { $_.Trim() } | ? { return $_ })
29+
30+
$headers = @{
31+
Authorization = "bearer $AuthToken"
32+
}
33+
$uri = "https://api.github.com/repos/$RepoOwner/$RepoName/pulls/$PRNumber/requested_reviewers"
34+
35+
try {
36+
$resp = Invoke-RestMethod -Headers $headers $uri -MaximumRetryCount 3
37+
}
38+
catch {
39+
Write-Error "Invoke-RestMethod [$uri] failed with exception:`n$_"
40+
exit 1
41+
}
42+
43+
# the response object takes this form: https://developer.github.com/v3/pulls/review_requests/#response-1
44+
# before we can push a new reviewer, we need to pull the simple Ids out of the complex objects that came back in the response
45+
$userReviewers = @($resp.users | % { return $_.login })
46+
$teamReviewers = @($resp.teams | % { return $_.slug })
47+
48+
if (!$usersReviewers) { $modifiedUserReviewers = @() } else { $modifiedUserReviewers = $usersReviewers.Clone() }
49+
$modifiedUserReviewers += ($modifiedUserReviewers | ? { !$usersReviews.Contains($_) })
50+
51+
if ($teamReviewers) { $modifiedTeamReviewers = @() } else { $modifiedTeamReviewers = $teamReviewers.Clone() }
52+
$modifiedTeamReviewers += ($modifiedUserReviewers | ? { !$teamReviewers.Contains($_) })
53+
54+
$detectedUserDiffs = Compare-Object -ReferenceObject $userReviewers -DifferenceObject $modifiedUserReviewers
55+
$detectedTeamDiffs = Compare-Object -ReferenceObject $teamReviewers -DifferenceObject $modifiedTeamReviewers
56+
57+
# Compare-Object returns values when there is a difference between the comparied objects.
58+
# we only want to run the update if there IS a difference.
59+
if ($detectedUserDiffs -or $detectedTeamDiffs) {
60+
$postResp = @{}
61+
62+
if ($modifiedUserReviewers) { $postResp["reviewers"] = $modifiedUserReviewers }
63+
if ($modifiedTeamReviewers) { $postResp["team_reviewers"] = $modifiedTeamReviewers }
64+
65+
$postResp = $postResp | ConvertTo-Json
66+
67+
try {
68+
$resp = Invoke-RestMethod -Method Post -Headers $headers -Body $postResp -Uri $uri -MaximumRetryCount 3
69+
$resp | Write-Verbose
70+
}
71+
catch {
72+
Write-Error "Unable to update PR reviewers. `n$_"
73+
}
74+
}
75+
else {
76+
$results = $GitHubUsers + $GitHubTeams
77+
Write-Host "Reviewers $results already added. Exiting."
78+
exit(0)
79+
}

eng/common/scripts/artifact-metadata-parsing.ps1

+39-2
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,38 @@ function ParseCArtifact($pkg, $workingDirectory) {
347347
}
348348
}
349349

350+
function ParseCppArtifact($pkg, $workingDirectory) {
351+
$packageInfo = Get-Content -Raw -Path $pkg | ConvertFrom-JSON
352+
$packageArtifactLocation = (Get-ItemProperty $pkg).Directory.FullName
353+
$releaseNotes = ""
354+
$readmeContent = ""
355+
356+
$pkgVersion = $packageInfo.version
357+
$pkgName = $packageInfo.name
358+
359+
$changeLogLoc = @(Get-ChildItem -Path $packageArtifactLocation -Recurse -Include "CHANGELOG.md")[0]
360+
if ($changeLogLoc)
361+
{
362+
$releaseNotes = Get-ChangeLogEntryAsString -ChangeLogLocation $changeLogLoc -VersionString $pkgVersion
363+
}
364+
365+
$readmeContentLoc = @(Get-ChildItem -Path $packageArtifactLocation -Recurse -Include "README.md")[0]
366+
if ($readmeContentLoc) {
367+
$readmeContent = Get-Content -Raw $readmeContentLoc
368+
}
369+
370+
return New-Object PSObject -Property @{
371+
PackageId = $pkgName
372+
PackageVersion = $pkgVersion
373+
# Artifact info is always considered deployable for now becasue it is not
374+
# deployed anywhere. Dealing with duplicate tags happens downstream in
375+
# CheckArtifactShaAgainstTagsList
376+
Deployable = $true
377+
ReleaseNotes = $releaseNotes
378+
}
379+
}
380+
381+
350382
# Returns the pypi publish status of a package id and version.
351383
function IsPythonPackageVersionPublished($pkgId, $pkgVersion) {
352384
try {
@@ -374,9 +406,10 @@ function IsPythonPackageVersionPublished($pkgId, $pkgVersion) {
374406
# Retrieves the list of all tags that exist on the target repository
375407
function GetExistingTags($apiUrl) {
376408
try {
377-
return (Invoke-WebRequest-WithHandling -Method "GET" -url "$apiUrl/git/refs/tags" ) | % { $_.ref.Replace("refs/tags/", "") }
409+
return (Invoke-WebRequest -Method "GET" -Uri "$apiUrl/git/refs/tags" -MaximumRetryCount 3 -RetryIntervalSec 10) | % { $_.ref.Replace("refs/tags/", "") }
378410
}
379411
catch {
412+
Write-Host $_
380413
$statusCode = $_.Exception.Response.StatusCode.value__
381414
$statusDescription = $_.Exception.Response.StatusDescription
382415

@@ -386,7 +419,7 @@ function GetExistingTags($apiUrl) {
386419

387420
# Return an empty list if there are no tags in the repo
388421
if ($statusCode -eq 404) {
389-
return @()
422+
return ,@()
390423
}
391424

392425
exit(1)
@@ -424,6 +457,10 @@ function VerifyPackages($pkgRepository, $artifactLocation, $workingDirectory, $a
424457
$ParsePkgInfoFn = "ParseCArtifact"
425458
$packagePattern = "*.json"
426459
}
460+
"CPP" {
461+
$ParsePkgInfoFn = "ParseCppArtifact"
462+
$packagePattern = "*.json"
463+
}
427464
default {
428465
Write-Host "Unrecognized Language: $language"
429466
exit(1)

eng/common/scripts/copy-docs-to-blobstorage.ps1

+6
Original file line numberDiff line numberDiff line change
@@ -350,4 +350,10 @@ if ($Language -eq "c")
350350
# used to publish multiple docs packages in a single invocation.
351351
$pkgInfo = Get-Content $DocLocation/package-info.json | ConvertFrom-Json
352352
Upload-Blobs -DocDir $DocLocation -PkgName 'docs' -DocVersion $pkgInfo.version
353+
}
354+
355+
if ($Language -eq "cpp")
356+
{
357+
$packageInfo = (Get-Content (Join-Path $DocLocation 'package-info.json') | ConvertFrom-Json)
358+
Upload-Blobs -DocDir $DocLocation -PkgName $packageInfo.name -DocVersion $packageInfo.version
353359
}

0 commit comments

Comments
 (0)