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 net - pullrequest tuning #48379

Merged
merged 11 commits into from
Feb 26, 2025
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
--blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TestTimeoutInMinutes}}minutes
/p:SDKType=${{ parameters.SDKType }}
/p:ServiceDirectory=$(ServiceDirectory)
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeIntegrationTests=false
/p:RunApiCompat=false /p:InheritDocEnabled=false
/p:Configuration=$(BuildConfiguration)
/p:CollectCoverage=$(CollectCoverage)
Expand Down
2 changes: 2 additions & 0 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ jobs:
/p:ProjectListOverrideFile=$(ProjectListOverrideFile) `
/p:IncludePerf=false `
/p:IncludeStress=false `
/p:IncludeIntegrationTests=false `
/p:EnableOverrideExclusions=true `
$(DiagnosticArguments)
displayName: "Build and Package for PR"
Expand Down Expand Up @@ -328,6 +329,7 @@ jobs:
/p:PublicSign=false `
/p:Configuration=$(BuildConfiguration) `
/p:EnableSourceLink=false `
/p:ProjectListOverrideFile="" `
/p:BuildSnippets=true `
$(DiagnosticArguments)
}
Expand Down
120 changes: 0 additions & 120 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,126 +122,6 @@ function Get-AllPackageInfoFromRepo($serviceDirectory)
return $allPackageProps
}

<#
.DESCRIPTION
This function governs the logic for determining which packages should be included for validation in net - pullrequest
when the PR contains changes to files outside of package directories.

.PARAMETER LocatedPackages
The set of packages that have been directly changed in the PR.

.PARAMETER diffObj
The diff object that contains the set of changed and deleted files in the PR.

.PARAMETER AllPkgProps
The entire set of package properties for the repository.

#>
function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
param(
[Parameter(Mandatory=$true)]
$LocatedPackages,
[Parameter(Mandatory=$true)]
$diffObj,
[Parameter(Mandatory=$true)]
$AllPkgProps
)
$additionalValidationPackages = @()
$uniqueResultSet = @()
function isOther($fileName) {
$startsWithPrefixes = @(".config", ".devcontainer", ".github", ".vscode", "common", "doc", "eng", "samples")

$startsWith = $false
foreach ($prefix in $startsWithPrefixes) {
if ($fileName.StartsWith($prefix)) {
$startsWith = $true
}
}

return $startsWith
}

# ensure we observe deleted files too
$targetedFiles = @($diffObj.ChangedFiles + $diffObj.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) }
}

# 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 ($targetedFiles) {
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 any files
# in the repository root
if (($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") -or
($pathComponents.Length -eq 1)) {
$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/.*") {
$changedServices += $pathComponents[1]
}
}
# dedupe the changedServices list before processing
$changedServices = $changedServices | Get-Unique
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
}
}
}
}

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

if ($othersChanged) {
$additionalPackages = @(
"Azure.Template"
) | ForEach-Object { $me=$_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 }

$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
$uniqueResultSet += $pkg
}
}

Write-Host "Returning additional packages for validation: $($uniqueResultSet.Count)"
foreach ($pkg in $uniqueResultSet) {
Write-Host " - $($pkg.Name)"
}

return $uniqueResultSet
}

# Returns the nuget publish status of a package id and version.
function IsNugetPackageVersionPublished ($pkgId, $pkgVersion)
{
Expand Down
6 changes: 4 additions & 2 deletions eng/service.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<IncludeSamples Condition="'$(IncludeSamples)' == ''">true</IncludeSamples>
<IncludePerf Condition="'$(IncludePerf)' == ''">true</IncludePerf>
<IncludeStress Condition="'$(IncludeStress)' == ''">true</IncludeStress>
<IncludeIntegrationTests Condition="'$(IncludeIntegrationTests)' == ''">true</IncludeIntegrationTests>
<IncludeSamplesApplications Condition="'$(IncludeSamplesApplications)' == ''">true</IncludeSamplesApplications>
<IncludeSamplesApplications Condition="'$(ServiceDirectory)' != '*' or '$(IncludeSamples)' == 'false'">false</IncludeSamplesApplications>
</PropertyGroup>
Expand Down Expand Up @@ -58,7 +59,7 @@
<ProjectReference Include="@(SrcProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeSrc)' == 'true'" />
</ItemGroup>

<Import Project="..\sdk\$(ServiceDirectory)\*.projects" />
<Import Project="..\sdk\$(ServiceDirectory)\*.projects" Condition="'$(ProjectListOverrideFile)' == '' "/>
<Import Project="$(RepoRoot)$(ProjectListOverrideFile)" Condition="'$(ProjectListOverrideFile)' != '' " />

<ItemGroup Condition="'$(ProjectListOverrideFile)' != '' and '$(RemoveTrack1Projects)' == 'true'">
Expand All @@ -82,7 +83,7 @@
<ProjectReference Remove="@(StressProjects)" Condition="'$(IncludeStress)' == 'false'" />
<ProjectReference Remove="@(SampleApplications)" Condition="'$(IncludeSamplesApplications)' == 'false'"/>
<ProjectReference Remove="@(SrcProjects)" Condition="'$(IncludeSrc)' == 'false'" />
<ProjectReference Remove="@(IntegrationTestProjects)" Condition="'$(IncludeSrc)' == 'false'" />
<ProjectReference Remove="@(IntegrationTestProjects)" Condition="'$(IncludeIntegrationTests)' == 'false'" />
<ProjectReference Remove="@(SharedProjects)" Condition="'$(IncludeSrc)' == 'false'" />
</ItemGroup>

Expand All @@ -98,6 +99,7 @@
Text="No Projects found with patttern [..\sdk\$(ServiceDirectory)\$(Project)\*.csproj], please make sure you have passed in the correct ServiceDirectory." />
</Target>


<Target Name="GenerateCode">
<MSBuild Projects="@(ProjectReference)"
Targets="GenerateCode"
Expand Down
4 changes: 4 additions & 0 deletions sdk/eventhub/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ extends:
Artifacts:
- name: Azure.Messaging.EventHubs
safeName: AzureMessagingEventHubs
triggeringPaths:
- Azure.Messaging.EventHubs.Shared
- name: Azure.Messaging.EventHubs.Processor
safeName: AzureMessagingEventHubsProcessor
triggeringPaths:
- Azure.Messaging.EventHubs.Shared
CheckAotCompat: true
AOTTestInputs:
- ArtifactName: Azure.Messaging.EventHubs
Expand Down
8 changes: 8 additions & 0 deletions sdk/keyvault/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,20 @@ extends:
Artifacts:
- name: Azure.Security.KeyVault.Administration
safeName: AzureSecurityKeyVaultAdministration
triggeringPaths:
- Azure.Security.Keyvault.Shared
- name: Azure.Security.KeyVault.Certificates
safeName: AzureSecurityKeyVaultCertificates
triggeringPaths:
- Azure.Security.Keyvault.Shared
- name: Azure.Security.KeyVault.Keys
safeName: AzureSecurityKeyVaultKeys
triggeringPaths:
- Azure.Security.Keyvault.Shared
- name: Azure.Security.KeyVault.Secrets
safeName: AzureSecurityKeyVaultSecrets
triggeringPaths:
- Azure.Security.Keyvault.Shared
CheckAOTCompat: true
AOTTestInputs:
- ArtifactName: Azure.Security.KeyVault.Secrets
Expand Down
14 changes: 14 additions & 0 deletions sdk/purview/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,29 @@ extends:
Artifacts:
- name: Azure.Analytics.Purview.Sharing
safeName: AzureAnalyticsPurviewSharing
triggeringPaths:
- Azure.Analytics.Purview.Shared
- name: Azure.Analytics.Purview.Workflows
safeName: AzureAnalyticsPurviewWorkflows
triggeringPaths:
- Azure.Analytics.Purview.Shared
- name: Azure.Analytics.Purview.Account
safeName: AzureAnalyticsPurviewAccount
triggeringPaths:
- Azure.Analytics.Purview.Shared
- name: Azure.Analytics.Purview.Administration
safeName: AzureAnalyticsPurviewAdministration
triggeringPaths:
- Azure.Analytics.Purview.Shared
- name: Azure.Analytics.Purview.Catalog
safeName: AzureAnalyticsPurviewCatalog
triggeringPaths:
- Azure.Analytics.Purview.Shared
- name: Azure.Analytics.Purview.DataMap
safeName: AzureAnalyticsPurviewDataMap
triggeringPaths:
- Azure.Analytics.Purview.Shared
- name: Azure.Analytics.Purview.Scanning
safeName: AzureAnalyticsPurviewScanning
triggeringPaths:
- Azure.Analytics.Purview.Shared
10 changes: 10 additions & 0 deletions sdk/synapse/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,21 @@ extends:
Artifacts:
- name: Azure.Analytics.Synapse.Spark
safeName: AzureAnalyticsSynapseSpark
triggeringPaths:
- Azure.Analytics.Synapse.Shared
- name: Azure.Analytics.Synapse.AccessControl
safeName: AzureAnalyticsSynapseAccessControl
triggeringPaths:
- Azure.Analytics.Synapse.Shared
- name: Azure.Analytics.Synapse.Artifacts
safeName: AzureAnalyticsSynapseArtifacts
triggeringPaths:
- Azure.Analytics.Synapse.Shared
- name: Azure.Analytics.Synapse.ManagedPrivateEndpoints
safeName: AzureAnalyticsSynapseManagedPrivateEndpoints
triggeringPaths:
- Azure.Analytics.Synapse.Shared
- name: Azure.Analytics.Synapse.Monitoring
safeName: AzureAnalyticsSynapseMonitoring
triggeringPaths:
- Azure.Analytics.Synapse.Shared
9 changes: 9 additions & 0 deletions sdk/template/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,12 @@ extends:
Artifacts:
- name: Azure.Template
safeName: AzureTemplate
triggeringPaths:
- /.config
- /.devcontainer
- /.github
- /.vscode
- /common
- /doc
- /eng
- /samples
2 changes: 2 additions & 0 deletions sdk/textanalytics/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ extends:
Artifacts:
- name: Azure.AI.TextAnalytics
safeName: AzureAITextAnalytics
triggeringPaths:
- Azure.AI.TextAnalytics.Legacy.Shared
Loading