Skip to content

Commit

Permalink
Support template validation canary runs (#22649)
Browse files Browse the repository at this point in the history
  • Loading branch information
benbp committed Mar 29, 2024
1 parent 40d2675 commit cd77088
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 38 deletions.
36 changes: 5 additions & 31 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release

parameters:
- name: ServiceDirectory
type: string
Expand Down Expand Up @@ -87,33 +80,14 @@ parameters:
- name: AdditionalStages
type: object
default: []
- name: oneESTemplateTag
type: string
default: release

extends:
${{ if eq(variables['System.TeamProject'], 'internal') }}:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
${{ else }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
template: /eng/pipelines/templates/stages/1es-redirect.yml
parameters:
settings:
skipBuildTagsForGitHubPullRequests: true
sdl:
sourceAnalysisPool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
os: windows
sourceRepositoriesToScan:
exclude:
- repository: azure-sdk-build-tools
eslint:
enabled: false
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&"
psscriptanalyzer:
compiled: true
break: true
policy: M365
credscan:
toolVersion: '2.3.12.23'
suppressionsFile: '$(Build.SourcesDirectory)/eng/CredScanSuppression.json'
oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
stages:
- stage: Build
variables:
Expand Down
18 changes: 11 additions & 7 deletions eng/pipelines/templates/stages/1es-redirect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ resources:
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
- repository: azure-sdk-build-tools
- repository: 1ESPipelineTemplatesCanary
type: git
name: internal/azure-sdk-build-tools
ref: refs/tags/azure-sdk-build-tools_20240320.1
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/canary

parameters:
- name: stages
Expand All @@ -16,9 +16,16 @@ parameters:
- name: Use1ESOfficial
type: boolean
default: true
- name: oneESTemplateTag
type: string
default: release

extends:
${{ if and(parameters.Use1ESOfficial, eq(variables['System.TeamProject'], 'internal')) }}:
${{ if and(parameters.Use1ESOfficial, eq(parameters.oneESTemplateTag, 'canary')) }}:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplatesCanary
${{ elseif eq(parameters.oneESTemplateTag, 'canary') }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplatesCanary
${{ elseif and(parameters.Use1ESOfficial, eq(variables['System.TeamProject'], 'internal')) }}:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
${{ else }}:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates
Expand All @@ -30,9 +37,6 @@ extends:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
os: windows
sourceRepositoriesToScan:
exclude:
- repository: azure-sdk-build-tools
credscan:
suppressionsFile: '$(Build.SourcesDirectory)/eng/CredScanSuppression.json'
toolVersion: '2.3.12.23'
Expand Down
10 changes: 10 additions & 0 deletions sdk/template/aztemplate/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@ pr:
- sdk/template/aztemplate/
- eng/

parameters:
# Switch to canary to test canary 1es branch. 1es template validation will set this parameter
# to canary on run.
- name: oneESTemplateTag
type: string
default: release
values:
- release
- canary

extends:
template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml
parameters:
oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
ServiceDirectory: 'template/aztemplate'

0 comments on commit cd77088

Please sign in to comment.