Skip to content

Commit cd22b6e

Browse files
azure-sdkscbedd
andauthored
Sync eng/common directory with azure-sdk-tools for PR 9381 (Azure#38598)
* change our verifyChangelogs over to utilizing the artifact details. if we don't have an artifact details at all, don't verify changelog. if we do, but skipverifychangelog is present, don't verify changelog. if we have artifact details, but no disable, verify the changelog --------- Co-authored-by: Scott Beddall <[email protected]>
1 parent 0f85f10 commit cd22b6e

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

eng/common/scripts/Verify-ChangeLogs.ps1

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,17 @@ Set-StrictMode -Version 3
77

88
. (Join-Path $PSScriptRoot common.ps1)
99

10-
function ShouldVerifyChangeLog ($ServiceDirectory, $PackageName) {
11-
$jsonCiYmlPath = Join-Path $ServiceDirectory "ci.yml"
12-
13-
if (Test-Path $jsonCiYmlPath)
14-
{
15-
$ciYml = Get-Content $jsonCiYmlPath -Raw | yq -o=json | ConvertFrom-Json -AsHashTable
16-
17-
if ($ciYml.extends -and $ciYml.extends.parameters -and $ciYml.extends.parameters.Artifacts) {
18-
$packagesCheckingChangeLog = $ciYml.extends.parameters.Artifacts `
19-
| Where-Object { -not ($_["skipVerifyChangelog"] -eq $true) } `
20-
| Select-Object -ExpandProperty name
21-
if ($packagesCheckingChangeLog -contains $PackageName)
22-
{
23-
return $true
24-
} else {
25-
return $false
26-
}
27-
}
10+
11+
function ShouldVerifyChangeLog ($PkgArtifactDetails) {
12+
if ($PkgArtifactDetails) {
13+
if ($PkgArtifactDetails.PSObject.Properties["skipVerifyChangeLog"] -eq $true) {
14+
return $false
2815
}
29-
}
3016

31-
if (-not (Get-Command 'yq' -ErrorAction SilentlyContinue)) {
32-
Write-Host "Error: 'yq' is not installed or not found in PATH. Please remedy this before running this script."
33-
exit 1
17+
return $true
18+
}
19+
20+
return $false
3421
}
3522

3623
# find which packages we need to confirm the changelog for
@@ -41,7 +28,7 @@ $allPassing = $true
4128
foreach($propertiesFile in $packageProperties) {
4229
$PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json
4330

44-
if (-not (ShouldVerifyChangeLog -ServiceDirectory (Join-Path $RepoRoot "sdk" $PackageProp.ServiceDirectory) -PackageName $PackageProp.Name)) {
31+
if (-not (ShouldVerifyChangeLog $PackageProp.ArtifactDetails)) {
4532
Write-Host "Skipping changelog verification for $($PackageProp.Name)"
4633
continue
4734
}

0 commit comments

Comments
 (0)