Skip to content

Commit bb5efb6

Browse files
authored
Further net - pullrequest tuning (Azure#48379)
* remove additionalValidation function in Language-Settings. Unnecessary as all additions are now handled by common code * add triggering paths to ci.yml for all *.Shared packages in the repo * patch conditions in eng/service.proj to ensure that **/*.props is only included when the packagelistoverridefile is not set * ensure that service directory `pack` doesn't honor a package list override file * exclude integration tests from `pack`
1 parent 2a985a6 commit bb5efb6

File tree

10 files changed

+54
-123
lines changed

10 files changed

+54
-123
lines changed

eng/pipelines/templates/jobs/ci.tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
--blame-crash-dump-type full --blame-hang-dump-type full --blame-hang-timeout ${{parameters.TestTimeoutInMinutes}}minutes
165165
/p:SDKType=${{ parameters.SDKType }}
166166
/p:ServiceDirectory=$(ServiceDirectory)
167-
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false
167+
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeIntegrationTests=false
168168
/p:RunApiCompat=false /p:InheritDocEnabled=false
169169
/p:Configuration=$(BuildConfiguration)
170170
/p:CollectCoverage=$(CollectCoverage)

eng/pipelines/templates/jobs/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
/p:ProjectListOverrideFile=$(ProjectListOverrideFile) `
140140
/p:IncludePerf=false `
141141
/p:IncludeStress=false `
142+
/p:IncludeIntegrationTests=false `
142143
/p:EnableOverrideExclusions=true `
143144
$(DiagnosticArguments)
144145
displayName: "Build and Package for PR"
@@ -328,6 +329,7 @@ jobs:
328329
/p:PublicSign=false `
329330
/p:Configuration=$(BuildConfiguration) `
330331
/p:EnableSourceLink=false `
332+
/p:ProjectListOverrideFile="" `
331333
/p:BuildSnippets=true `
332334
$(DiagnosticArguments)
333335
}

eng/scripts/Language-Settings.ps1

Lines changed: 0 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -122,126 +122,6 @@ function Get-AllPackageInfoFromRepo($serviceDirectory)
122122
return $allPackageProps
123123
}
124124

125-
<#
126-
.DESCRIPTION
127-
This function governs the logic for determining which packages should be included for validation in net - pullrequest
128-
when the PR contains changes to files outside of package directories.
129-
130-
.PARAMETER LocatedPackages
131-
The set of packages that have been directly changed in the PR.
132-
133-
.PARAMETER diffObj
134-
The diff object that contains the set of changed and deleted files in the PR.
135-
136-
.PARAMETER AllPkgProps
137-
The entire set of package properties for the repository.
138-
139-
#>
140-
function Get-dotnet-AdditionalValidationPackagesFromPackageSet {
141-
param(
142-
[Parameter(Mandatory=$true)]
143-
$LocatedPackages,
144-
[Parameter(Mandatory=$true)]
145-
$diffObj,
146-
[Parameter(Mandatory=$true)]
147-
$AllPkgProps
148-
)
149-
$additionalValidationPackages = @()
150-
$uniqueResultSet = @()
151-
function isOther($fileName) {
152-
$startsWithPrefixes = @(".config", ".devcontainer", ".github", ".vscode", "common", "doc", "eng", "samples")
153-
154-
$startsWith = $false
155-
foreach ($prefix in $startsWithPrefixes) {
156-
if ($fileName.StartsWith($prefix)) {
157-
$startsWith = $true
158-
}
159-
}
160-
161-
return $startsWith
162-
}
163-
164-
# ensure we observe deleted files too
165-
$targetedFiles = @($diffObj.ChangedFiles + $diffObj.DeletedFiles)
166-
167-
# The targetedFiles needs to filter out anything in the ExcludePaths
168-
# otherwise it'll end up processing things below that it shouldn't be.
169-
foreach ($excludePath in $diffObj.ExcludePaths) {
170-
$targetedFiles = $targetedFiles | Where-Object { -not $_.StartsWith($excludePath) }
171-
}
172-
173-
# this section will identify
174-
# - any service-level changes
175-
# - any shared package changes that should be treated as a service-level change. EG changes to Azure.Storage.Shared.
176-
# and add all packages within that service to the validation set. these will be treated as "directly" changed packages.
177-
$changedServices = @()
178-
if ($targetedFiles) {
179-
foreach($file in $targetedFiles) {
180-
$pathComponents = $file -split "/"
181-
# handle changes only in sdk/<service>/<file>.<extension>
182-
if ($pathComponents.Length -eq 3 -and $pathComponents[0] -eq "sdk") {
183-
$changedServices += $pathComponents[1]
184-
}
185-
186-
# handle any changes under sdk/<file>.<extension> or any files
187-
# in the repository root
188-
if (($pathComponents.Length -eq 2 -and $pathComponents[0] -eq "sdk") -or
189-
($pathComponents.Length -eq 1)) {
190-
$changedServices += "template"
191-
}
192-
193-
# changes to a Azure.*.Shared within a service directory should include all packages within that service directory
194-
if ($file.Replace('\', '/') -match ".*sdk/.*/.*\.Shared/.*") {
195-
$changedServices += $pathComponents[1]
196-
}
197-
}
198-
# dedupe the changedServices list before processing
199-
$changedServices = $changedServices | Get-Unique
200-
foreach ($changedService in $changedServices) {
201-
$additionalPackages = $AllPkgProps | Where-Object { $_.ServiceDirectory -eq $changedService }
202-
203-
foreach ($pkg in $additionalPackages) {
204-
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) {
205-
# notice the lack of setting IncludedForValidation to true. This is because these "changed services"
206-
# are specifically where a file within the service, but not an individual package within that service has changed.
207-
# we want this package to be fully validated
208-
$uniqueResultSet += $pkg
209-
}
210-
}
211-
}
212-
}
213-
214-
# handle any changes to files that are not within a package directory
215-
$othersChanged = @()
216-
if ($targetedFiles) {
217-
$othersChanged = $targetedFiles | Where-Object { isOther($_) }
218-
}
219-
220-
if ($othersChanged) {
221-
$additionalPackages = @(
222-
"Azure.Template"
223-
) | ForEach-Object { $me=$_; $AllPkgProps | Where-Object { $_.Name -eq $me } | Select-Object -First 1 }
224-
225-
$additionalValidationPackages += $additionalPackages
226-
}
227-
228-
# walk the packages added purely for validation, if they haven't been added yet, add them
229-
# these packages aren't considered "directly" changed, so we will set IncludedForValidation to true for them
230-
foreach ($pkg in $additionalValidationPackages) {
231-
if ($uniqueResultSet -notcontains $pkg -and $LocatedPackages -notcontains $pkg) {
232-
$pkg.IncludedForValidation = $true
233-
$uniqueResultSet += $pkg
234-
}
235-
}
236-
237-
Write-Host "Returning additional packages for validation: $($uniqueResultSet.Count)"
238-
foreach ($pkg in $uniqueResultSet) {
239-
Write-Host " - $($pkg.Name)"
240-
}
241-
242-
return $uniqueResultSet
243-
}
244-
245125
# Returns the nuget publish status of a package id and version.
246126
function IsNugetPackageVersionPublished ($pkgId, $pkgVersion)
247127
{

eng/service.proj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<IncludeSamples Condition="'$(IncludeSamples)' == ''">true</IncludeSamples>
1010
<IncludePerf Condition="'$(IncludePerf)' == ''">true</IncludePerf>
1111
<IncludeStress Condition="'$(IncludeStress)' == ''">true</IncludeStress>
12+
<IncludeIntegrationTests Condition="'$(IncludeIntegrationTests)' == ''">true</IncludeIntegrationTests>
1213
<IncludeSamplesApplications Condition="'$(IncludeSamplesApplications)' == ''">true</IncludeSamplesApplications>
1314
<IncludeSamplesApplications Condition="'$(ServiceDirectory)' != '*' or '$(IncludeSamples)' == 'false'">false</IncludeSamplesApplications>
1415
</PropertyGroup>
@@ -58,7 +59,7 @@
5859
<ProjectReference Include="@(SrcProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeSrc)' == 'true'" />
5960
</ItemGroup>
6061

61-
<Import Project="..\sdk\$(ServiceDirectory)\*.projects" />
62+
<Import Project="..\sdk\$(ServiceDirectory)\*.projects" Condition="'$(ProjectListOverrideFile)' == '' "/>
6263
<Import Project="$(RepoRoot)$(ProjectListOverrideFile)" Condition="'$(ProjectListOverrideFile)' != '' " />
6364

6465
<ItemGroup Condition="'$(ProjectListOverrideFile)' != '' and '$(RemoveTrack1Projects)' == 'true'">
@@ -82,7 +83,7 @@
8283
<ProjectReference Remove="@(StressProjects)" Condition="'$(IncludeStress)' == 'false'" />
8384
<ProjectReference Remove="@(SampleApplications)" Condition="'$(IncludeSamplesApplications)' == 'false'"/>
8485
<ProjectReference Remove="@(SrcProjects)" Condition="'$(IncludeSrc)' == 'false'" />
85-
<ProjectReference Remove="@(IntegrationTestProjects)" Condition="'$(IncludeSrc)' == 'false'" />
86+
<ProjectReference Remove="@(IntegrationTestProjects)" Condition="'$(IncludeIntegrationTests)' == 'false'" />
8687
<ProjectReference Remove="@(SharedProjects)" Condition="'$(IncludeSrc)' == 'false'" />
8788
</ItemGroup>
8889

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

102+
101103
<Target Name="GenerateCode">
102104
<MSBuild Projects="@(ProjectReference)"
103105
Targets="GenerateCode"

sdk/eventhub/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ extends:
3838
Artifacts:
3939
- name: Azure.Messaging.EventHubs
4040
safeName: AzureMessagingEventHubs
41+
triggeringPaths:
42+
- Azure.Messaging.EventHubs.Shared
4143
- name: Azure.Messaging.EventHubs.Processor
4244
safeName: AzureMessagingEventHubsProcessor
45+
triggeringPaths:
46+
- Azure.Messaging.EventHubs.Shared
4347
CheckAotCompat: true
4448
AOTTestInputs:
4549
- ArtifactName: Azure.Messaging.EventHubs

sdk/keyvault/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,20 @@ extends:
3333
Artifacts:
3434
- name: Azure.Security.KeyVault.Administration
3535
safeName: AzureSecurityKeyVaultAdministration
36+
triggeringPaths:
37+
- Azure.Security.Keyvault.Shared
3638
- name: Azure.Security.KeyVault.Certificates
3739
safeName: AzureSecurityKeyVaultCertificates
40+
triggeringPaths:
41+
- Azure.Security.Keyvault.Shared
3842
- name: Azure.Security.KeyVault.Keys
3943
safeName: AzureSecurityKeyVaultKeys
44+
triggeringPaths:
45+
- Azure.Security.Keyvault.Shared
4046
- name: Azure.Security.KeyVault.Secrets
4147
safeName: AzureSecurityKeyVaultSecrets
48+
triggeringPaths:
49+
- Azure.Security.Keyvault.Shared
4250
CheckAOTCompat: true
4351
AOTTestInputs:
4452
- ArtifactName: Azure.Security.KeyVault.Secrets

sdk/purview/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,29 @@ extends:
3232
Artifacts:
3333
- name: Azure.Analytics.Purview.Sharing
3434
safeName: AzureAnalyticsPurviewSharing
35+
triggeringPaths:
36+
- Azure.Analytics.Purview.Shared
3537
- name: Azure.Analytics.Purview.Workflows
3638
safeName: AzureAnalyticsPurviewWorkflows
39+
triggeringPaths:
40+
- Azure.Analytics.Purview.Shared
3741
- name: Azure.Analytics.Purview.Account
3842
safeName: AzureAnalyticsPurviewAccount
43+
triggeringPaths:
44+
- Azure.Analytics.Purview.Shared
3945
- name: Azure.Analytics.Purview.Administration
4046
safeName: AzureAnalyticsPurviewAdministration
47+
triggeringPaths:
48+
- Azure.Analytics.Purview.Shared
4149
- name: Azure.Analytics.Purview.Catalog
4250
safeName: AzureAnalyticsPurviewCatalog
51+
triggeringPaths:
52+
- Azure.Analytics.Purview.Shared
4353
- name: Azure.Analytics.Purview.DataMap
4454
safeName: AzureAnalyticsPurviewDataMap
55+
triggeringPaths:
56+
- Azure.Analytics.Purview.Shared
4557
- name: Azure.Analytics.Purview.Scanning
4658
safeName: AzureAnalyticsPurviewScanning
59+
triggeringPaths:
60+
- Azure.Analytics.Purview.Shared

sdk/synapse/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,21 @@ extends:
4343
Artifacts:
4444
- name: Azure.Analytics.Synapse.Spark
4545
safeName: AzureAnalyticsSynapseSpark
46+
triggeringPaths:
47+
- Azure.Analytics.Synapse.Shared
4648
- name: Azure.Analytics.Synapse.AccessControl
4749
safeName: AzureAnalyticsSynapseAccessControl
50+
triggeringPaths:
51+
- Azure.Analytics.Synapse.Shared
4852
- name: Azure.Analytics.Synapse.Artifacts
4953
safeName: AzureAnalyticsSynapseArtifacts
54+
triggeringPaths:
55+
- Azure.Analytics.Synapse.Shared
5056
- name: Azure.Analytics.Synapse.ManagedPrivateEndpoints
5157
safeName: AzureAnalyticsSynapseManagedPrivateEndpoints
58+
triggeringPaths:
59+
- Azure.Analytics.Synapse.Shared
5260
- name: Azure.Analytics.Synapse.Monitoring
5361
safeName: AzureAnalyticsSynapseMonitoring
62+
triggeringPaths:
63+
- Azure.Analytics.Synapse.Shared

sdk/template/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,12 @@ extends:
5252
Artifacts:
5353
- name: Azure.Template
5454
safeName: AzureTemplate
55+
triggeringPaths:
56+
- /.config
57+
- /.devcontainer
58+
- /.github
59+
- /.vscode
60+
- /common
61+
- /doc
62+
- /eng
63+
- /samples

sdk/textanalytics/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ extends:
2929
Artifacts:
3030
- name: Azure.AI.TextAnalytics
3131
safeName: AzureAITextAnalytics
32+
triggeringPaths:
33+
- Azure.AI.TextAnalytics.Legacy.Shared

0 commit comments

Comments
 (0)