Skip to content

Commit daa04d7

Browse files
azure-sdkscbeddbenbp
authored
Sync eng/common directory with azure-sdk-tools for PR 9035 (Azure#46276)
* don't verify changelog for packages that aren't actively published anymore --------- Co-authored-by: Scott Beddall <[email protected]> Co-authored-by: Scott Beddall <[email protected]> Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 45b6f68 commit daa04d7

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

eng/common/scripts/Verify-ChangeLogs.ps1

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ 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+
}
28+
}
29+
}
30+
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
34+
}
35+
1036
# find which packages we need to confirm the changelog for
1137
$packageProperties = Get-ChildItem -Recurse "$PackagePropertiesFolder" *.json
1238

@@ -15,14 +41,18 @@ $allPassing = $true
1541
foreach($propertiesFile in $packageProperties) {
1642
$PackageProp = Get-Content -Path $propertiesFile | ConvertFrom-Json
1743

44+
if (-not (ShouldVerifyChangeLog -ServiceDirectory (Join-Path $RepoRoot "sdk" $PackageProp.ServiceDirectory) -PackageName $PackageProp.Name)) {
45+
Write-Host "Skipping changelog verification for $($PackageProp.Name)"
46+
continue
47+
}
48+
1849
$validChangeLog = Confirm-ChangeLogEntry -ChangeLogLocation $PackageProp.ChangeLogPath -VersionString $PackageProp.Version -ForRelease $false
1950

2051
if (-not $validChangeLog) {
2152
$allPassing = $false
2253
}
2354
}
2455

25-
2656
if (!$allPassing)
2757
{
2858
exit 1

0 commit comments

Comments
 (0)