Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 9428 (#38699)
Browse files Browse the repository at this point in the history
* remove previous cadl scripts

* get-additional validation packages within language-settings needs to handle empty changed file arrays

---------

Co-authored-by: Mariana Rios Flores <mariari@microsoft.com>
Co-authored-by: Scott Beddall <scbedd@microsoft.com>
  • Loading branch information
3 people authored Nov 26, 2024
1 parent 2bebcff commit 2faf4cd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 250 deletions.
101 changes: 0 additions & 101 deletions eng/common/scripts/Cadl-Project-Generate.ps1

This file was deleted.

127 changes: 0 additions & 127 deletions eng/common/scripts/Cadl-Project-Sync.ps1

This file was deleted.

53 changes: 31 additions & 22 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,43 @@ function Get-python-AdditionalValidationPackagesFromPackageSet {
# packages WITHIN that service. This is because the service level file changes are likely to
# have an impact on the packages within that service.
$changedServices = @()
foreach($file in $diffObj.ChangedFiles) {
$pathComponents = $file -split "/"
# handle changes only in sdk/<service>/<file>/<extension>
if ($pathComponents.Length -eq 3 -and $pathComponents[0] -eq "sdk") {
$changedServices += $pathComponents[1]
}
if ($diffObj.ChangedFiles) {
foreach($file in $diffObj.ChangedFiles) {
$pathComponents = $file -split "/"
# handle changes only in sdk/<service>/<file>/<extension>
if ($pathComponents.Length -eq 3 -and $pathComponents[0] -eq "sdk") {
$changedServices += $pathComponents[1]
}

# handle any changes under sdk/<file>.<extension>
if ($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") {
$changedServices += "template"
# handle any changes under sdk/<file>.<extension>
if ($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") {
$changedServices += "template"
}
}
}
foreach ($changedService in $changedServices) {
$additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }

foreach ($pkg in $additionalPackages) {
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) {
# notice the lack of setting IncludedForValidation to true. This is because these "changed services"
# are specifically where a file within the service, but not an individual package within that service has changed.
# we want this package to be fully validated
$uniqueResultSet += $pkg
foreach ($changedService in $changedServices) {
$additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }

foreach ($pkg in $additionalPackages) {
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) {
# notice the lack of setting IncludedForValidation to true. This is because these "changed services"
# are specifically where a file within the service, but not an individual package within that service has changed.
# we want this package to be fully validated
$uniqueResultSet += $pkg
}
}
}
}

$toolChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith("tool")}
$engChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith("eng")}
$othersChanged = $diffObj.ChangedFiles | Where-Object { isOther($_) }
$toolChanged = @()
$othersChanged = @()
$engChanged = @()

if ($diffObj.ChangedFiles) {
$toolChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith("tool")}
$engChanged = $diffObj.ChangedFiles | Where-Object { $_.StartsWith("eng")}
$othersChanged = $diffObj.ChangedFiles | Where-Object { isOther($_) }
}

$changedServices = $changedServices | Get-Unique

if ($toolChanged) {
Expand Down

0 comments on commit 2faf4cd

Please sign in to comment.