Skip to content

Commit ecbebf5

Browse files
scbeddbenbp
andauthored
1ES Template Conversion (#28848)
- convert pipelines to 1es-templates from all entrypoints. specifically archetype-sdk-tests, archetype-sdk-client, and cosmos-sdk-client. - Move all image selection (outside of release deployments) to honor env variables instead of manually writing the pool (similar patterns for all other platforms) Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
1 parent c49462c commit ecbebf5

20 files changed

Lines changed: 740 additions & 544 deletions

File tree

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ parameters:
1111
- name: Matrix
1212
type: string
1313
- name: DependsOn
14-
type: string
15-
default: ''
14+
type: object
15+
default: []
1616
- name: UsePlatformContainer
1717
type: boolean
1818
default: false
1919
- name: CloudConfig
2020
type: object
2121
default: {}
22+
- name: OSName
23+
type: string
24+
default: ''
2225

2326
jobs:
2427
- job:
@@ -39,10 +42,16 @@ jobs:
3942

4043
pool:
4144
name: $(Pool)
42-
vmImage: $(OSVmImage)
43-
${{ if eq(parameters.UsePlatformContainer, 'true') }}:
44-
# Add a default so the job doesn't fail when the matrix is empty
45-
container: $[ variables['Container'] ]
45+
# 1es pipeline templates converts `image` to demands: ImageOverride under the hood
46+
# which is incompatible with image selection in the default non-1es hosted pools
47+
${{ if eq(parameters.OSName, 'macOS') }}:
48+
vmImage: $(OSVmImage)
49+
${{ else }}:
50+
image: $(OSVmImage)
51+
os: ${{ parameters.OSName }}
52+
${{ if eq(parameters.UsePlatformContainer, 'true') }}:
53+
# Add a default so the job doesn't fail when the matrix is empty
54+
container: $[ variables['Container'] ]
4655

4756
variables:
4857
- template: ../variables/globals.yml
@@ -55,3 +64,4 @@ jobs:
5564
Artifacts: ${{ parameters.Artifacts }}
5665
ServiceDirectory: ${{ parameters.ServiceDirectory }}
5766
TestProxy: ${{ parameters.TestProxy }}
67+
OSName: ${{ parameters.OSName }}

eng/pipelines/templates/jobs/ci.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ parameters:
2828

2929
jobs:
3030
- job: "Build"
31-
variables:
32-
Codeql.Enabled: true
33-
Codeql.BuildIdentifier: ${{ parameters.ServiceDirectory }}
34-
Codeql.SkipTaskAutoInjection: false
3531

3632
pool:
37-
name: azsdk-pool-mms-ubuntu-2004-general
38-
vmImage: MMSUbuntu20.04
33+
name: $(LINUXPOOL)
34+
image: $(LINUXVMIMAGE)
35+
os: linux
3936

4037
steps:
4138
- script: |
@@ -55,8 +52,9 @@ jobs:
5552
- job: "Analyze"
5653

5754
pool:
58-
name: azsdk-pool-mms-ubuntu-2004-general
59-
vmImage: MMSUbuntu20.04
55+
name: $(LINUXPOOL)
56+
image: $(LINUXVMIMAGE)
57+
os: linux
6058

6159
steps:
6260
- template: ../steps/common.yml
@@ -67,19 +65,12 @@ jobs:
6765
ServiceDirectory: ${{ parameters.ServiceDirectory }}
6866
TestPipeline: ${{ parameters.TestPipeline }}
6967

70-
- job: Compliance
71-
pool:
72-
name: azsdk-pool-mms-win-2022-general
73-
vmImage: MMS2022
74-
steps:
75-
- template: /eng/common/pipelines/templates/steps/credscan.yml
76-
parameters:
77-
ServiceDirectory: ${{ parameters.ServiceDirectory }}
78-
7968
- ${{ if ne(parameters.RunUnitTests, false) }}:
80-
- template: /eng/common/pipelines/templates/jobs/archetype-sdk-tests-generate.yml
69+
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
8170
parameters:
8271
JobTemplatePath: /eng/pipelines/templates/jobs/ci.tests.yml
72+
OsVmImage: $(LINUXVMIMAGE)
73+
Pool: $(LINUXPOOL)
8374
MatrixConfigs: ${{ parameters.MatrixConfigs }}
8475
MatrixFilters: ${{ parameters.MatrixFilters }}
8576
MatrixReplace: ${{ parameters.MatrixReplace }}

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

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ parameters:
4040
- name: UsePlatformContainer
4141
type: boolean
4242
default: false
43-
43+
- name: OSName
44+
type: string
4445

4546
jobs:
4647
- job:
@@ -57,7 +58,13 @@ jobs:
5758

5859
pool:
5960
name: $(Pool)
60-
vmImage: $(OSVmImage)
61+
# 1es pipeline templates converts `image` to demands: ImageOverride under the hood
62+
# which is incompatible with image selection in the default non-1es hosted pools
63+
${{ if eq(parameters.OSName, 'macOS') }}:
64+
vmImage: $(OSVmImage)
65+
${{ else }}:
66+
image: $(OSVmImage)
67+
os: ${{ parameters.OSName }}
6168

6269
timeoutInMinutes: ${{ parameters.TimeoutInMinutes }}
6370

@@ -190,13 +197,12 @@ jobs:
190197
codeCoverageTool: Cobertura
191198
summaryFileLocation: "$(PackagePath)/coverage/cobertura-coverage.xml"
192199

193-
- task: PublishPipelineArtifact@1
194-
displayName: "Publish Browser Code Coverage Report Artifact"
195-
continueOnError: true
196-
condition: and(succeededOrFailed(),eq(variables['TestType'], 'browser'),eq(variables['PublishCodeCoverage'], true))
197-
inputs:
198-
path: "$(PackagePath)/coverage-browser"
199-
artifact: BrowserCodeCoverageReport
200+
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
201+
parameters:
202+
ArtifactPath: "$(PackagePath)/coverage-browser"
203+
ArtifactName: BrowserCodeCoverageReport
204+
CustomCondition: and(succeededOrFailed(),eq(variables['TestType'], 'browser'),eq(variables['PublishCodeCoverage'], true))
205+
SbomEnabled: false
200206

201207
# Unlink node_modules folders to significantly improve performance of subsequent tasks
202208
# which need to walk the directory tree (and are hardcoded to follow symlinks).

0 commit comments

Comments
 (0)