-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update Triggering Paths #33395
Open
scbedd
wants to merge
3
commits into
main
Choose a base branch
from
update-triggering-paths
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Update Triggering Paths #33395
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -7,9 +7,8 @@ $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') | ||||||
'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') | ||||||
'test-utils' = @('@azure-tests/perf-storage-blob') | ||||||
'identity' = @('@azure-tests/perf-storage-blob') | ||||||
} | ||||||
|
||||||
. "$PSScriptRoot/docs/Docs-ToC.ps1" | ||||||
|
@@ -39,75 +38,26 @@ function Get-javascript-AdditionalValidationPackagesFromPackageSet { | |||||
[Parameter(Mandatory = $true)] | ||||||
$AllPkgProps | ||||||
) | ||||||
$additionalValidationPackages = @() | ||||||
|
||||||
function isOther($fileName) { | ||||||
$startsWithPrefixes = @(".config", ".devcontainer", ".github", ".scripts", ".vscode", "common", "design", "documentation", "eng", "samples") | ||||||
|
||||||
foreach ($prefix in $startsWithPrefixes) { | ||||||
if ($fileName.StartsWith($prefix)) { | ||||||
return $true | ||||||
} | ||||||
} | ||||||
|
||||||
return $false | ||||||
} | ||||||
|
||||||
$targetedFiles = $diffObj.ChangedFiles | ||||||
if ($diff.DeletedFiles) { | ||||||
if (-not $targetedFiles) { | ||||||
$targetedFiles = @() | ||||||
} | ||||||
$targetedFiles += $diff.DeletedFiles | ||||||
} | ||||||
|
||||||
# The targetedFiles needs to filter out anything in the ExcludePaths | ||||||
# otherwise it'll end up processing things below that it shouldn't be. | ||||||
foreach ($excludePath in $diffObj.ExcludePaths) { | ||||||
$targetedFiles = $targetedFiles | Where-Object { -not $_.StartsWith($excludePath) } | ||||||
} | ||||||
|
||||||
$changedServices = @() | ||||||
foreach ($file in $targetedFiles) { | ||||||
$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> or in the root of | ||||||
# the repository | ||||||
if (($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") -or | ||||||
($pathComponents.Length -eq 1)) { | ||||||
$changedServices += "template" | ||||||
} | ||||||
} | ||||||
$othersChanged = @() | ||||||
|
||||||
if ($targetedFiles) { | ||||||
$othersChanged = $targetedFiles | 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 } | ||||||
$additionalValidationPackages += $additionalPackages | ||||||
} | ||||||
$existingPackages = $LocatedPackages | ForEach-Object { $_.Name } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not sure if necessary, but if it is a singular result this could screw up the |
||||||
$additionalDetectedPackages = @() | ||||||
$uniqueResultSet = @() | ||||||
|
||||||
# we don't currently have a way to trigger a package that doesn't exist in an artifact set | ||||||
# so we can't trigger @azure-tests/perf-storage-blob based on changes to sdk/test-utils/ using any common tooling | ||||||
# for now we will handle this in this function. | ||||||
foreach ($changedService in $changedServices) { | ||||||
if ($ReducedDependencyLookup.ContainsKey($changedService)) { | ||||||
$additionalPackages = $ReducedDependencyLookup[$changedService] | ForEach-Object { $me = $_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 } | ||||||
$additionalValidationPackages += $additionalPackages | ||||||
} | ||||||
else { | ||||||
$additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService } | ||||||
$additionalValidationPackages += $additionalPackages | ||||||
$additionalPackages = $ReducedDependencyLookup[$changedService] ` | ||||||
| ForEach-Object { $me = $_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 } | ||||||
|
||||||
# we don't need to worry about duplicates here, we'll handle that later | ||||||
$additionalDetectedPackages += $additionalPackages | ||||||
} | ||||||
} | ||||||
|
||||||
$uniqueResultSet = @() | ||||||
foreach ($pkg in $additionalValidationPackages) { | ||||||
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) { | ||||||
foreach ($pkg in $additionalDetectedPackages) { | ||||||
$alreadyIncluded = $uniqueResultSet | ForEach-Object { $_.Name } | ||||||
if ($existingPackages -notcontains $pkg.Name -and $alreadyIncluded -notcontains $pkg.Name) { | ||||||
$pkg.IncludedForValidation = $true | ||||||
$uniqueResultSet += $pkg | ||||||
} | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume these aren't in the trigger paths because these are artifacts in the ci.yml file. I wonder how much we care about these triggering those builds. It would be nice to eliminate this map and code to handle it completely.
Also if these aren't in the ci.yml artifact lists then is there even a packageinfo for them and can they even be included in the package set?