Skip to content

Commit 527dc58

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into analyze_redesign
* 'master' of https://github.com/Azure/azure-sdk-for-python: (35 commits) Sync eng/common directory with azure-sdk-tools for PR 1353 (Azure#16465) Normalize the package name for Doc.Ms readme (Azure#16401) fix changelog and version (Azure#16445) we should always run integration to publish from our artifacts. if the build pipeline crashed too early in the pipeline, this will fail regardless, due to inability to pull the artifacts down (Azure#15058) Fix DateTime bug (Azure#16456) Resolve Regression Failures (Azure#16455) [text analytics] Expose 'string_index_type' parameter in all service client methods where applicable (Azure#16412) adding devtools to the appconfig dev_reqs to solve python core issue (Azure#16381) Copy job matrix functionality (Azure#16450) Add APIView KV variable group to prepare pipelines bot (Azure#16451) [Datalake] Added support for PurePosixPath (Azure#16400) Regenerate baseline because last one break. (Azure#16415) adding step to test for crlf line endings (Azure#16398) [Datalake] Removed list_paths manual paging and deserialization (Azure#16309) Sync eng/common directory with azure-sdk-tools for PR 1351 (Azure#16448) Update auto_codegen.py (Azure#16443) First release purview (Azure#16440) 1ES pools update for release pipeline. (Azure#16419) Add Cloud environment for Teams user (Azure#16359) Sync eng/common directory with azure-sdk-tools for PR 1345 (Azure#16404) ...
2 parents 3885590 + e1cce3e commit 527dc58

File tree

539 files changed

+202184
-26419
lines changed

Some content is hidden

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

539 files changed

+202184
-26419
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ build/
3333

3434
# Test results
3535
TestResults/
36+
ENV_DIR/
3637

3738
# tox generated artifacts
3839
test-junit-*.xml

build_package.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import argparse
1010
import os
1111
import glob
12+
import sys
1213
from subprocess import check_call
1314

1415

@@ -19,8 +20,8 @@ def create_package(name, dest_folder=DEFAULT_DEST_FOLDER):
1920
absdirs = [os.path.dirname(package) for package in (glob.glob('{}/setup.py'.format(name)) + glob.glob('sdk/*/{}/setup.py'.format(name)))]
2021

2122
absdirpath = os.path.abspath(absdirs[0])
22-
check_call(['python', 'setup.py', 'bdist_wheel', '-d', dest_folder], cwd=absdirpath)
23-
check_call(['python', 'setup.py', "sdist", "--format", "zip", '-d', dest_folder], cwd=absdirpath)
23+
check_call([sys.executable, 'setup.py', 'bdist_wheel', '-d', dest_folder], cwd=absdirpath)
24+
check_call([sys.executable, 'setup.py', "sdist", "--format", "zip", '-d', dest_folder], cwd=absdirpath)
2425

2526

2627
if __name__ == '__main__':

ci_template.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# DO NOT EDIT THIS FILE
2+
# This file is generated automatically and any changes will be lost.
3+
4+
trigger:
5+
branches:
6+
include:
7+
- master
8+
- hotfix/*
9+
- release/*
10+
- restapi*
11+
paths:
12+
include:
13+
- sdk/MyService/
14+
15+
pr:
16+
branches:
17+
include:
18+
- master
19+
- feature/*
20+
- hotfix/*
21+
- release/*
22+
- restapi*
23+
paths:
24+
include:
25+
- sdk/MyService/
26+
27+
extends:
28+
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
29+
parameters:
30+
ServiceDirectory: MyService
31+
Artifacts:
32+
- name: azure_mgmt_MyService
33+
safeName: azuremgmtMyService

eng/common/TestResources/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Connect-AzAccount -Subscription 'YOUR SUBSCRIPTION ID'
3030
eng\common\TestResources\New-TestResources.ps1 -ServiceDirectory 'search'
3131
```
3232

33-
The `OutFile` switch would be set if you are running this for a .NET project on Windows. This will save test environment settings
33+
The `OutFile` switch will be set by default if you are running this for a .NET project on Windows. This will save test environment settings
3434
into a test-resources.json.env file next to test-resources.json. The file is protected via DPAPI.
3535
The environment file would be scoped to the current repository directory and avoids the need to
3636
set environment variables or restart your IDE to recognize them.
@@ -89,6 +89,12 @@ Remove-AzADServicePrincipal -ApplicationId $sp.ApplicationId -Force
8989

9090
If you persisted environment variables, you should also remove those as well.
9191

92+
Some test-resources.json templates utilize the `AdditionalParameters` parameter to control additional resource configuration options. For example:
93+
94+
```powershell
95+
New-TestResources.ps1 keyvault -AdditionalParameters @{enableHsm = $true}
96+
```
97+
9298
## In CI
9399

94100
Test pipelines should include deploy-test-resources.yml and

eng/common/pipelines/templates/steps/daily-dev-build-variable.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
# This script fragment is used across our repos to set a variable "SetDevVersion" which
22
# is used when this pipeline is going to be generating and publishing daily dev builds.
3-
3+
parameters:
4+
ServiceDirectory: ''
45
steps:
6+
- ${{if ne(parameters.ServiceDirectory, '')}}:
7+
- task: Powershell@2
8+
inputs:
9+
filePath: $(Build.SourcesDirectory)/eng/common/scripts/Save-Package-Properties.ps1
10+
arguments: >
11+
-ServiceDirectory ${{parameters.ServiceDirectory}}
12+
-OutDirectory $(Build.ArtifactStagingDirectory)/PackageInfo
13+
pwsh: true
14+
workingDirectory: $(Pipeline.Workspace)
15+
displayName: Dump Package properties
16+
condition: succeeded()
517
- pwsh: |
618
$setDailyDevBuild = "false"
719
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {

eng/common/scripts/Create-APIReview.ps1

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function Submit-APIReview($packagename, $filePath, $uri, $apiKey, $apiLabel)
4040
try
4141
{
4242
$Response = Invoke-WebRequest -Method 'POST' -Uri $uri -Body $multipartContent -Headers $headers
43+
Write-Host "API Review: $($Response)"
4344
$StatusCode = $Response.StatusCode
4445
}
4546
catch
@@ -81,23 +82,47 @@ else
8182
}
8283

8384
$FoundFailure = $False
85+
$pkgInfoPath = Join-Path -Path $ArtifactPath "PackageInfo"
8486
foreach ($pkgName in $responses.Keys)
8587
{
8688
$respCode = $responses[$pkgName]
8789
if ($respCode -ne '200')
8890
{
89-
$FoundFailure = $True
90-
if ($respCode -eq '201')
91+
$pkgPropPath = Join-Path -Path $pkgInfoPath ($PackageName + ".json")
92+
if (-Not (Test-Path $pkgPropPath))
9193
{
92-
Write-Host "API Review is pending for package $pkgName"
94+
Write-Host " Package property file path $($pkgPropPath) is invalid."
95+
$FoundFailure = $True
9396
}
9497
else
9598
{
96-
Write-Host "Failed to create API Review for package $pkgName"
99+
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
100+
$version = [AzureEngSemanticVersion]::ParseVersionString($pkgInfo.Version)
101+
if ($version.IsPrerelease)
102+
{
103+
Write-Host "Package version is not GA. Ignoring API view approval status"
104+
}
105+
elseif ($pkgInfo.SdkType -eq "client" -and $pkgInfo.IsNewSdk)
106+
{
107+
$FoundFailure = $True
108+
if ($respCode -eq '201')
109+
{
110+
Write-Error "Automatic API Review approval is pending for package $($PackageName)"
111+
}
112+
else
113+
{
114+
Write-Error "Failed to create API Review for package $($PackageName)"
115+
}
116+
}
117+
else
118+
{
119+
Write-Host "API review is not approved for package $($PackageName). Management and track1 package can be released without API review approval."
120+
}
97121
}
98122
}
99123
}
100124
if ($FoundFailure)
101125
{
102-
Write-Host "Atleast one API review is not yet approved"
126+
Write-Error "Automatic API review is not yet approved for package $($PackageName)"
127+
exit 1
103128
}

eng/common/scripts/Package-Properties.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class PackageProps
1010
[string]$ReadMePath
1111
[string]$ChangeLogPath
1212
[string]$Group
13+
[string]$SdkType
14+
[boolean]$IsNewSdk
1315

1416
PackageProps([string]$name, [string]$version, [string]$directoryPath, [string]$serviceDirectory)
1517
{

eng/common/scripts/Prepare-Release.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if (!$ReleaseDate)
5555
}
5656
else
5757
{
58-
$ParsedReleaseDate = ([datetime]$ReleaseDate, 'MM/dd/yyyy', [Globalization.CultureInfo]::InvariantCulture)
58+
$ParsedReleaseDate = [datetime]$ReleaseDate
5959
}
6060

6161
$releaseDateString = $ParsedReleaseDate.ToString("MM/dd/yyyy")
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[CmdletBinding()]
2+
Param (
3+
[Parameter(Mandatory=$True)]
4+
[string] $serviceDirectory,
5+
[Parameter(Mandatory=$True)]
6+
[string] $outDirectory
7+
)
8+
9+
. (Join-Path $PSScriptRoot common.ps1)
10+
$allPackageProperties = Get-AllPkgProperties $serviceDirectory
11+
if ($allPackageProperties)
12+
{
13+
New-Item -ItemType Directory -Force -Path $outDirectory
14+
foreach($pkg in $allPackageProperties)
15+
{
16+
if ($pkg.IsNewSDK)
17+
{
18+
Write-Host "Package Name: $($pkg.Name)"
19+
Write-Host "Package Version: $($pkg.Version)"
20+
Write-Host "Package SDK Type: $($pkg.SdkType)"
21+
$outputPath = Join-Path -Path $outDirectory ($pkg.Name + ".json")
22+
$outputObject = $pkg | ConvertTo-Json
23+
Set-Content -Path $outputPath -Value $outputObject
24+
}
25+
}
26+
27+
Get-ChildItem -Path $outDirectory
28+
}
29+
else
30+
{
31+
Write-Error "Package properties are not available for service directory $($serviceDirectory)"
32+
exit 1
33+
}
34+

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,18 @@ function VerifyPackages($artifactLocation, $workingDirectory, $apiUrl, $releaseS
123123
Write-Host "Maybe a pkg version wasn't updated properly?"
124124
exit(1)
125125
}
126-
126+
$docsReadMeName = $parsedPackage.PackageId
127+
if ($parsedPackage.DocsReadMeName) {
128+
$docsReadMeName = $parsedPackage.DocsReadMeName
129+
}
127130
$pkgList += New-Object PSObject -Property @{
128131
PackageId = $parsedPackage.PackageId
129132
PackageVersion = $parsedPackage.PackageVersion
130133
GroupId = $parsedPackage.GroupId
131134
Tag = $parsedPackage.ReleaseTag
132135
ReleaseNotes = $parsedPackage.ReleaseNotes
133136
ReadmeContent = $parsedPackage.ReadmeContent
137+
DocsReadMeName = $docsReadMeName
134138
IsPrerelease = [AzureEngSemanticVersion]::ParseVersionString($parsedPackage.PackageVersion).IsPrerelease
135139
}
136140
}

0 commit comments

Comments
 (0)