Sync eng/common directory with azure-sdk-tools repository (#6575)
This commit is contained in:
parent
77eee12717
commit
6b591a8a12
@ -19,7 +19,7 @@ function Get-ChangeLogEntries {
|
||||
LogError "ChangeLog[${ChangeLogLocation}] does not exist"
|
||||
return $null
|
||||
}
|
||||
LogDebug "Extracting entries from [${ChangeLogLocation}]."
|
||||
Write-Verbose "Extracting entries from [${ChangeLogLocation}]."
|
||||
return Get-ChangeLogEntriesFromContent (Get-Content -Path $ChangeLogLocation)
|
||||
}
|
||||
|
||||
|
||||
@ -368,7 +368,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
|
||||
# this is the primary loop that identifies the packages that have changes
|
||||
foreach ($pkg in $allPackageProperties) {
|
||||
Write-Host "Processing changed files against $($pkg.Name). $pkgCounter of $($allPackageProperties.Count)."
|
||||
Write-Verbose "Processing changed files against $($pkg.Name). $pkgCounter of $($allPackageProperties.Count)."
|
||||
$pkgDirectory = (Resolve-Path "$($pkg.DirectoryPath)").Path.Replace("`\", "/")
|
||||
$lookupKey = $pkgDirectory.Replace($RepoRoot, "").TrimStart('\/')
|
||||
$lookup[$lookupKey] = $pkg
|
||||
@ -389,6 +389,8 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
# handle direct changes to packages
|
||||
$shouldInclude = $filePath -eq $pkgDirectory -or $filePath -like "$pkgDirectory/*"
|
||||
|
||||
$includeMsg = "Including '$($pkg.Name)' because of changed file '$filePath'."
|
||||
|
||||
# we only need to do additional work for indirect packages if we haven't already decided
|
||||
# to include this package due to this file
|
||||
if (-not $shouldInclude) {
|
||||
@ -399,6 +401,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
$includedForValidation = ($filePath -like ("$resolvedRelativePath/*") -or $filePath -eq $resolvedRelativePath)
|
||||
$shouldInclude = $shouldInclude -or $includedForValidation
|
||||
if ($includedForValidation) {
|
||||
$includeMsg += " - (triggerPath: '$triggerPath')"
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -448,6 +451,8 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
}
|
||||
|
||||
if ($shouldInclude) {
|
||||
|
||||
LogInfo $includeMsg
|
||||
$packagesWithChanges += $pkg
|
||||
|
||||
if ($pkg.AdditionalValidationPackages) {
|
||||
@ -474,6 +479,7 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
|
||||
if ($pkg.Name -notin $existingPackageNames) {
|
||||
$pkg.IncludedForValidation = $true
|
||||
LogInfo "Including '$($pkg.Name)' for validation only because it is a dependency of another package."
|
||||
$packagesWithChanges += $pkg
|
||||
}
|
||||
}
|
||||
@ -484,6 +490,9 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
|
||||
if ($AdditionalValidationPackagesFromPackageSetFn -and (Test-Path "Function:$AdditionalValidationPackagesFromPackageSetFn")) {
|
||||
$additionalPackages = &$AdditionalValidationPackagesFromPackageSetFn $packagesWithChanges $diff $allPackageProperties
|
||||
$packagesWithChanges += $additionalPackages
|
||||
foreach ($pkg in $additionalPackages) {
|
||||
LogInfo "Including '$($pkg.Name)' from the additional validation package set."
|
||||
}
|
||||
}
|
||||
|
||||
# finally, if we have gotten all the way here and we still don't have any packages, we should include the template service
|
||||
|
||||
Loading…
Reference in New Issue
Block a user