Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
7950e38
Sync eng/common directory with azure-sdk-tools for PR 7459 (#5237)
azure-sdk Jan 9, 2024
1a6b614
Fix image tag for multiimage deployments (#5238)
azure-sdk Jan 9, 2024
7eeb609
Options Http Enum add to Core (#5246)
gearama Jan 10, 2024
88242f3
Make the CAPath option available on all OSes and change to throw on r…
ahsonkhan Jan 11, 2024
e69559f
Options UT (#5249)
gearama Jan 11, 2024
dece333
Add a remark in CAInfo doc comment mentioning it is Linux only. (#5248)
ahsonkhan Jan 11, 2024
23ecf87
Fixes for CVE-2024-21646 (#5251)
LarryOsterman Jan 11, 2024
08c5187
Sync eng/common directory with azure-sdk-tools for PR 7445 (#5247)
azure-sdk Jan 11, 2024
03de1fb
Core-Core (GA) + Core-AMQP (Beta) + Event Hubs (Beta) January Release…
antkmsft Jan 11, 2024
23af331
Identity January Release (#5242)
antkmsft Jan 11, 2024
2e34380
Increment version for core releases (#5255)
azure-sdk Jan 11, 2024
01e3e05
Increment package version after release of azure-messaging-eventhubs …
azure-sdk Jan 11, 2024
9d3870f
Increment package version after release of azure-identity (#5257)
azure-sdk Jan 11, 2024
20d9364
Storage tables implementation (#5137)
gearama Jan 12, 2024
b021710
Remove 'using namespace' from header files (#5260)
antkmsft Jan 12, 2024
677d54a
Larry's comments (#5261)
gearama Jan 13, 2024
535874a
Sync eng/common directory with azure-sdk-tools for PR 7451 (#5264)
azure-sdk Jan 15, 2024
6b23905
Correct the variable name in spec location validation script (#5265)
azure-sdk Jan 15, 2024
c42e03e
[CODEOWNERS] Remove automation section (#5269)
jsquire Jan 16, 2024
b43d53b
fix export (#5270)
gearama Jan 16, 2024
0f73c39
last quotes (#5271)
gearama Jan 16, 2024
68644be
Key Vault January Releases (#5241)
antkmsft Jan 16, 2024
09b3f81
Tables January Release (#5239)
antkmsft Jan 16, 2024
1d22b9b
Fix broken link (#5273)
antkmsft Jan 16, 2024
2a4292f
Increment package version after release of azure-data-tables (#5274)
azure-sdk Jan 16, 2024
f548d1e
Filter packages at verify step (#5275)
azure-sdk Jan 17, 2024
4383383
Increment version for keyvault releases (#5276)
azure-sdk Jan 17, 2024
a0f4244
Sync eng/common directory with azure-sdk-tools for PR 7512 (#5258)
azure-sdk Jan 17, 2024
84c4812
Re-enable UWP CI pipeline (#5226)
antkmsft Jan 17, 2024
3bff843
Attempt to diagnose WinHTTP CI pipeline errors. (#5259)
LarryOsterman Jan 17, 2024
32e774f
Changelog entry for winhttp bug fix (#5277)
LarryOsterman Jan 17, 2024
84f000c
Sync eng/common directory with azure-sdk-tools for PR 7537 (#5278)
azure-sdk Jan 17, 2024
f109f63
Synchronous AMQP Close (#5281)
LarryOsterman Jan 18, 2024
b1796ab
Add git commit details to stress environment (#5280)
azure-sdk Jan 18, 2024
2bede63
Fix Language value for JS (#5283)
azure-sdk Jan 19, 2024
6c4e0f7
Fix typos in ps1 scripts (#5285)
azure-sdk Jan 19, 2024
4820c4f
use merge instead of cherry-pick in merge-proxy-tags.ps1 (#5286)
azure-sdk Jan 22, 2024
76c82f0
Fixed bug in Eventhubs live tests (#5290)
LarryOsterman Jan 24, 2024
47bf038
Ported uAMQP bug fix to C++ repo (#5291)
LarryOsterman Jan 24, 2024
85f4835
Sync eng/common directory with azure-sdk-tools for PR 7580 (#5292)
azure-sdk Jan 24, 2024
55afd2d
Sync eng/common directory with azure-sdk-tools for PR 7569 (#5289)
azure-sdk Jan 25, 2024
dffa3ed
Sync eng/common directory with azure-sdk-tools for PR 7584 (#5294)
azure-sdk Jan 25, 2024
27aab78
AMQP Session related fixes. (#5299)
LarryOsterman Jan 30, 2024
166e46b
Sync eng/common directory with azure-sdk-tools for PR 7585 (#5302)
azure-sdk Jan 31, 2024
c2f1896
Removed dead script (#5306)
LarryOsterman Jan 31, 2024
070c7e9
Step 1 in adding (more)perf tests for Core and Identity. (#5300)
gearama Feb 1, 2024
9b79205
Azure Core February Releases (#5304)
antkmsft Feb 1, 2024
092d6bc
Fixed nightly CI pipeline build error (#5311)
LarryOsterman Feb 2, 2024
901bd29
Azure Core February Releases (#5312)
antkmsft Feb 2, 2024
46fcbba
Sync eng/common directory with azure-sdk-tools for PR 7615 (#5313)
azure-sdk Feb 2, 2024
02882f9
Fix issue in Verify-Link.ps1 after PS 7.4 update (#5314)
azure-sdk Feb 2, 2024
4f6cc88
Http Transport perf test (#5309)
gearama Feb 2, 2024
1689a00
Pipeline tests (#5310)
gearama Feb 2, 2024
807b6c9
Increment version for core releases (#5316)
azure-sdk Feb 2, 2024
79cc06d
Move the connection back to the connection pool when HTTP error 404 w…
mchelnokov Feb 2, 2024
111ec80
Update Azure Core changelog after #5308 (#5317)
antkmsft Feb 2, 2024
025c067
Retroactively update AMQP's changelog (#5321)
antkmsft Feb 3, 2024
0b01dc6
Fix BOM issue Generate-DocIndex.ps1 (#5318)
azure-sdk Feb 5, 2024
7c751a5
Domain-specific changes to fix docindex (#5319)
danieljurek Feb 6, 2024
dcc15a6
Sync eng/common directory with azure-sdk-tools for PR 7634 (#5323)
azure-sdk Feb 6, 2024
1497f91
Sync eng/common directory with azure-sdk-tools for PR 7630 (#5325)
azure-sdk Feb 6, 2024
44cb7df
Eventhubs February Release (#5305)
LarryOsterman Feb 6, 2024
43f6c1d
Increment package version after release of azure-messaging-eventhubs …
azure-sdk Feb 6, 2024
5a70fca
Workaround for vcpkg-tool regression bug (#5328)
antkmsft Feb 6, 2024
ce4f25d
Upload logs on cmake generate/build failure (#5293)
danieljurek Feb 7, 2024
50cc742
Json test (#5324)
gearama Feb 7, 2024
faea43a
Pin azure/login action step to v1.5.1 (#5333)
azure-sdk Feb 8, 2024
0229d0a
Multithreaded support for Eventhubs management family of APIs (#5315)
LarryOsterman Feb 9, 2024
f348242
Add stress test arm/bicep template prefix to New-TestResources Resour…
azure-sdk Feb 9, 2024
3b231e5
Enable proactive renewal of Managed Identity tokens. (#5336)
ahsonkhan Feb 10, 2024
78a3239
Azure Identity February Release (#5307)
ahsonkhan Feb 10, 2024
ddd0f4b
For new surface area, classes marked as final should not have virtual…
ahsonkhan Feb 10, 2024
3169251
Increment package version after release of azure-identity (#5343)
azure-sdk Feb 12, 2024
0f7d02b
Fix case-sensitive spelling in non-common /eng (#5346)
antkmsft Feb 12, 2024
9271d13
Guard against Windows' min/max macros (#5348)
antkmsft Feb 13, 2024
735da80
Update vcpkg SHA (#5347)
antkmsft Feb 14, 2024
29ac633
Fix case-sensitive spelling in scripts that get deployed to C++ repo …
azure-sdk Feb 14, 2024
213f0a7
Move emitter-package.json scripts to eng/common (#5353)
azure-sdk Feb 14, 2024
1d09c53
Install Docs Updates (#5339)
ronniegeraghty Feb 14, 2024
6297347
Update CodeOwners (#5357)
RickWinter Feb 15, 2024
73bb6c6
Winhttp flaky test (#5356)
gearama Feb 15, 2024
12fb2f8
Update CodeOwners (#5359)
RickWinter Feb 16, 2024
39392a8
Publishing to vcpkg-betas syncs vcpkg baseline to our repo (#5330)
antkmsft Feb 16, 2024
ac023d1
Update GitHubEventProcessorVersion (#5361)
azure-sdk Feb 16, 2024
15dab12
Updates to tools for the CodeownersUtils updates (#5362)
azure-sdk Feb 16, 2024
6519a2c
Fix up codeowner syntax (#5364)
RickWinter Feb 16, 2024
46fe502
Azure Core 1.11.2 Release (#5360)
antkmsft Feb 16, 2024
2a9934a
Core perf tests consolidation (#5363)
gearama Feb 16, 2024
c0c7f88
Increment package version after release of azure-core (#5366)
azure-sdk Feb 17, 2024
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
Prev Previous commit
Next Next commit
Sync eng/common directory with azure-sdk-tools for PR 7569 (#5289)
* Correct the name of JS package folder

* Uncomment the package verification

* Logging more info for troubleshooting

* Get sdkType and directory from the package info

---------

Co-authored-by: Ray Chen <raychen@microsoft.com>
  • Loading branch information
azure-sdk and raych1 authored Jan 25, 2024
commit 55afd2dd4e83a5bc06e53911f8afe7cf66af8372
142 changes: 76 additions & 66 deletions eng/common/scripts/Verify-RestApiSpecLocation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,110 +43,112 @@ param (
. (Join-Path $PSScriptRoot Helpers/PSModule-Helpers.ps1)

# Check if github token is set
if(-not $GitHubPat) {
if (-not $GitHubPat) {
LogError "GitHubPat is not set. Please set the environment variable GH_TOKEN or pass the GitHubPat parameter."
exit 1
}

Write-Host "The spec used to release SDK should be from the main branch of Azure/azure-rest-api-specs repository."
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName, ArtifactLocation:$ArtifactLocation, PackageInfoDirectory:$PackageInfoDirectory."
Install-ModuleIfNotInstalled "powershell-yaml" "0.4.1" | Import-Module

# This function is used to verify the 'require' and 'input-file' settings in autorest.md point to the main branch of Azure/azure-rest-api-specs repository
# input-file may be:
# https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/purview/data-plane/Azure.Analytics.Purview.MetadataPolicies/preview/2021-07-01-preview/purviewMetadataPolicy.json
# or
# https://github.com/Azure/azure-rest-api-specs/blob/0ebd4949e8e1cd9537ca5a07384c7661162cc7a6/specification/purview/data-plane/Azure.Analytics.Purview.Account/preview/2019-11-01-preview/account.json
function Verify-Url([string]$fileUrl) {
if($fileUrl -match "^https://(raw\.githubusercontent\.com|github\.com)/(?<repo>[^/]*/azure-rest-api-specs)(/(blob|tree))?/(?<commit>[^\/]+(\/[^\/]+)*|[0-9a-f]{40})/(?<path>specification/.*)") {
function Verify-Url([string]$fileUrl, [string]$configFilePath) {
if ($fileUrl -match "^https://(raw\.githubusercontent\.com|github\.com)/(?<repo>[^/]*/azure-rest-api-specs)(/(blob|tree))?/(?<commit>[^\/]+(\/[^\/]+)*|[0-9a-f]{40})/(?<path>specification/.*)") {
$repo = $matches['repo']
$commit = $matches['commit']
if($repo -ne "Azure/azure-rest-api-specs") {
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Invalid repo in the file url: $fileUrl. Repo should be 'Azure/azure-rest-api-specs'."
if ($repo -ne "Azure/azure-rest-api-specs") {
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Invalid repo in the file url: $fileUrl. Repo should be 'Azure/azure-rest-api-specs' in the config file:$configFilePath."
exit 1
}
# check the commit hash belongs to main branch
Verify-CommitFromMainBranch $commit
Verify-CommitFromMainBranch $commit $configFilePath
}
else{
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Invalid file url: $fileUrl"
else {
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Invalid file url: $fileUrl in the config file:$configFilePath. The spec location should point to the main branch of Azure/azure-rest-api-specs repository."
exit 1
}
}

# This function is used to verify the 'repo' and 'commit' settings in tsp-location.yaml point to the main branch of Azure/azure-rest-api-specs repository
function Verify-TspLocation([System.Object]$tspLocationObj) {
function Verify-TspLocation([System.Object]$tspLocationObj, [string]$tspLocationYamlPath) {
$repo = $tspLocationObj["repo"]
$commit = $tspLocationObj["commit"]
if($repo -ne "Azure/azure-rest-api-specs") {
LogError "Invalid repo setting in the tsp-location.yaml: $repo. Repo should be 'Azure/azure-rest-api-specs'. ServiceDir:$ServiceDirectory, PackageName:$PackageName"
if ($repo -ne "Azure/azure-rest-api-specs") {
LogError "Invalid repo setting in the tsp-location.yaml: $repo. Repo should be 'Azure/azure-rest-api-specs'. ServiceDir:$ServiceDirectory, PackageName:$PackageName, tsp-location.yaml path:$tspLocationYamlPath."
exit 1
}

# check the commit hash belongs to main branch
Verify-CommitFromMainBranch $commit
Verify-CommitFromMainBranch $commit $tspLocationYamlPath
}

# This function is used to verify the specific 'commit' belongs to the main branch of Azure/azure-rest-api-specs repository
function Verify-CommitFromMainBranch([string]$commit) {
if($commit -notmatch "^[0-9a-f]{40}$" -and $commit -ne "main") {
LogError "Invalid commit hash or branch name: $commit. Branch name should be 'main' or the commit should be a 40-character SHA-1 hash. ServiceDir:$ServiceDirectory, PackageName:$PackageName"
function Verify-CommitFromMainBranch([string]$commit, [string]$configFilePath) {
if ($commit -notmatch "^[0-9a-f]{40}$" -and $commit -ne "main") {
LogError "Invalid commit hash or branch name: $commit. Branch name should be 'main' or the commit should be a 40-character SHA-1 hash. ServiceDir:$ServiceDirectory, PackageName:$PackageName, please check the config file:$configFilePath."
exit 1
}
if($commit -eq "main") {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Branch is $commit branch of Azure/azure-rest-api-specs repository."
if ($commit -eq "main") {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName, Config file:$configFilePath. Branch is $commit branch of Azure/azure-rest-api-specs repository."
return
}
try {
$searchResult = Search-GitHubCommit -AuthToken $GitHubPat -CommitHash $commit -RepoOwner "Azure" -RepoName "azure-rest-api-specs"
if ($searchResult.total_count -lt 1) {
LogError "Commit $commit doesn't exist in 'main' branch of Azure/azure-rest-api-specs repository. ServiceDir:$ServiceDirectory, PackageName:$PackageName"
LogError "Commit $commit doesn't exist in 'main' branch of Azure/azure-rest-api-specs repository. ServiceDir:$ServiceDirectory, PackageName:$PackageName, please check the config file:$configFilePath. The spec used to release SDK should be from the main branch of Azure/azure-rest-api-specs repository."
exit 1
}
else{
else {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Commit $commit exists in 'main' branch of Azure/azure-rest-api-specs repository."
}
}
catch {
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Failed to search commit $commit with exception:`n$_ "
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName, Config file:$configFilePath. The spec used to release SDK should be from the main branch of Azure/azure-rest-api-specs repository. Failed to search commit $commit with exception:`n$_ "
exit 1
}
}

function Verify-YamlContent([string]$markdownContent) {
function Verify-YamlContent([string]$markdownContent, [string]$configFilePath) {
$splitString = '``` yaml|```yaml|```'
$yamlContent = $markdownContent -split $splitString
foreach($yamlSection in $yamlContent) {
foreach ($yamlSection in $yamlContent) {
if ($yamlSection) {
try {
# remove the lines like: $(tag) == 'package-preview-2023-09'
$yamlSection = $yamlSection -replace '^\s*\$\(.+\)\s*==.+', ''
$yamlobj = ConvertFrom-Yaml -Yaml $yamlSection
if($yamlobj) {
if ($yamlobj) {
$batchValue = $yamlobj["batch"]
$requireValue = $yamlobj["require"]
$inputFileValue = $yamlobj["input-file"]
if ($requireValue) {
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName. 'require' is set as:$requireValue"
Verify-Url $requireValue
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName, Config file:$configFilePath. 'require' is set as:$requireValue"
Verify-Url $requireValue $configFilePath
}
elseif ($inputFileValue) {
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName. 'input-file' is set as:$inputFileValue"
foreach($inputFile in $inputFileValue) {
Verify-Url $inputFile
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName, Config file:$configFilePath. 'input-file' is set as:$inputFileValue"
foreach ($inputFile in $inputFileValue) {
Verify-Url $inputFile $configFilePath
}
}
elseif ($batchValue) {
# there are some services which use batch mode for sdk generation, e.g. Azure.AI.Language.QuestionAnswering
foreach($batch in $batchValue) {
foreach ($batch in $batchValue) {
$requireValue = $batch["require"]
$inputFileValue = $batch["input-file"]
if ($requireValue) {
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName. 'require' is set as:$requireValue"
Verify-Url $requireValue
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName, Config file:$configFilePath. 'require' is set as:$requireValue"
Verify-Url $requireValue $configFilePath
}
elseif ($inputFileValue) {
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName. 'input-file' is set as:$inputFileValue"
foreach($inputFile in $inputFileValue) {
Verify-Url $inputFile
LogDebug "ServiceDir:$ServiceDirectory, PackageName:$PackageName, Config file:$configFilePath. 'input-file' is set as:$inputFileValue"
foreach ($inputFile in $inputFileValue) {
Verify-Url $inputFile $configFilePath
}
}
}
Expand All @@ -163,19 +165,16 @@ function Verify-YamlContent([string]$markdownContent) {
function Verify-PackageVersion() {
try {
$packages = @{}
if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn"))
{
if ($FindArtifactForApiReviewFn -and (Test-Path "Function:$FindArtifactForApiReviewFn")) {
$packages = &$FindArtifactForApiReviewFn $ArtifactLocation $PackageName
}
else
{
else {
LogError "The function for 'FindArtifactForApiReviewFn' was not found.`
Make sure it is present in eng/scripts/Language-Settings.ps1 and referenced in eng/common/scripts/common.ps1.`
See https://github.com/Azure/azure-sdk-tools/blob/main/doc/common/common_engsys.md#code-structure"
exit 1
}
if (-not $PackageInfoDirectory)
{
if (-not $PackageInfoDirectory) {
$PackageInfoDirectory = Join-Path -Path $ArtifactLocation "PackageInfo"
if (-not (Test-Path -Path $PackageInfoDirectory)) {
# Call Save-Package-Properties.ps1 script to generate package info json files
Expand All @@ -185,23 +184,19 @@ function Verify-PackageVersion() {
}

$continueValidation = $false
if ($packages)
{
foreach($pkgPath in $packages.Values)
{
if ($packages) {
foreach ($pkgPath in $packages.Values) {
$pkgPropPath = Join-Path -Path $PackageInfoDirectory "$PackageName.json"
if (-Not (Test-Path $pkgPropPath))
{
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Package property file path $($pkgPropPath) is invalid."
continue
if (-Not (Test-Path $pkgPropPath)) {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Package property file path $($pkgPropPath) is invalid."
continue
}
# Get package info from json file
$pkgInfo = Get-Content $pkgPropPath | ConvertFrom-Json
$version = [AzureEngSemanticVersion]::ParseVersionString($pkgInfo.Version)
if ($null -eq $version)
{
LogError "ServiceDir:$ServiceDirectory, Version info is not available for package $PackageName, because version '$(pkgInfo.Version)' is invalid. Please check if the version follows Azure SDK package versioning guidelines."
exit 1
if ($null -eq $version) {
LogError "ServiceDir:$ServiceDirectory, Version info is not available for package $PackageName, because version '$(pkgInfo.Version)' is invalid. Please check if the version follows Azure SDK package versioning guidelines."
exit 1
}

Write-Host "Version: $($version)"
Expand All @@ -216,23 +211,36 @@ function Verify-PackageVersion() {
$continueValidation = $true
}
}
if($continueValidation -eq $false) {
if ($continueValidation -eq $false) {
Write-Host "ServiceDir:$ServiceDirectory, no package info is found for package $PackageName, the validation of spec location is ignored."
exit 0
}
# Return the package info
return $pkgInfo
}
catch {
LogError "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Failed to retrieve package and validate package version with exception:`n$_ "
exit 1
}
}

try{
try {
# Verify package version is not a prerelease version, only continue the validation if the package is GA version
Verify-PackageVersion
$packageInfo = Verify-PackageVersion
if (-not $packageInfo) {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. The package info is not available."
exit 0
}
# Get the package directory path
$PackageDirectory = $null
if ($packageInfo.DirectoryPath) {
$PackageDirectory = Join-Path $RepoRoot $packageInfo.DirectoryPath
}

$ServiceDir = Join-Path $RepoRoot 'sdk' $ServiceDirectory
$PackageDirectory = Join-Path $ServiceDir $PackageName
if ((-not $PackageDirectory) -or (-not (Test-Path $PackageDirectory))) {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName, PackageDirectory:$PackageDirectory. The package directory path is invalid."
exit 0
}
Push-Location $PackageDirectory

# Load tsp-location.yaml if existed
Expand All @@ -243,39 +251,41 @@ try{
if (Test-Path -Path $tspLocationYamlPath) {
# typespec scenario
$tspLocationYaml = Get-Content -Path $tspLocationYamlPath -Raw | ConvertFrom-Yaml
Verify-TspLocation $tspLocationYaml
Verify-TspLocation $tspLocationYaml $tspLocationYamlPath
}
elseif ($Language -eq "dotnet") {
# only dotnet language sdk uses 'autorest.md' to configure the sdk generation
if (Test-Path -Path $autorestMdPath) {
try {
$autorestMdContent = Get-Content -Path $autorestMdPath -Raw
Verify-YamlContent $autorestMdContent
Verify-YamlContent $autorestMdContent $autorestMdPath
}
catch {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Failed to parse autorest.md file with exception:`n$_ "
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Failed to parse autorest.md file:$autorestMdPath with exception:`n$_ "
}
}
}
elseif ($Language -eq "java" -or $Language -eq "javascript" -or $Language -eq "python" -or $Language -eq "go") {
# for these languages we ignore the validation because they always use the latest spec from main branch to release SDK
# mgmt plane packages: azure-core-management|azure-resourcemanager|azure-resourcemanager-advisor (java), azure-mgmt-devcenter (python), arm-advisor (js), armaad (go)
if($PackageName -match "^(arm|azure-mgmt|azure-resourcemanager|azure-core-management)[-a-z]*$") {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Ignore the validation for $Language management plane package."
# for these languages we ignore the validation for mgmt plane SDK because they always use the latest spec from main branch to release SDK
if ($packageInfo.SdkType -eq "mgmt") {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Ignore the validation for $Language management plane SDK release."
exit 0
}
# for these languages they use 'swagger/readme.md' to configure the sdk generation for data plane scenarios
if (Test-Path -Path $swaggerReadmePath) {
try {
$swaggerReadmeContent = Get-Content -Path $swaggerReadmePath -Raw
Verify-YamlContent $swaggerReadmeContent
Verify-YamlContent $swaggerReadmeContent $swaggerReadmePath
}
catch {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Failed to parse swagger/readme.md file with exception:`n$_ "
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName. Failed to parse swagger/readme.md file:$swaggerReadmePath with exception:`n$_ "
}
}
}
}
catch {
Write-Host "ServiceDir:$ServiceDirectory, PackageName:$PackageName, PackageDirectory:$PackageDirectory. Failed to validate spec location with exception:`n$_ "
}
finally {
Pop-Location
}