Skip to content

Commit 4254568

Browse files
authored
Add 1es-redirect template. Support template validation canary runs (#34994)
1 parent b8bc89c commit 4254568

File tree

6 files changed

+48
-125
lines changed

6 files changed

+48
-125
lines changed

eng/pipelines/templates/stages/1es-redirect.yml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ resources:
44
type: git
55
name: 1ESPipelineTemplates/1ESPipelineTemplates
66
ref: refs/tags/release
7-
- repository: azure-sdk-build-tools
7+
- repository: 1ESPipelineTemplatesCanary
88
type: git
9-
name: internal/azure-sdk-build-tools
10-
ref: refs/tags/azure-sdk-build-tools_20240320.1
9+
name: 1ESPipelineTemplates/1ESPipelineTemplates
10+
ref: refs/tags/canary
1111

1212
parameters:
1313
- name: stages
@@ -16,9 +16,16 @@ parameters:
1616
- name: Use1ESOfficial
1717
type: boolean
1818
default: true
19+
- name: oneESTemplateTag
20+
type: string
21+
default: release
1922

2023
extends:
21-
${{ if and(parameters.Use1ESOfficial, eq(variables['System.TeamProject'], 'internal')) }}:
24+
${{ if and(parameters.Use1ESOfficial, eq(parameters.oneESTemplateTag, 'canary')) }}:
25+
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplatesCanary
26+
${{ elseif eq(parameters.oneESTemplateTag, 'canary') }}:
27+
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplatesCanary
28+
${{ elseif and(parameters.Use1ESOfficial, eq(variables['System.TeamProject'], 'internal')) }}:
2229
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
2330
${{ else }}:
2431
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
@@ -30,18 +37,20 @@ extends:
3037
name: azsdk-pool-mms-win-2022-general
3138
image: azsdk-pool-mms-win-2022-1espt
3239
os: windows
33-
sourceRepositoriesToScan:
34-
exclude:
35-
- repository: azure-sdk-build-tools
40+
eslint:
41+
enabled: false
42+
justificationForDisabling: "ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azur 19 e-sdk/internal/_build/results?buildId=3556850"
43+
codeql:
44+
compiled:
45+
enabled: false
46+
justificationForDisabling: "CodeQL times our pipelines out by running for 2+ hours before being force canceled."
3647
credscan:
3748
suppressionsFile: '$(Build.SourcesDirectory)/eng/CredScanSuppression.json'
3849
toolVersion: '2.3.12.23'
3950
baselineFiles: $(Build.SourcesDirectory)/eng/python.gdnbaselines
40-
eslint:
41-
enabled: false
42-
justificationForDisabling: "ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3556850"
4351
psscriptanalyzer:
4452
compiled: true
4553
break: true
4654
policy: M365
55+
4756
stages: ${{ parameters.stages }}

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

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
resources:
2-
repositories:
3-
- repository: 1ESPipelineTemplates
4-
type: git
5-
name: 1ESPipelineTemplates/1ESPipelineTemplates
6-
ref: refs/tags/release
7-
81
parameters:
92
- name: ServiceDirectory
103
type: string
@@ -82,40 +75,18 @@ parameters:
8275
- name: AdvancedBuild
8376
type: boolean
8477
default: false
78+
- name: oneESTemplateTag
79+
type: string
80+
default: release
8581

8682
extends:
87-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
88-
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
89-
${{ else }}:
90-
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
83+
template: /eng/pipelines/templates/stages/1es-redirect.yml
9184
parameters:
92-
settings:
93-
skipBuildTagsForGitHubPullRequests: true
94-
sdl:
95-
sourceAnalysisPool:
96-
name: azsdk-pool-mms-win-2022-general
97-
image: azsdk-pool-mms-win-2022-1espt
98-
os: windows
99-
eslint:
100-
enabled: false
101-
justificationForDisabling: "ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3556850"
102-
codeql:
103-
compiled:
104-
enabled: false
105-
justificationForDisabling: "CodeQL times our pipelines out by running for 2+ hours before being force canceled."
106-
psscriptanalyzer:
107-
enabled: true
108-
break: true
109-
policy: M365
110-
credscan:
111-
suppressionsFile: '$(Build.SourcesDirectory)/eng/CredScanSuppression.json'
112-
scanFolder: '$(Build.SourcesDirectory)/credscan.tsv'
113-
toolVersion: '2.3.12.23'
114-
baselineFiles: $(Build.SourcesDirectory)/eng/python.gdnbaselines
85+
oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
11586
stages:
11687
- stage: Build
11788
jobs:
118-
- template: /eng/pipelines/templates/jobs/ci.yml@self
89+
- template: /eng/pipelines/templates/jobs/ci.yml
11990
parameters:
12091
ServiceDirectory: ${{ parameters.ServiceDirectory }}
12192
Artifacts: ${{ parameters.Artifacts }}
@@ -145,10 +116,10 @@ extends:
145116
AdvancedBuild: ${{ parameters.AdvancedBuild }}
146117

147118
variables:
148-
- template: /eng/pipelines/templates/variables/globals.yml@self
149-
- template: /eng/pipelines/templates/variables/image.yml@self
119+
- template: /eng/pipelines/templates/variables/globals.yml
120+
- template: /eng/pipelines/templates/variables/image.yml
150121

151-
- template: archetype-python-release.yml@self
122+
- template: archetype-python-release.yml
152123
parameters:
153124
DependsOn: "Build"
154125
ServiceDirectory: ${{ parameters.ServiceDirectory }}
@@ -161,4 +132,3 @@ extends:
161132
TargetDocRepoName: ${{ parameters.TargetDocRepoName }}
162133
DevFeedName: ${{ parameters.DevFeedName }}
163134

164-

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

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
resources:
2-
repositories:
3-
- repository: 1ESPipelineTemplates
4-
type: git
5-
name: 1ESPipelineTemplates/1ESPipelineTemplates
6-
ref: refs/tags/release
7-
81
parameters:
92
- name: ServiceDirectory
103
type: string
@@ -108,36 +101,9 @@ parameters:
108101

109102

110103
extends:
111-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
112-
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
113-
${{ else }}:
114-
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
104+
template: /eng/pipelines/templates/stages/1es-redirect.yml
115105
parameters:
116-
settings:
117-
skipBuildTagsForGitHubPullRequests: true
118-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
119-
sdl:
120-
sourceAnalysisPool:
121-
name: azsdk-pool-mms-win-2022-general
122-
image: azsdk-pool-mms-win-2022-1espt
123-
os: windows
124-
eslint:
125-
enabled: false
126-
justificationForDisabling: 'ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3499746'
127-
codeql:
128-
compiled:
129-
enabled: false
130-
justificationForDisabling: CodeQL times our pipelines out by running for 2+ hours before being force canceled.
131-
psscriptanalyzer:
132-
compiled: true
133-
break: true
134-
policy: M365
135-
credscan:
136-
suppressionsFile: $(Build.SourcesDirectory)/eng/CredScanSuppression.json
137-
scanFolder: $(Build.SourcesDirectory)/credscan.tsv
138-
toolVersion: 2.3.12.23
139-
baselineFiles: $(Build.SourcesDirectory)/eng/<language>.gdnbaselines
140-
106+
Use1ESOfficial: false
141107
stages:
142108
- ${{ if ne(length(parameters.Packages), 0) }}:
143109
- ${{ each package in parameters.Packages }}:
@@ -147,7 +113,7 @@ extends:
147113
- stage: ${{ cloud.key }}_${{ parameters.JobName }}_${{ replace(package, '-', '_') }}
148114
dependsOn: []
149115
jobs:
150-
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml@self
116+
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
151117
parameters:
152118
SparseCheckoutPaths:
153119
- sdk/${{ parameters.ServiceDirectory }}/**/*.json
@@ -201,7 +167,7 @@ extends:
201167
- stage: ${{ cloud.key }}_${{ parameters.JobName }}
202168
dependsOn: []
203169
jobs:
204-
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml@self
170+
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
205171
parameters:
206172
SparseCheckoutPaths:
207173
- sdk/${{ parameters.ServiceDirectory }}/**/*.json
@@ -248,7 +214,7 @@ extends:
248214
SubscriptionConfigurations: ${{ cloud.value.SubscriptionConfigurations }}
249215
Location: ${{ coalesce(parameters.Location, cloud.value.Location) }}
250216
Cloud: ${{ cloud.key }}
251-
- template: /eng/pipelines/templates/stages/python-analyze-weekly.yml@self
217+
- template: /eng/pipelines/templates/stages/python-analyze-weekly.yml
252218
parameters:
253219
BuildTargetingString: ${{ parameters.BuildTargetingString }}
254220
ServiceDirectory: ${{ parameters.ServiceDirectory }}

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

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
resources:
2-
repositories:
3-
- repository: 1ESPipelineTemplates
4-
type: git
5-
name: 1ESPipelineTemplates/1ESPipelineTemplates
6-
ref: refs/tags/release
7-
81
parameters:
92
- name: release_msrest
103
displayName: 'msrest'
@@ -144,34 +137,8 @@ parameters:
144137
default: true
145138

146139
extends:
147-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
148-
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
149-
${{ else }}:
150-
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
140+
template: /eng/pipelines/templates/stages/1es-redirect.yml
151141
parameters:
152-
${{ if eq(variables['System.TeamProject'], 'internal') }}:
153-
sdl:
154-
sourceAnalysisPool:
155-
name: azsdk-pool-mms-win-2022-1es-pt
156-
image: azsdk-pool-mms-win-2022-1espt
157-
os: windows
158-
eslint:
159-
enabled: false
160-
justificationForDisabling: 'ESLint injected task has failures because it uses an old version of mkdirp. We should not fail for tools not controlled by the repo. See: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=3499746'
161-
codeql:
162-
compiled:
163-
enabled: false
164-
justificationForDisabling: CodeQL times our pipelines out by running for 2+ hours before being force canceled.
165-
psscriptanalyzer:
166-
compiled: true
167-
break: true
168-
policy: M365
169-
credscan:
170-
suppressionsFile: $(Build.SourcesDirectory)/eng/CredScanSuppression.json
171-
scanFolder: $(Build.SourcesDirectory)/credscan.tsv
172-
toolVersion: 2.3.12.23
173-
baselineFiles: $(Build.SourcesDirectory)/eng/python.gdnbaselines
174-
175142
stages:
176143
- stage: Build_Dependencies
177144
displayName: Build Platform-Specific Binary Conda Packages

eng/pipelines/templates/stages/python-analyze-weekly-standalone.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ parameters:
1010
default: 'Test'
1111

1212
extends:
13-
template: /eng/pipelines/templates/stages/1es-redirect.yml@self
13+
template: /eng/pipelines/templates/stages/1es-redirect.yml
1414
parameters:
1515
stages:
1616
- ${{ if contains(variables['Build.DefinitionName'], 'tests-weekly') }}:
@@ -25,7 +25,7 @@ extends:
2525

2626
variables:
2727
- name: PythonVersion
28-
value: '3.8'
28+
value: '3.8'
2929

3030
pool:
3131
name: $(LINUXPOOL)
@@ -111,7 +111,7 @@ extends:
111111
scriptPath: 'scripts/devops_tasks/dispatch_tox.py'
112112
arguments: >-
113113
${{ parameters.BuildTargetingString }}
114-
--service="${{ parameters.ServiceDirectory }}"
114+
--service="${{ parameters.ServiceDirectory }}"
115115
--toxenv="strict-sphinx"
116116
env:
117117
GH_TOKEN: $(azuresdk-github-pat)

sdk/template/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,20 @@ pr:
3030
# eng/common code changes trigger template pipeline for basic checking.
3131
- eng/common/
3232

33+
parameters:
34+
# Switch to canary to test canary 1es branch. 1es template validation will set this parameter
35+
# to canary on run.
36+
- name: oneESTemplateTag
37+
type: string
38+
default: release
39+
values:
40+
- release
41+
- canary
42+
3343
extends:
3444
template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml
3545
parameters:
46+
oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
3647
ServiceDirectory: template
3748
ValidateFormatting: true
3849
Artifacts:

0 commit comments

Comments
 (0)