Skip to content

Commit e886521

Browse files
authored
Eventhubs/pipeline pivot (Azure#17804)
* [Event Hubs] Local Pipeline Exclusions The focus of these changes is to revisit the approach of extending the central pipeline for uniform project exclusions and, instead, pivot to using a local services project specific to Event Hubs. * Add SDKType support to enable filtering Plumb SDKType support through our pipeline templates to allow support for filtering based on the type of SDK we want to build in our pipelines.
1 parent 493594b commit e886521

File tree

15 files changed

+167
-135
lines changed

15 files changed

+167
-135
lines changed

eng/pipelines/templates/jobs/archetype-sdk-client.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ parameters:
88
- name: ArtifactName
99
type: string
1010
default: packages
11+
- name: SDKType
12+
type: string
13+
default: client
1114
- name: ServiceDirectory
1215
type: string
1316
default: not-specified
@@ -23,9 +26,6 @@ parameters:
2326
- name: LinuxPool
2427
type: string
2528
default: azsdk-pool-mms-ubuntu-1804-general
26-
- name: ExcludeProjects
27-
type: object
28-
default: []
2929

3030
jobs:
3131
- job: Build
@@ -66,9 +66,9 @@ jobs:
6666
- template: /eng/pipelines/templates/steps/install-dotnet.yml
6767
- script: >-
6868
dotnet pack eng/service.proj -warnaserror
69+
/p:SDKType=${{ parameters.SDKType }}
6970
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
7071
/p:IncludeTests=false
71-
/p:ExcludeProjects="${{ join('|', parameters.ExcludeProjects) }}"
7272
/p:PublicSign=false $(VersioningProperties)
7373
/p:Configuration=$(BuildConfiguration)
7474
/p:CommitSHA=$(Build.SourceVersion)
@@ -134,8 +134,8 @@ jobs:
134134
inputs:
135135
filePath: "eng/scripts/CodeChecks.ps1"
136136
arguments: >
137-
-ServiceDirectory ${{parameters.ServiceToTest}}
138-
-ExcludeProjects "${{ join('|', parameters.ExcludeProjects) }}"
137+
-ServiceDirectory ${{ parameters.ServiceToTest }}
138+
-SDKType ${{ parameters.SDKType }}
139139
pwsh: true
140140
failOnStderr: false
141141
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
@@ -195,11 +195,11 @@ jobs:
195195
- script: >-
196196
dotnet test eng/service.proj --filter "(TestCategory!=Manually) & (TestCategory!=Live)" --framework $(TestTargetFramework)
197197
--logger "trx;LogFileName=$(TestTargetFramework).trx" --logger:"console;verbosity=normal"
198-
/p:ServiceDirectory=${{parameters.ServiceToTest}}
198+
/p:SDKType=${{ parameters.SDKType }}
199+
/p:ServiceDirectory=${{ parameters.ServiceToTest }}
199200
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false
200-
/p:ExcludeProjects="${{ join('|', parameters.ExcludeProjects) }}"
201201
/p:Configuration=$(BuildConfiguration) $(ConvertToProjectReferenceOption)
202-
/p:CollectCoverage=$(CollectCoverage) /p:CodeCoverageDirectory=${{parameters.ServiceDirectory}}
202+
/p:CollectCoverage=$(CollectCoverage) /p:CodeCoverageDirectory=${{ parameters.ServiceDirectory }}
203203
displayName: "Build & Test ($(TestTargetFramework))"
204204
env:
205205
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1

eng/pipelines/templates/jobs/archetype-sdk-tests-jobs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ parameters:
2020
- name: Location
2121
type: string
2222
default: ''
23+
- name: SDKType
24+
type: string
25+
default: client
2326
- name: ServiceDirectory
2427
type: string
2528
default: not-specified
26-
- name: ExcludeProjects
27-
type: object
28-
default: []
2929
- name: TestSetupSteps
3030
type: stepList
3131
default: []
@@ -95,10 +95,10 @@ jobs:
9595
--filter "TestCategory!=Manually"
9696
--logger "trx"
9797
--logger:"console;verbosity=normal"
98+
/p:SDKType=${{ parameters.SDKType }}
9899
/p:ServiceDirectory=${{ parameters.ServiceDirectory }}
99100
/p:IncludeSrc=false /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false
100101
/p:BuildInParallel=${{ parameters.BuildInParallel }}
101-
/p:ExcludeProjects="${{ join('|', parameters.ExcludeProjects) }}"
102102
$(AdditionalTestArguments)
103103
104104
displayName: "Build & Test (all tests for $(TestTargetFramework))"

eng/pipelines/templates/stages/archetype-sdk-client.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ parameters:
1515
- name: ArtifactName
1616
type: string
1717
default: packages
18+
- name: SDKType
19+
type: string
20+
default: client
1821
- name: ServiceDirectory
1922
type: string
2023
default: not-specified
21-
- name: ExcludeProjects
22-
type: object
23-
default: []
2424
- name: ServiceToTest
2525
type: string
2626
default: ''
@@ -45,9 +45,9 @@ stages:
4545
jobs:
4646
- template: ../jobs/archetype-sdk-client.yml
4747
parameters:
48+
SDKType: ${{ parameters.SDKType }}
4849
ServiceToTest: ${{ coalesce(parameters.ServiceToTest, parameters.ServiceDirectory) }}
4950
ServiceDirectory: ${{ parameters.ServiceDirectory }}
50-
ExcludeProjects: ${{ parameters.ExcludeProjects }}
5151
Artifacts: ${{ parameters.Artifacts }}
5252
TestPipeline: ${{ parameters.TestPipeline }}
5353
ArtifactName: packages
@@ -59,6 +59,7 @@ stages:
5959
- ${{if and(ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal'))}}:
6060
- template: archetype-net-release.yml
6161
parameters:
62+
SDKType: ${{ parameters.SDKType }}
6263
ServiceDirectory: ${{ parameters.ServiceDirectory }}
6364
DependsOn: Build
6465
Artifacts: ${{ parameters.Artifacts }}

eng/pipelines/templates/stages/archetype-sdk-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ parameters:
2929
- name: Location
3030
type: string
3131
default: ''
32+
- name: SDKType
33+
type: string
34+
default: client
3235
- name: ServiceDirectory
3336
type: string
3437
default: not-specified
35-
- name: ExcludeProjects
36-
type: object
37-
default: []
3838
- name: TestSetupSteps
3939
type: stepList
4040
default: []
@@ -133,8 +133,8 @@ stages:
133133
BuildInParallel: ${{ parameters.BuildInParallel }}
134134
TimeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
135135
Location: ${{ parameters.Location }}
136+
SDKType: ${{ parameters.SDKType }}
136137
ServiceDirectory: ${{ parameters.ServiceDirectory }}
137-
ExcludeProjects: ${{ parameters.ExcludeProjects }}
138138
TestSetupSteps: ${{ parameters.TestSetupSteps }}
139139
Platforms:
140140
# Enumerate platforms and additional platforms based on supported clouds (sparse platform<-->cloud matrix).

eng/scripts/CodeChecks.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ param (
99
[string] $ProjectDirectory,
1010

1111
[Parameter()]
12-
[string] $ExcludeProjects
12+
[string] $SDKType = "client"
1313
)
1414

1515
$ErrorActionPreference = 'Stop'
@@ -76,7 +76,7 @@ try {
7676

7777
Write-Host "Re-generating clients"
7878
Invoke-Block {
79-
& dotnet msbuild $PSScriptRoot\..\service.proj /restore /t:GenerateCode /p:ServiceDirectory=$ServiceDirectory /p:ExcludeProjects="$ExcludeProjects"
79+
& dotnet msbuild $PSScriptRoot\..\service.proj /restore /t:GenerateCode /p:SDKType=$SDKType /p:ServiceDirectory=$ServiceDirectory
8080

8181
# https://github.com/Azure/azure-sdk-for-net/issues/8584
8282
# & $repoRoot\storage\generate.ps1
@@ -90,7 +90,7 @@ try {
9090

9191
Write-Host "Re-generating listings"
9292
Invoke-Block {
93-
& $PSScriptRoot\Export-API.ps1 -ServiceDirectory $ServiceDirectory -ExcludeProjects "$ExcludeProjects"
93+
& $PSScriptRoot\Export-API.ps1 -ServiceDirectory $ServiceDirectory -SDKType $SDKType
9494
}
9595

9696
if (-not $ProjectDirectory)

eng/scripts/Export-API.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ param (
33
[Parameter(Position=0)]
44
[ValidateNotNullOrEmpty()]
55
[string] $ServiceDirectory,
6-
[string] $ExcludeProjects
6+
[string] $SDKType = "client"
77
)
88

99
$servicesProj = Resolve-Path "$PSScriptRoot/../service.proj"
1010

11-
dotnet build /p:GenerateApiListingOnBuild=true /p:RunApiCompat=false /p:GeneratePackageOnBuild=false /p:Configuration=Release /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeTests=false /p:Scope="$ServiceDirectory" /p:ExcludeProjects="$ExcludeProjects" /restore $servicesProj
11+
dotnet build /p:GenerateApiListingOnBuild=true /p:RunApiCompat=false /p:GeneratePackageOnBuild=false /p:Configuration=Release /p:IncludeSamples=false /p:IncludePerf=false /p:IncludeStress=false /p:IncludeTests=false /p:Scope="$ServiceDirectory" /p:SDKType=$SDKType /restore $servicesProj

eng/service.proj

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
<IncludeStress Condition="'$(IncludeStress)' == ''">true</IncludeStress>
1010
<IncludeSamplesApplications Condition="'$(IncludeSamplesApplications)' == ''">true</IncludeSamplesApplications>
1111
<IncludeSamplesApplications Condition="'$(ServiceDirectory)' != '*' or '$(IncludeSamples)' == 'false'">false</IncludeSamplesApplications>
12-
<ExcludeProjectsDelimiter Condition="'$(ExcludeProjectsDelimiter)' == ''">|</ExcludeProjectsDelimiter>
1312
<TraversalGlobalProperties>
1413
CodeCoverageDirectory=$([System.IO.Path]::GetFullPath("$(CodeCoverageDirectory)", "$(MSBuildThisFileDirectory)..\sdk"));
1514
</TraversalGlobalProperties>
@@ -31,15 +30,6 @@
3130
<ProjectReference Include="@(SrcProjects)" Exclude="@(MgmtExcludePaths)" Condition="'$(IncludeSrc)' == 'true'" />
3231
</ItemGroup>
3332

34-
<!--
35-
Override project inclusions and force removal of those that have been explicitly excluded by the associated parameter.
36-
Assume each item identifies a project name under the service directory and build the appropriate path mask.
37-
-->
38-
<ItemGroup Condition="'$(ExcludeProjects)' != ''">
39-
<_ExcludePathsSource Include="$(ExcludeProjects.Split('$(ExcludeProjectsDelimiter)'))" />
40-
<ProjectReference Remove="@(_ExcludePathsSource -> '$(MSBuildThisFileDirectory)..\sdk\$(ServiceDirectory)\%(Identity)\**\*.csproj')" />
41-
</ItemGroup>
42-
4333
<Import Project="..\sdk\$(ServiceDirectory)\*.projects" />
4434

4535
<Target Name="CheckProjects" AfterTargets="Build">

sdk/eventhub/ci.data.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
2+
3+
trigger:
4+
branches:
5+
include:
6+
- master
7+
- hotfix/*
8+
- release/*
9+
paths:
10+
include:
11+
- sdk/eventhub/ci.data.yml
12+
- sdk/eventhub/Microsoft.Azure.EventHubs
13+
- sdk/eventhub/Microsoft.Azure.EventHubs.Processor
14+
- sdk/eventhub/Microsoft.Azure.EventHubs.ServiceFabricProcessor
15+
16+
pr:
17+
branches:
18+
include:
19+
- master
20+
- feature/*
21+
- hotfix/*
22+
- release/*
23+
paths:
24+
include:
25+
- sdk/eventhub/ci.data.yml
26+
- sdk/eventhub/Microsoft.Azure.EventHubs
27+
- sdk/eventhub/Microsoft.Azure.EventHubs.Processor
28+
- sdk/eventhub/Microsoft.Azure.EventHubs.ServiceFabricProcessor
29+
30+
extends:
31+
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
32+
parameters:
33+
SdkType: data
34+
ServiceDirectory: eventhub
35+
ArtifactName: packages
36+
Artifacts:
37+
- name: Microsoft.Azure.EventHubs
38+
safeName: MicrosoftAzureEventHubs
39+
- name: Microsoft.Azure.EventHubs.Processor
40+
safeName: MicrosoftAzureEventHubsProcessor
41+
- name: Microsoft.Azure.EventHubs.ServiceFabricProcessor
42+
safeName: MicrosoftAzureEventHubsServiceFabricProcessor

sdk/eventhub/ci.legacy.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.

sdk/eventhub/ci.mgmt.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
2+
3+
trigger:
4+
branches:
5+
include:
6+
- master
7+
- hotfix/*
8+
- release/*
9+
paths:
10+
include:
11+
- sdk/eventhub/ci.mgmt.yml
12+
- sdk/eventhub/Azure.ResourceManager.EventHubs
13+
14+
pr:
15+
branches:
16+
include:
17+
- master
18+
- feature/*
19+
- hotfix/*
20+
- release/*
21+
paths:
22+
include:
23+
- sdk/eventhub/ci.mgmt.yml
24+
- sdk/eventhub/Azure.ResourceManager.EventHubs
25+
26+
extends:
27+
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
28+
parameters:
29+
SdkType: mgmtclient
30+
ServiceDirectory: eventhub
31+
ArtifactName: packages
32+
Artifacts:
33+
- name: Azure.ResourceManager.EventHubs
34+
safeName: AzureResourceManagerEventHubs
35+

0 commit comments

Comments
 (0)