Skip to content
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

Sync eng/common directory with azure-sdk-tools for PR 9428 #31942

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from 1 commit
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
22 changes: 12 additions & 10 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ $MetadataUri = "https://raw.githubusercontent.com/Azure/azure-sdk/main/_data/rel
$GithubUri = "https://github.com/Azure/azure-sdk-for-js"
$PackageRepositoryUri = "https://www.npmjs.com/package"
$ReducedDependencyLookup = @{
'core' = @('@azure-rest/synapse-access-control', '@azure/arm-resources', '@azure/identity', '@azure/service-bus', '@azure/template')
'core' = @('@azure-rest/synapse-access-control', '@azure/arm-resources', '@azure/identity', '@azure/service-bus', '@azure/template')
'test-utils' = @('@azure-tests/perf-storage-blob', '@azure/arm-eventgrid', '@azure/ai-text-analytics', '@azure/identity', '@azure/template')
'identity' = @('@azure-tests/perf-storage-blob', '@azure/ai-text-analytics', '@azure/arm-resources', '@azure/identity-cache-persistence', '@azure/identity-vscode', '@azure/storage-blob', '@azure/template')
'identity' = @('@azure-tests/perf-storage-blob', '@azure/ai-text-analytics', '@azure/arm-resources', '@azure/identity-cache-persistence', '@azure/identity-vscode', '@azure/storage-blob', '@azure/template')
}

. "$PSScriptRoot/docs/Docs-ToC.ps1"
Expand All @@ -32,11 +32,11 @@ function Get-javascript-EmitterAdditionalOptions([string]$projectDirectory) {

function Get-javascript-AdditionalValidationPackagesFromPackageSet {
param(
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
$LocatedPackages,
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
$diffObj,
[Parameter(Mandatory=$true)]
[Parameter(Mandatory = $true)]
$AllPkgProps
)
$additionalValidationPackages = @()
Expand All @@ -54,7 +54,7 @@ function Get-javascript-AdditionalValidationPackagesFromPackageSet {
}

$changedServices = @()
foreach($file in $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") {
Expand All @@ -66,18 +66,20 @@ function Get-javascript-AdditionalValidationPackagesFromPackageSet {
$changedServices += "template"
}
}

$othersChanged = $diffObj.ChangedFiles | Where-Object { isOther $_ }
$othersChanged = @()
if ($diffObj.ChangedFiles) {
scbedd marked this conversation as resolved.
Show resolved Hide resolved
$othersChanged = $diffObj.ChangedFiles | Where-Object { isOther $_ }
}
$changedServices = $changedServices | Get-Unique

if ($othersChanged) {
$additionalPackages = $ReducedDependencyLookup["core"] | ForEach-Object { $me=$_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 }
$additionalPackages = $ReducedDependencyLookup["core"] | ForEach-Object { $me = $_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 }
$additionalValidationPackages += $additionalPackages
}

foreach ($changedService in $changedServices) {
if ($ReducedDependencyLookup.ContainsKey($changedService)) {
$additionalPackages = $ReducedDependencyLookup[$changedService] | ForEach-Object { $me=$_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 }
$additionalPackages = $ReducedDependencyLookup[$changedService] | ForEach-Object { $me = $_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 }
$additionalValidationPackages += $additionalPackages
}
else {
Expand Down
Loading