Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions tools/pipelines/templates/build-npm-client-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ extends:
# Install all dependencies, not just the root ones
dependencyInstallCommand: pnpm install --frozen-lockfile

# Install / Build / Test Stage
# Build Stage
- stage: build
displayName: Build Stage
displayName: Build
dependsOn: [] # this stage doesn't depend on preceding stage
jobs:
# Job - Build
Expand Down Expand Up @@ -591,9 +591,14 @@ extends:
sbomEnabled: false
publishLocation: pipeline

# Verification Stage
- stage: verification
displayName: Verification
dependsOn:
- build
jobs:
- job: Coverage_tests
displayName: "Coverage tests"
dependsOn: build
variables:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- name: targetBranchName
Expand All @@ -608,7 +613,7 @@ extends:
- name: ONEES_ENFORCED_CODEQL_ENABLED
value: 'false'
- name: COMMIT_SHA
value: $[ dependencies.build.outputs['setCommitSHA.COMMIT_SHA'] ]
value: $[ stageDependencies.build.build.outputs['setCommitSHA.COMMIT_SHA'] ]

steps:
# Setup
Expand Down Expand Up @@ -766,7 +771,6 @@ extends:
- ${{ each test in parameters.taskTest }}:
- job: Test_${{ test.jobName }}
displayName: "Run Task Test ${{ test.jobName }}"
dependsOn: build
variables:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- name: targetBranchName
Expand All @@ -781,7 +785,7 @@ extends:
- name: ONEES_ENFORCED_CODEQL_ENABLED
value: 'false'
- name: COMMIT_SHA
value: $[ dependencies.build.outputs['setCommitSHA.COMMIT_SHA'] ]
value: $[ stageDependencies.build.build.outputs['setCommitSHA.COMMIT_SHA'] ]
steps:
# Setup
- checkout: self
Expand Down Expand Up @@ -911,7 +915,11 @@ extends:
- template: /tools/pipelines/templates/upload-telemetry/include-stage-upload-telemetry.yml@self
parameters:
dependsOn:
- build
# This also depends on build stage transitively.
- verification
Comment thread
jason-ha marked this conversation as resolved.
# Run when verification skipped to be sure to pick up build stage telemetry
# (including when build failure causes verification to be skipped).
runOnSkippedDependencies: true
telemetryDescription: 'stage_timing'
telemetry_upload_steps:
- template: /tools/pipelines/templates/upload-telemetry/include-steps-upload-stage-timing.yml@self
Expand All @@ -921,7 +929,7 @@ extends:
pipelineIdentifierForTelemetry: BuildClient

# Upload bundle size telemetry in a separate stage that only depends on the build stage,
# so it isn't blocked by publish stage failures. Only runs on the internal project where
# so it isn't blocked by verification stage failures. Only runs on the internal project where
# ff_pipeline_host is available.
- ${{ if and(eq(parameters.telemetry, true), eq(parameters.taskBundleAnalysis, true), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['System.TeamProject'], 'internal')) }}:
- template: /tools/pipelines/templates/upload-telemetry/include-stage-upload-telemetry.yml@self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ parameters:
type: object
default: []

# Whether to upload telemetry when a dependency is skipped. Canceled pipelines remain excluded.
# Use this when multiple stages are involved (especially if one might not run if prior fails)
# and telemetry is still desired for failures (which is commonly the case).
- name: runOnSkippedDependencies
type: boolean
default: false

# The steps to take after configuring for telemetry upload
- name: telemetry_upload_steps
type: stepList
Expand All @@ -28,7 +35,10 @@ stages:
displayName: Upload telemetry to Kusto ('${{ parameters.telemetryDescription }}')
# Run for all possible pipeline triggers except manual
# (manual runs tend to be for testing and can fail repeatedly, we don't want that creating incidents)
condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'Manual'))
${{ if parameters.runOnSkippedDependencies }}:
condition: and(not(canceled()), ne(variables['Build.Reason'], 'Manual'))
${{ else }}:
condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'Manual'))
dependsOn:
- ${{ each stage in parameters.dependsOn }}:
- ${{ stage }}
Expand Down
Loading