Skip to content

Sync eng/common directory with azure-sdk-tools for PR 10521 #1888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion eng/common/scripts/ChangeLog-Operations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
11 changes: 10 additions & 1 deletion eng/common/scripts/Package-Properties.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -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
}
}
Expand Down Expand Up @@ -448,6 +451,8 @@ function Get-PrPkgProperties([string]$InputDiffJson) {
}

if ($shouldInclude) {

LogInfo $includeMsg
$packagesWithChanges += $pkg

if ($pkg.AdditionalValidationPackages) {
Expand All @@ -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
}
}
Expand All @@ -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
Expand Down