Skip to content

Commit

Permalink
Enable autobaselining only for rust - core
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed Feb 18, 2025
1 parent 1936f57 commit 34f3f88
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 4 deletions.
16 changes: 12 additions & 4 deletions eng/pipelines/templates/jobs/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,18 @@ jobs:
additionalComponentDetectorArgs: '--DirectoryExclusionList **/target/vendor/**'

steps:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
paths:
- "/*"
# Pull requests require the target branch ref, but fetchDepth: 1 doesn't fetch additional refs.
# SDL Baselining requires a github token, but sparse checkout doesn't set one.
# Use Sparse Checkout for pull requests and native, shallow checkout for everything else.
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
parameters:
paths:
- "/*"
- ${{ else }}:
- checkout: self
fetchDepth: 1
persistCredentials: true

- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], '')) }}:
- script: |
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/stages/1es-redirect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ parameters:
- name: oneESTemplateTag
type: string
default: release
- name: isMainPipeline
type: boolean

extends:
${{ if and(parameters.Use1ESOfficial, eq(parameters.oneESTemplateTag, 'canary')) }}:
Expand All @@ -36,7 +38,15 @@ extends:
- 1ES.PT.Tag-refs/tags/canary
settings:
skipBuildTagsForGitHubPullRequests: true
# only enable autoBaseline for the internal build of rust-core on main branch
${{ if and(eq(parameters.isMainPipeline, 'true'), eq(variables['Build.SourceBranchName'], 'main'), eq(variables['System.TeamProject'], 'internal')) }}:
featureFlags:
autoBaseline: true
sdl:
${{ if and(eq(parameters.isMainPipeline, 'true'), eq(variables['Build.SourceBranchName'], 'main'), eq(variables['System.TeamProject'], 'internal')) }}:
autoBaseline:
isMainPipeline: true
enableForGitHub: true
sourceAnalysisPool:
name: azsdk-pool-mms-win-2022-general
image: azsdk-pool-mms-win-2022-1espt
Expand Down
4 changes: 4 additions & 0 deletions eng/pipelines/templates/stages/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ parameters:
- name: GenerateApiReviewForManualOnly
type: boolean
default: false
- name: IsMainPipeline
type: boolean
default: false
- name: oneESTemplateTag
type: string
default: release
Expand All @@ -21,6 +24,7 @@ extends:
template: /eng/pipelines/templates/stages/1es-redirect.yml
parameters:
oneESTemplateTag: ${{ parameters.oneESTemplateTag }}
isMainPipeline: ${{ parameters.IsMainPipeline }}
stages:
- stage: Build
variables:
Expand Down
1 change: 1 addition & 0 deletions sdk/core/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ trigger:
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
parameters:
IsMainPipeline: true
ServiceDirectory: core
Artifacts:
- name: azure_core
Expand Down

0 comments on commit 34f3f88

Please sign in to comment.