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

Further Tuning to net - pullrequest #48269

Merged
merged 8 commits into from
Feb 13, 2025
Merged
1 change: 1 addition & 0 deletions eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ jobs:
/p:EnableSourceLink=false
/p:ProjectListOverrideFile=$(ProjectListOverrideFile)
/p:EnableOverrideExclusions=true
/p:RemoveTrack1Projects=true
$(AdditionalTestArguments)
$(DiagnosticArguments)
displayName: "Build & Test ($(TestTargetFramework))"
Expand Down
3 changes: 3 additions & 0 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ jobs:
/p:ArtifactsPackagesDir=$(Build.ArtifactStagingDirectory) `
/p:ServiceDirectory=* `
/p:ProjectListOverrideFile=$(ProjectListOverrideFile) `
/p:IncludePerf=false `
/p:IncludeStress=false `
/p:EnableOverrideExclusions=true `
$(DiagnosticArguments)
displayName: "Build and Package for PR"
- ${{ else }}:
Expand Down
47 changes: 34 additions & 13 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
)
$additionalValidationPackages = @()
$uniqueResultSet = @()

function isOther($fileName) {
$startsWithPrefixes = @(".config", ".devcontainer", ".github", ".vscode", "common", "doc", "eng", "samples")

Expand All @@ -162,23 +161,42 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
return $startsWith
}

# this section will identify the list of packages that we should treat as
# "directly" changed for a given service level change. While that doesn't
# directly change a package within the service, I do believe we should directly include all
# packages WITHIN that service. This is because the service level file changes are likely to
# have an impact on the packages within that service.
# ensure we observe deleted files too
$targetedFiles = @($diffObj.ChangedFiles + $diffObj.DeletedFiles)
scbedd marked this conversation as resolved.
Show resolved Hide resolved

# 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) }
}

# this section will identify
# - any service-level changes
# - any shared package changes that should be treated as a service-level change. EG changes to Azure.Storage.Shared.
# and add all packages within that service to the validation set. these will be treated as "directly" changed packages.
$changedServices = @()
if ($diffObj.ChangedFiles) {
foreach($file in $diffObj.ChangedFiles) {
if ($targetedFiles) {
foreach($file in $targetedFiles) {
$pathComponents = $file -split "/"
# handle changes only in sdk/<service>/<file>/<extension>
# handle changes only in sdk/<service>/<file>.<extension>
if ($pathComponents.Length -eq 3 -and $pathComponents[0] -eq "sdk") {
$changedServices += $pathComponents[1]
if (-not $changedServices.Contains($pathComponents[1])) {
$changedServices += $pathComponents[1]
}
}

# handle any changes under sdk/<file>.<extension>
if ($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") {
$changedServices += "template"
if (-not $changedServices.Contains("template")) {
$changedServices += "template"
}
}

# changes to a Azure.*.Shared within a service directory should include all packages within that service directory
if ($file.Replace('\', '/') -match ".*sdk/.*/.*\.Shared/.*") {
if (-not $changedServices.Contains($pathComponents[1])) {
$changedServices += $pathComponents[1]
}
}
}
foreach ($changedService in $changedServices) {
Expand All @@ -195,9 +213,10 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
}
}

# handle any changes to files that are not within a package directory
$othersChanged = @()
if ($diffObj.ChangedFiles) {
$othersChanged = $diffObj.ChangedFiles | Where-Object { isOther($_) }
if ($targetedFiles) {
$othersChanged = $targetedFiles | Where-Object { isOther($_) }
}

if ($othersChanged) {
Expand All @@ -208,6 +227,8 @@ function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
$additionalValidationPackages += $additionalPackages
}

# walk the packages added purely for validation, if they haven't been added yet, add them
# these packages aren't considered "directly" changed, so we will set IncludedForValidation to true for them
foreach ($pkg in $additionalValidationPackages) {
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) {
$pkg.IncludedForValidation = $true
Expand Down
5 changes: 4 additions & 1 deletion eng/service.proj
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@
<Import Project="..\sdk\$(ServiceDirectory)\*.projects" />
<Import Project="$(RepoRoot)$(ProjectListOverrideFile)" Condition="'$(ProjectListOverrideFile)' != '' " />

<ItemGroup Condition="'$(ProjectListOverrideFile)' != '' and '$(EnableOverrideExclusions)' != ''">
<ItemGroup Condition="'$(ProjectListOverrideFile)' != '' and '$(RemoveTrack1Projects)' == 'true'">
<!-- Remove all track1 SDKs from Regen -->
<Track1ProjectsToRemove Include="$(MSBuildThisFileDirectory)..\sdk\*\Microsoft.*.Management.*\**\*.csproj;$(MSBuildThisFileDirectory)..\sdk\*mgmt*\**\*.csproj;$(MSBuildThisFileDirectory)..\sdk\*\Microsoft.Azure.*\**\*.csproj" />
<ProjectReference Remove="@(Track1ProjectsToRemove)" />
</ItemGroup>

<ItemGroup Condition="'$(ProjectListOverrideFile)' != '' and '$(EnableOverrideExclusions)' != ''">
<TestProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\tests\**\*.csproj" Exclude="@(MgmtExcludePaths)" />
<SamplesProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\samples\**\*.csproj;..\sdk\$(ServiceDirectory)\samples\**\*.csproj" Exclude="@(MgmtExcludePaths)" />
<PerfProjects Include="..\sdk\$(ServiceDirectory)\$(Project)\perf\**\*.csproj" Exclude="@(MgmtExcludePaths)" />
Expand Down
Loading