From 96679207a1933cdf60049d06a4eb1496c52eac9f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:14:36 +0000 Subject: [PATCH 1/2] Make Azure Pipeline conditions cancellable Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com> --- eng/common/TestResources/remove-test-resources.yml | 4 ++-- eng/common/TestResources/setup-environments.yml | 2 +- eng/common/pipelines/templates/jobs/eval-shard.yml | 8 ++++---- .../pipelines/templates/jobs/eval-summarize.yml | 2 +- eng/common/pipelines/templates/jobs/npm-publish.yml | 2 +- eng/common/pipelines/templates/jobs/perf.yml | 10 +++++----- .../stages/archetype-auto-release-prepare.yml | 2 +- .../pipelines/templates/stages/archetype-eval.yml | 2 +- .../templates/steps/create-authenticated-npmrc.yml | 4 ++-- eng/common/pipelines/templates/steps/credscan.yml | 2 +- .../templates/steps/daily-dev-build-variable.yml | 4 ++-- .../pipelines/templates/steps/install-azsdk-cli.yml | 2 +- .../pipelines/templates/steps/publish-artifact.yml | 2 +- .../pipelines/templates/steps/set-default-branch.yml | 2 +- .../pipelines/templates/steps/sparse-checkout.yml | 2 +- .../pipelines/templates/steps/verify-changelog.yml | 2 +- .../pipelines/templates/steps/verify-changelogs.yml | 2 +- .../pipelines/templates/steps/verify-links.yml | 2 +- .../pipelines/templates/steps/verify-path-length.yml | 2 +- .../pipelines/templates/steps/verify-readme.yml | 2 +- .../pipelines/templates/steps/verify-readmes.yml | 4 ++-- eng/pipelines/code-quality-reports.yml | 2 +- eng/pipelines/templates/jobs/ci.tests.yml | 4 ++-- eng/pipelines/templates/jobs/ci.versions.tests.yml | 4 ++-- eng/pipelines/templates/jobs/live.tests.yml | 5 ++--- .../stages/archetype-java-auto-release-batch.yml | 2 +- .../stages/archetype-java-release-batch.yml | 4 ++-- .../stages/archetype-java-release-pom-only.yml | 2 +- .../templates/stages/archetype-sdk-client.yml | 3 +-- eng/pipelines/templates/stages/cosmos-sdk-client.yml | 2 +- .../templates/steps/build-and-test-native.yml | 8 ++++---- eng/pipelines/templates/steps/build-and-test.yml | 10 +++++----- eng/pipelines/templates/steps/install-latest-jdk.yml | 8 ++++---- .../templates/steps/retain-heap-dump-hprofs.yml | 2 +- eng/pipelines/templates/steps/retain-test-logs.yml | 2 +- sdk/cosmos/cleanup-test-resources.yml | 2 +- sdk/cosmos/kafka.yml | 2 +- sdk/spring/pipeline/compatibility-tests-job.yml | 12 ++++++------ 38 files changed, 68 insertions(+), 70 deletions(-) diff --git a/eng/common/TestResources/remove-test-resources.yml b/eng/common/TestResources/remove-test-resources.yml index 611ffc4cf5dd1..bfff4571079c1 100644 --- a/eng/common/TestResources/remove-test-resources.yml +++ b/eng/common/TestResources/remove-test-resources.yml @@ -27,7 +27,7 @@ steps: - ${{ if eq('true', parameters.UseFederatedAuth) }}: - task: AzurePowerShell@5 displayName: Remove test resources - condition: and(eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true')) + condition: and(succeededOrFailed(), eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true')) continueOnError: true env: PoolSubnet: $(PoolSubnet) @@ -71,7 +71,7 @@ steps: -Force ` -Verbose displayName: Remove test resources - condition: and(eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true')) + condition: and(succeededOrFailed(), eq(variables['CI_HAS_DEPLOYED_RESOURCES'], 'true'), ne(variables['Skip.RemoveTestResources'], 'true')) continueOnError: true env: PoolSubnet: $(PoolSubnet) diff --git a/eng/common/TestResources/setup-environments.yml b/eng/common/TestResources/setup-environments.yml index a829b8dadfda8..7ddb523956ca7 100644 --- a/eng/common/TestResources/setup-environments.yml +++ b/eng/common/TestResources/setup-environments.yml @@ -18,7 +18,7 @@ steps: - bash: sudo chown -R runner ~/.Azure displayName: (MacOS) Grant access to ~/.Azure - condition: contains(variables['OSVmImage'], 'mac') + condition: and(succeeded(), contains(variables['OSVmImage'], 'mac')) - task: Powershell@2 displayName: Setup Az Modules and Dogfood Environment diff --git a/eng/common/pipelines/templates/jobs/eval-shard.yml b/eng/common/pipelines/templates/jobs/eval-shard.yml index fc4245111884e..292d3f8917116 100644 --- a/eng/common/pipelines/templates/jobs/eval-shard.yml +++ b/eng/common/pipelines/templates/jobs/eval-shard.yml @@ -53,12 +53,12 @@ jobs: displayName: 'Publish $(shardName) JUnit' artifactName: 'eval-result-$(shardName)-$(System.JobAttempt)' targetPath: $(Build.ArtifactStagingDirectory)/junit - condition: always() + condition: succeededOrFailed() - output: pipelineArtifact displayName: 'Publish $(shardName) transcripts (on failure)' artifactName: 'eval-debug-$(shardName)-$(System.JobAttempt)' targetPath: $(Build.ArtifactStagingDirectory)/debug - condition: failed() + condition: and(succeededOrFailed(), failed()) steps: - checkout: self fetchDepth: 1 @@ -129,7 +129,7 @@ jobs: mkdir -p "$(Build.ArtifactStagingDirectory)/junit" "$(Build.ArtifactStagingDirectory)/debug" find "$(Build.SourcesDirectory)/artifacts/vally-results/$(shardName)" -name '*.junit.xml' -exec cp {} "$(Build.ArtifactStagingDirectory)/junit/" \; displayName: 'Collect $(shardName) JUnit' - condition: always() + condition: succeededOrFailed() # On a real failure keep transcripts; strip JUnit so Summary can't double-count it. - script: | @@ -141,4 +141,4 @@ jobs: find "$dest" -name '*.junit.xml' -delete fi displayName: 'Collect $(shardName) transcripts (on failure)' - condition: failed() + condition: and(succeededOrFailed(), failed()) diff --git a/eng/common/pipelines/templates/jobs/eval-summarize.yml b/eng/common/pipelines/templates/jobs/eval-summarize.yml index 8d9f49d6c8c89..4f299f9e4f58c 100644 --- a/eng/common/pipelines/templates/jobs/eval-summarize.yml +++ b/eng/common/pipelines/templates/jobs/eval-summarize.yml @@ -33,7 +33,7 @@ jobs: --results-root "$(Pipeline.Workspace)/eval-results" \ --output-path "$(Build.ArtifactStagingDirectory)/eval-summary.md" displayName: 'Render Markdown rollup' - condition: always() + condition: succeededOrFailed() - task: PublishTestResults@2 displayName: 'Publish eval rollup' diff --git a/eng/common/pipelines/templates/jobs/npm-publish.yml b/eng/common/pipelines/templates/jobs/npm-publish.yml index e864fab9b0c74..abcf0c8c71533 100644 --- a/eng/common/pipelines/templates/jobs/npm-publish.yml +++ b/eng/common/pipelines/templates/jobs/npm-publish.yml @@ -16,7 +16,7 @@ parameters: jobs: - deployment: ${{ parameters.DeploymentName }} displayName: 'Publish ${{ parameters.ArtifactName }} to ${{ parameters.Registry }}' - condition: ${{ parameters.CustomCondition }} + condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }}) environment: ${{ parameters.Environment }} dependsOn: ${{ parameters.DependsOn }} variables: diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index 2257d783041df..f7f2d270acd49 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -185,31 +185,31 @@ jobs: get-content results.txt workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.txt - condition: always() + condition: succeededOrFailed() - pwsh: | get-content results.csv workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.csv - condition: always() + condition: succeededOrFailed() - pwsh: | get-content results.md workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.md - condition: always() + condition: succeededOrFailed() - pwsh: | get-content results.json workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.json - condition: always() + condition: succeededOrFailed() - task: PublishPipelineArtifact@1 inputs: targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results artifactName: results-${{ parameters.Language }}-$(MatrixName) - condition: always() + condition: succeededOrFailed() - task: PublishPipelineArtifact@1 inputs: diff --git a/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml b/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml index 69e1f99722cb4..5f2fda9bfb3a6 100644 --- a/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml +++ b/eng/common/pipelines/templates/stages/archetype-auto-release-prepare.yml @@ -32,7 +32,7 @@ stages: - stage: AutoReleasePrepare displayName: Auto-release prepare dependsOn: ${{ parameters.DependsOn }} - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) variables: - template: /eng/pipelines/templates/variables/globals.yml - template: /eng/pipelines/templates/variables/image.yml diff --git a/eng/common/pipelines/templates/stages/archetype-eval.yml b/eng/common/pipelines/templates/stages/archetype-eval.yml index 4e29b4c314ce3..a3951a10dd58c 100644 --- a/eng/common/pipelines/templates/stages/archetype-eval.yml +++ b/eng/common/pipelines/templates/stages/archetype-eval.yml @@ -99,7 +99,7 @@ extends: - stage: Summary displayName: 'Summarize results' dependsOn: Eval - condition: always() + condition: succeededOrFailed() jobs: - template: /eng/common/pipelines/templates/jobs/eval-summarize.yml parameters: diff --git a/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml b/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml index 3fa699b387d2d..13efcc0f22f44 100644 --- a/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml +++ b/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml @@ -31,11 +31,11 @@ steps: "registry=${{ parameters.registryUrl }}" | Out-File $npmrcPath Write-Host "##vso[task.setvariable variable=resolvedNpmrcPath]$npmrcPath" displayName: "Create .npmrc" - condition: ${{ parameters.CustomCondition }} + condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }}) - task: npmAuthenticate@0 displayName: Authenticate .npmrc - condition: ${{ parameters.CustomCondition }} + condition: and(succeededOrFailed(), ${{ parameters.CustomCondition }}) inputs: workingFile: $(resolvedNpmrcPath) azureDevOpsServiceConnection: ${{ parameters.ServiceConnection }} diff --git a/eng/common/pipelines/templates/steps/credscan.yml b/eng/common/pipelines/templates/steps/credscan.yml index a85bfca0333a2..7689542063b4e 100644 --- a/eng/common/pipelines/templates/steps/credscan.yml +++ b/eng/common/pipelines/templates/steps/credscan.yml @@ -52,4 +52,4 @@ steps: - pwsh: | Write-Host "Please check https://aka.ms/azsdk/credscan for more information about the cred scan failure." displayName: CredScan troubleshooting guide - condition: and(failed(), ne(variables['SKIP_CREDSCAN'], true)) + condition: and(succeededOrFailed(), failed(), ne(variables['SKIP_CREDSCAN'], true)) diff --git a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml index 3191a4928a273..27965de5fde12 100644 --- a/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml +++ b/eng/common/pipelines/templates/steps/daily-dev-build-variable.yml @@ -16,7 +16,7 @@ steps: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Dump Package properties - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) - pwsh: | $setDailyDevBuild = "false" if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) { @@ -24,4 +24,4 @@ steps: } echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild" displayName: "Setup Versioning Properties" - condition: and(${{ parameters.Condition }}, eq(variables['SetDevVersion'], '')) + condition: and(succeededOrFailed(), ${{ parameters.Condition }}, eq(variables['SetDevVersion'], '')) diff --git a/eng/common/pipelines/templates/steps/install-azsdk-cli.yml b/eng/common/pipelines/templates/steps/install-azsdk-cli.yml index 6d26fc488f032..2c2e0b6db7c53 100644 --- a/eng/common/pipelines/templates/steps/install-azsdk-cli.yml +++ b/eng/common/pipelines/templates/steps/install-azsdk-cli.yml @@ -6,7 +6,7 @@ parameters: steps: - task: Powershell@2 displayName: 'Install Azure SDK Tools CLI' - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) inputs: targetType: 'inline' script: | diff --git a/eng/common/pipelines/templates/steps/publish-artifact.yml b/eng/common/pipelines/templates/steps/publish-artifact.yml index 6e9bdd0f30bd4..325d8a962eca3 100644 --- a/eng/common/pipelines/templates/steps/publish-artifact.yml +++ b/eng/common/pipelines/templates/steps/publish-artifact.yml @@ -20,7 +20,7 @@ steps: path: '${{ parameters.ArtifactPath }}' - task: PublishPipelineArtifact@1 - condition: and(failed(), ${{ parameters.CustomCondition }}) + condition: and(succeededOrFailed(), failed(), ${{ parameters.CustomCondition }}) displayName: 'Publish failed ${{ parameters.ArtifactName }} Artifacts' inputs: artifactName: '${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)' diff --git a/eng/common/pipelines/templates/steps/set-default-branch.yml b/eng/common/pipelines/templates/steps/set-default-branch.yml index 12ec1be317b46..0d5dfab1b1a51 100644 --- a/eng/common/pipelines/templates/steps/set-default-branch.yml +++ b/eng/common/pipelines/templates/steps/set-default-branch.yml @@ -14,5 +14,5 @@ steps: Write-Host "##vso[task.setvariable variable=${{ parameters.DefaultBranchVariableName }}]$setDefaultBranch" displayName: "Setup Default Branch" workingDirectory: ${{ parameters.workingDirectory }} - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) ignoreLASTEXITCODE: true diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index d7f1bc0d12462..2908b2d97ff14 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -144,4 +144,4 @@ steps: - pwsh: | git config unset --global "http.extraheader" displayName: Removing git config auth header - condition: always() + condition: succeededOrFailed() diff --git a/eng/common/pipelines/templates/steps/verify-changelog.yml b/eng/common/pipelines/templates/steps/verify-changelog.yml index 113e0a5e695a7..2061092bb3136 100644 --- a/eng/common/pipelines/templates/steps/verify-changelog.yml +++ b/eng/common/pipelines/templates/steps/verify-changelog.yml @@ -26,5 +26,5 @@ steps: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: Verify ChangeLogEntry for ${{ parameters.PackageName }} - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) continueOnError: false diff --git a/eng/common/pipelines/templates/steps/verify-changelogs.yml b/eng/common/pipelines/templates/steps/verify-changelogs.yml index 5d6cdf26e99af..fb5f7e32121b7 100644 --- a/eng/common/pipelines/templates/steps/verify-changelogs.yml +++ b/eng/common/pipelines/templates/steps/verify-changelogs.yml @@ -17,4 +17,4 @@ steps: -ForRelease $${{ parameters.ForRelease }} pwsh: true displayName: Verify ChangeLogEntries - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) diff --git a/eng/common/pipelines/templates/steps/verify-links.yml b/eng/common/pipelines/templates/steps/verify-links.yml index 9f629fdad96f7..34d32834d954f 100644 --- a/eng/common/pipelines/templates/steps/verify-links.yml +++ b/eng/common/pipelines/templates/steps/verify-links.yml @@ -17,7 +17,7 @@ steps: Condition: ${{ parameters.Condition }} - task: PowerShell@2 displayName: Link verification check - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) inputs: pwsh: true workingDirectory: '${{ parameters.WorkingDirectory }}/${{ parameters.Directory }}' diff --git a/eng/common/pipelines/templates/steps/verify-path-length.yml b/eng/common/pipelines/templates/steps/verify-path-length.yml index 259c663b9dc3f..60f52cb4ca814 100644 --- a/eng/common/pipelines/templates/steps/verify-path-length.yml +++ b/eng/common/pipelines/templates/steps/verify-path-length.yml @@ -7,7 +7,7 @@ parameters: steps: - task: PythonScript@0 displayName: Analyze Path Lengths - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) inputs: scriptSource: inline script: | diff --git a/eng/common/pipelines/templates/steps/verify-readme.yml b/eng/common/pipelines/templates/steps/verify-readme.yml index 6eeb174b323b6..f2303b86dca11 100644 --- a/eng/common/pipelines/templates/steps/verify-readme.yml +++ b/eng/common/pipelines/templates/steps/verify-readme.yml @@ -22,7 +22,7 @@ parameters: steps: - task: PowerShell@2 displayName: "Verify Readmes" - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) inputs: filePath: "eng/common/scripts/Verify-Readme.ps1" arguments: > diff --git a/eng/common/pipelines/templates/steps/verify-readmes.yml b/eng/common/pipelines/templates/steps/verify-readmes.yml index 40994767e8cd2..5987016f5b5c8 100644 --- a/eng/common/pipelines/templates/steps/verify-readmes.yml +++ b/eng/common/pipelines/templates/steps/verify-readmes.yml @@ -36,11 +36,11 @@ steps: $scanPaths = $paths -join "," Write-Host "##vso[task.setvariable variable=ScanPathArgument;]$scanPaths" displayName: Populate Scan Paths - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) - task: PowerShell@2 displayName: "Verify Readmes" - condition: ${{ parameters.Condition }} + condition: and(succeededOrFailed(), ${{ parameters.Condition }}) inputs: filePath: "eng/common/scripts/Verify-Readme.ps1" arguments: > diff --git a/eng/pipelines/code-quality-reports.yml b/eng/pipelines/code-quality-reports.yml index 551a561c20c5f..a0c8af4f492f4 100644 --- a/eng/pipelines/code-quality-reports.yml +++ b/eng/pipelines/code-quality-reports.yml @@ -112,7 +112,7 @@ extends: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: 'Generate Linting Reports' - condition: and(always(), ne(variables['LintingGoals'], '')) + condition: and(succeededOrFailed(), ne(variables['LintingGoals'], '')) - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 733a3962aa060..86c52ffbd9817 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -103,14 +103,14 @@ jobs: artifactName: 'repository-$(System.JobName)' targetPath: '$(System.DefaultWorkingDirectory)' displayName: 'Capture repo state for analysis' - condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + condition: and(succeededOrFailed(), or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))) sbomEnabled: false # See eng/common/pipelines/templates/steps/upload-llm-artifacts.yml for corresponding file copy step - output: pipelineArtifact targetPath: '$(Build.ArtifactStagingDirectory)/llm-artifacts' artifactName: "LLM Artifacts - $(System.JobName) - $(System.JobAttempt)" - condition: eq(variables['uploadLlmArtifacts'], 'true') + condition: and(succeeded(), eq(variables['uploadLlmArtifacts'], 'true')) sbomEnabled: false steps: diff --git a/eng/pipelines/templates/jobs/ci.versions.tests.yml b/eng/pipelines/templates/jobs/ci.versions.tests.yml index 07d8c4b01fba4..c1f5b750cbb10 100644 --- a/eng/pipelines/templates/jobs/ci.versions.tests.yml +++ b/eng/pipelines/templates/jobs/ci.versions.tests.yml @@ -32,7 +32,7 @@ parameters: jobs: - job: - condition: ne(variables['Skip.Test'], 'true') + condition: and(succeeded(), ne(variables['Skip.Test'], 'true')) variables: - template: /eng/pipelines/templates/variables/globals.yml @@ -54,7 +54,7 @@ jobs: artifactName: 'repository-$(System.JobName)' targetPath: '$(System.DefaultWorkingDirectory)' displayName: 'Capture repo state for analysis' - condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + condition: and(succeededOrFailed(), or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))) sbomEnabled: false - ${{ each versionOverride in parameters.VersionOverrides }}: diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index 3d3f41c3ac499..e78e6b72a6720 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -72,7 +72,7 @@ jobs: artifactName: 'repository-$(System.JobName)' targetPath: '$(System.DefaultWorkingDirectory)' displayName: 'Capture repo state for analysis' - condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) + condition: and(succeededOrFailed(), or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))) sbomEnabled: false steps: @@ -160,7 +160,7 @@ jobs: -LogFileDirectory $(Build.SourcesDirectory) -OutputDirectory $(System.DefaultWorkingDirectory) -UniqueId $(System.JobName) - condition: failed() + condition: and(succeededOrFailed(), failed()) - ${{ if ne(parameters.DisableAzureResourceCreation, 'true') }}: - ${{ each directory in coalesce(parameters.TestResourceDirectories, split(parameters.ServiceDirectory, '|')) }}: @@ -171,4 +171,3 @@ jobs: UseFederatedAuth: ${{ parameters.UseFederatedAuth }} ServiceConnection: ${{ parameters.CloudConfig.ServiceConnection }} SubscriptionConfigurationFilePaths: ${{ parameters.CloudConfig.SubscriptionConfigurationFilePaths }} - diff --git a/eng/pipelines/templates/stages/archetype-java-auto-release-batch.yml b/eng/pipelines/templates/stages/archetype-java-auto-release-batch.yml index 15458ebc71785..f3b8dd581889c 100644 --- a/eng/pipelines/templates/stages/archetype-java-auto-release-batch.yml +++ b/eng/pipelines/templates/stages/archetype-java-auto-release-batch.yml @@ -90,7 +90,7 @@ stages: - job: VerifyReleaseVersion displayName: Verify auto-release versions dependsOn: PrepareAutoReleasePackages - condition: ne(variables['Skip.VersionVerification'], 'true') + condition: and(succeeded(), ne(variables['Skip.VersionVerification'], 'true')) pool: name: $(LINUXPOOL) image: $(LINUXVMIMAGE) diff --git a/eng/pipelines/templates/stages/archetype-java-release-batch.yml b/eng/pipelines/templates/stages/archetype-java-release-batch.yml index 143df8382ef83..dfe010c587078 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-batch.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-batch.yml @@ -108,7 +108,7 @@ stages: jobs: - job: VerifyReleaseVersion displayName: "Verify release versions" - condition: ne(variables['Skip.VersionVerification'], 'true') + condition: and(succeeded(), ne(variables['Skip.VersionVerification'], 'true')) pool: name: $(LINUXPOOL) image: $(LINUXVMIMAGE) @@ -433,7 +433,7 @@ stages: - template: /eng/pipelines/templates/variables/image.yml jobs: - job: PublishPackages - condition: or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal'))) + condition: and(succeeded(), or(eq(variables['SetDevVersion'], 'true'), and(eq(variables['Build.Reason'],'Schedule'), eq(variables['System.TeamProject'], 'internal')))) displayName: Publish package to daily feed templateContext: diff --git a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml index 3353db07e3da9..5d27acec4a834 100644 --- a/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml +++ b/eng/pipelines/templates/stages/archetype-java-release-pom-only.yml @@ -85,7 +85,7 @@ stages: jobs: - job: TagRepository displayName: "Create release tag" - condition: ne(variables['Skip.TagRepository'], 'true') + condition: and(succeeded(), ne(variables['Skip.TagRepository'], 'true')) pool: name: $(WINDOWSPOOL) image: $(WINDOWSVMIMAGE) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 6406f33788e1c..16b393576293e 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -101,7 +101,7 @@ extends: displayName: Skip PR validation - stage: Build - condition: not(and(eq(${{ parameters.SkipPrValidation }}, true), eq(variables['Build.Reason'], 'Manual'))) + condition: and(succeeded(), not(and(eq(${{ parameters.SkipPrValidation }}, true), eq(variables['Build.Reason'], 'Manual')))) variables: - template: /eng/pipelines/templates/variables/globals.yml - template: /eng/pipelines/templates/variables/image.yml @@ -208,4 +208,3 @@ extends: TestPipeline: ${{ parameters.TestPipeline }} PublicFeedUrl: ${{ parameters.PublicFeedUrl }} PublicPublishEnvironment: ${{ parameters.PublicPublishEnvironment }} - diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index e93a86154e238..6f83534ddcaac 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -156,7 +156,7 @@ extends: } displayName: "Print ScalaTest report files" errorActionPreference: continue - condition: always() + condition: succeededOrFailed() - ${{ each mode in parameters.VnextEmulatorModes }}: - stage: displayName: Test VNext Emulator with ${{ mode }} diff --git a/eng/pipelines/templates/steps/build-and-test-native.yml b/eng/pipelines/templates/steps/build-and-test-native.yml index 03aeae7e519b6..16e6d6311b06d 100644 --- a/eng/pipelines/templates/steps/build-and-test-native.yml +++ b/eng/pipelines/templates/steps/build-and-test-native.yml @@ -64,7 +64,7 @@ steps: # Generate the pom file with all the modules required for creating an aggregate code coverage report - task: PythonScript@0 displayName: 'Generate pom for aggregate code coverage report' - condition: eq(variables['RunAggregateReports'], 'true') + condition: and(succeeded(), eq(variables['RunAggregateReports'], 'true')) inputs: scriptPath: 'eng/scripts/generate_aggregate_pom.py' arguments: '--project-list $(ProjectList) --exclude-project-list ${{ parameters.ExcludeProjectList }} --type coverage' @@ -72,7 +72,7 @@ steps: - task: Maven@4 displayName: 'Generate aggregate code coverage report' - condition: eq(variables['RunAggregateReports'], 'true') + condition: and(succeeded(), eq(variables['RunAggregateReports'], 'true')) inputs: mavenPomFile: aggregate-pom.xml options: '$(DefaultOptions)' @@ -126,7 +126,7 @@ steps: - template: /eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml - task: PublishTestResults@2 - condition: always() + condition: succeededOrFailed() inputs: testResultsFormat: 'JUnit' testResultsFiles: '**/TEST-*.xml' @@ -139,7 +139,7 @@ steps: # Azure DevOps only seems to respect the last code coverage result published, so only do this for Windows + Java LTS. # Code coverage reporting is set up only for Track 2 modules. - task: PublishCodeCoverageResults@2 - condition: eq(variables['RunAggregateReports'], 'true') + condition: and(succeeded(), eq(variables['RunAggregateReports'], 'true')) inputs: summaryFileLocation: target/site/test-coverage/jacoco.xml reportDirectory: target/site/test-coverage/ diff --git a/eng/pipelines/templates/steps/build-and-test.yml b/eng/pipelines/templates/steps/build-and-test.yml index 4eedfabd386e7..894b53889328a 100644 --- a/eng/pipelines/templates/steps/build-and-test.yml +++ b/eng/pipelines/templates/steps/build-and-test.yml @@ -146,7 +146,7 @@ steps: scriptPath: 'eng/scripts/generate_aggregate_pom.py' arguments: '--project-list $(ProjectList) --exclude-project-list ${{ parameters.ExcludeProjectList }} --type coverage' workingDirectory: '$(System.DefaultWorkingDirectory)' - condition: eq(variables['RunAggregateReports'], 'true') + condition: and(succeeded(), eq(variables['RunAggregateReports'], 'true')) - task: Maven@4 displayName: 'Generate aggregate code coverage report' @@ -158,7 +158,7 @@ steps: jdkVersionOption: $(JavaTestVersion) jdkArchitectureOption: 'x64' goals: jacoco:report-aggregate - condition: eq(variables['RunAggregateReports'], 'true') + condition: and(succeeded(), eq(variables['RunAggregateReports'], 'true')) - task: Maven@4 displayName: 'Build for From Source run' @@ -257,10 +257,10 @@ steps: pwsh: true filePath: eng/pipelines/scripts/Update-TestNamesForReporting.ps1 workingDirectory: $(System.DefaultWorkingDirectory)/sdk - condition: always() + condition: succeededOrFailed() - task: PublishTestResults@2 - condition: always() + condition: succeededOrFailed() inputs: testResultsFormat: 'JUnit' testResultsFiles: '**/TEST-*.xml' @@ -285,4 +285,4 @@ steps: summaryFileLocation: target/site/test-coverage/jacoco.xml reportDirectory: target/site/test-coverage/ failIfCoverageEmpty: false - condition: eq(variables['RunAggregateReports'], 'true') + condition: and(succeeded(), eq(variables['RunAggregateReports'], 'true')) diff --git a/eng/pipelines/templates/steps/install-latest-jdk.yml b/eng/pipelines/templates/steps/install-latest-jdk.yml index 3c7273d819382..a04f0e6331d41 100644 --- a/eng/pipelines/templates/steps/install-latest-jdk.yml +++ b/eng/pipelines/templates/steps/install-latest-jdk.yml @@ -11,7 +11,7 @@ steps: key: 'jdk | "1.${{ parameters.LatestJdkFeatureVersion }}" | "$(CacheSalt)" | "$(Agent.OS)"' path: $(Agent.BuildDirectory)/jdk-${{ parameters.LatestJdkFeatureVersion }} displayName: 'Cache Latest JDK' - condition: eq(variables['IsLatestNonLtsJdk'], 'true') + condition: and(succeeded(), eq(variables['IsLatestNonLtsJdk'], 'true')) - task: PowerShell@2 displayName: 'Install Latest JDK' @@ -21,7 +21,7 @@ steps: -JdkFeatureVersion ${{ parameters.LatestJdkFeatureVersion }} workingDirectory: $(Agent.BuildDirectory) filePath: eng/scripts/Install-Latest-JDK.ps1 - condition: eq(variables['IsLatestNonLtsJdk'], 'true') + condition: and(succeeded(), eq(variables['IsLatestNonLtsJdk'], 'true')) - pwsh: | Write-Host "Java 8 JDK: $Env:JAVA_HOME_8_X64" @@ -30,7 +30,7 @@ steps: Write-Host "Java 21 JDK: $Env:JAVA_HOME_21_X64" Write-Host "Latest JDK: $Env:JAVA_HOME_${{ parameters.LatestJdkFeatureVersion }}_X64" displayName: 'Verify Latest JDK Install' - condition: eq(variables['IsLatestNonLtsJdk'], 'true') + condition: and(succeeded(), eq(variables['IsLatestNonLtsJdk'], 'true')) - task: PowerShell@2 displayName: 'Install JDK 8 on macOS' @@ -40,4 +40,4 @@ steps: -JdkFeatureVersion 8 workingDirectory: $(Agent.BuildDirectory) filePath: eng/scripts/Install-Latest-JDK.ps1 - condition: eq(variables['Agent.OS'], 'Darwin') + condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin')) diff --git a/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml b/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml index 2c27c3f37701d..a6767f805d27f 100644 --- a/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml +++ b/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml @@ -12,4 +12,4 @@ steps: arguments: > -StagingDirectory $(System.DefaultWorkingDirectory) -OomArtifactName ${{ parameters.OomArtifactName }} - condition: always() + condition: succeededOrFailed() diff --git a/eng/pipelines/templates/steps/retain-test-logs.yml b/eng/pipelines/templates/steps/retain-test-logs.yml index c644de203e194..327d447b5654b 100644 --- a/eng/pipelines/templates/steps/retain-test-logs.yml +++ b/eng/pipelines/templates/steps/retain-test-logs.yml @@ -12,4 +12,4 @@ steps: arguments: > -StagingDirectory $(System.DefaultWorkingDirectory) -TestLogsArtifactName ${{ parameters.TestLogsArtifactName }} - condition: always() + condition: succeededOrFailed() diff --git a/sdk/cosmos/cleanup-test-resources.yml b/sdk/cosmos/cleanup-test-resources.yml index 07fa6d540aa26..07b11fd3f814d 100644 --- a/sdk/cosmos/cleanup-test-resources.yml +++ b/sdk/cosmos/cleanup-test-resources.yml @@ -36,7 +36,7 @@ steps: exit 0 displayName: ${{ parameters.DisplayName }} - condition: always() + condition: succeededOrFailed() env: # Passed as environment variables rather than on the command line so the key is not echoed. CLEANUP_ACCOUNT_HOST: ${{ parameters.AccountHost }} diff --git a/sdk/cosmos/kafka.yml b/sdk/cosmos/kafka.yml index 1a62beae49243..ff597dad74e88 100644 --- a/sdk/cosmos/kafka.yml +++ b/sdk/cosmos/kafka.yml @@ -64,4 +64,4 @@ extends: PostSteps: - script: docker logout "$(kafka-acr-login-server)" displayName: 'Logout from ACR' - condition: always() \ No newline at end of file + condition: succeededOrFailed() \ No newline at end of file diff --git a/sdk/spring/pipeline/compatibility-tests-job.yml b/sdk/spring/pipeline/compatibility-tests-job.yml index 6f931885329f3..62bc8d79531c3 100644 --- a/sdk/spring/pipeline/compatibility-tests-job.yml +++ b/sdk/spring/pipeline/compatibility-tests-job.yml @@ -68,7 +68,7 @@ jobs: - template: /eng/pipelines/templates/steps/maven-authenticate.yml - task: Maven@4 displayName: 'Install Unreleased Dependencies' - condition: ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '') + condition: and(succeeded(), ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '')) inputs: mavenPomFile: sdk/spring/pipeline/ClientFromSourcePom.xml goals: 'install' @@ -81,25 +81,25 @@ jobs: - bash: | echo "##vso[task.setVariable variable=SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_CLOUD_VERSION]$(python ./sdk/spring/scripts/compatibility_get_spring_cloud_version.py -b $(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION))" displayName: 'Set supported Spring version to environment variables' - condition: ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '') + condition: and(succeeded(), ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '')) - bash: | echo "$(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION):" echo "https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-dependencies/$(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION)/spring-boot-dependencies-$(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION).pom" echo "$(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_CLOUD_VERSION):" echo "https://repo1.maven.org/maven2/org/springframework/cloud/spring-cloud-dependencies/$(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_CLOUD_VERSION)/spring-cloud-dependencies-$(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_CLOUD_VERSION).pom" displayName: 'Log Spring version and Maven pom path' - condition: ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '') + condition: and(succeeded(), ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '')) - script: | python ./sdk/spring/scripts/compatibility_insert_dependencymanagement.py -b $(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION) -c $(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_CLOUD_VERSION) displayName: 'Insert Spring dependency managements' - condition: ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '') + condition: and(succeeded(), ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '')) - script: | python ./sdk/spring/scripts/compatibility_delete_version.py -b $(SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION) displayName: 'Remove unused dependency versions' - condition: ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '') + condition: and(succeeded(), ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '')) - task: Maven@4 displayName: 'Run tests' - condition: ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '') + condition: and(succeeded(), ne(variables['SPRING_CLOUD_AZURE_TEST_SUPPORTED_SPRING_BOOT_VERSION'], '')) inputs: options: '$(DefaultOptions) -ntp -T ${{parameters.BuildParallelization}} ${{parameters.SkipOptions}} -Dcompiler.failondeprecatedstatus=- --fail-at-end' mavenPomFile: sdk/spring/pom.xml From 0cf1ac162a232c9a2e4bd940b358f01f746d5261 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 11 Sep 2026 23:49:38 +0000 Subject: [PATCH 2/2] Restore always and failed pipeline conditions Co-authored-by: mikeharder <9459391+mikeharder@users.noreply.github.com> --- eng/common/pipelines/templates/jobs/eval-shard.yml | 8 ++++---- eng/common/pipelines/templates/jobs/eval-summarize.yml | 2 +- eng/common/pipelines/templates/jobs/perf.yml | 10 +++++----- .../pipelines/templates/stages/archetype-eval.yml | 2 +- eng/common/pipelines/templates/steps/credscan.yml | 2 +- .../pipelines/templates/steps/publish-artifact.yml | 2 +- .../pipelines/templates/steps/sparse-checkout.yml | 2 +- eng/pipelines/code-quality-reports.yml | 2 +- eng/pipelines/templates/jobs/ci.tests.yml | 2 +- eng/pipelines/templates/jobs/ci.versions.tests.yml | 2 +- eng/pipelines/templates/jobs/live.tests.yml | 4 ++-- eng/pipelines/templates/stages/cosmos-sdk-client.yml | 2 +- .../templates/steps/build-and-test-native.yml | 2 +- eng/pipelines/templates/steps/build-and-test.yml | 4 ++-- .../templates/steps/retain-heap-dump-hprofs.yml | 2 +- eng/pipelines/templates/steps/retain-test-logs.yml | 2 +- sdk/cosmos/cleanup-test-resources.yml | 2 +- sdk/cosmos/kafka.yml | 2 +- 18 files changed, 27 insertions(+), 27 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/eval-shard.yml b/eng/common/pipelines/templates/jobs/eval-shard.yml index 292d3f8917116..fc4245111884e 100644 --- a/eng/common/pipelines/templates/jobs/eval-shard.yml +++ b/eng/common/pipelines/templates/jobs/eval-shard.yml @@ -53,12 +53,12 @@ jobs: displayName: 'Publish $(shardName) JUnit' artifactName: 'eval-result-$(shardName)-$(System.JobAttempt)' targetPath: $(Build.ArtifactStagingDirectory)/junit - condition: succeededOrFailed() + condition: always() - output: pipelineArtifact displayName: 'Publish $(shardName) transcripts (on failure)' artifactName: 'eval-debug-$(shardName)-$(System.JobAttempt)' targetPath: $(Build.ArtifactStagingDirectory)/debug - condition: and(succeededOrFailed(), failed()) + condition: failed() steps: - checkout: self fetchDepth: 1 @@ -129,7 +129,7 @@ jobs: mkdir -p "$(Build.ArtifactStagingDirectory)/junit" "$(Build.ArtifactStagingDirectory)/debug" find "$(Build.SourcesDirectory)/artifacts/vally-results/$(shardName)" -name '*.junit.xml' -exec cp {} "$(Build.ArtifactStagingDirectory)/junit/" \; displayName: 'Collect $(shardName) JUnit' - condition: succeededOrFailed() + condition: always() # On a real failure keep transcripts; strip JUnit so Summary can't double-count it. - script: | @@ -141,4 +141,4 @@ jobs: find "$dest" -name '*.junit.xml' -delete fi displayName: 'Collect $(shardName) transcripts (on failure)' - condition: and(succeededOrFailed(), failed()) + condition: failed() diff --git a/eng/common/pipelines/templates/jobs/eval-summarize.yml b/eng/common/pipelines/templates/jobs/eval-summarize.yml index 4f299f9e4f58c..8d9f49d6c8c89 100644 --- a/eng/common/pipelines/templates/jobs/eval-summarize.yml +++ b/eng/common/pipelines/templates/jobs/eval-summarize.yml @@ -33,7 +33,7 @@ jobs: --results-root "$(Pipeline.Workspace)/eval-results" \ --output-path "$(Build.ArtifactStagingDirectory)/eval-summary.md" displayName: 'Render Markdown rollup' - condition: succeededOrFailed() + condition: always() - task: PublishTestResults@2 displayName: 'Publish eval rollup' diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index f7f2d270acd49..2257d783041df 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -185,31 +185,31 @@ jobs: get-content results.txt workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.txt - condition: succeededOrFailed() + condition: always() - pwsh: | get-content results.csv workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.csv - condition: succeededOrFailed() + condition: always() - pwsh: | get-content results.md workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.md - condition: succeededOrFailed() + condition: always() - pwsh: | get-content results.json workingDirectory: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results displayName: Print results.json - condition: succeededOrFailed() + condition: always() - task: PublishPipelineArtifact@1 inputs: targetPath: azure-sdk-tools/tools/perf-automation/Azure.Sdk.Tools.PerfAutomation/results artifactName: results-${{ parameters.Language }}-$(MatrixName) - condition: succeededOrFailed() + condition: always() - task: PublishPipelineArtifact@1 inputs: diff --git a/eng/common/pipelines/templates/stages/archetype-eval.yml b/eng/common/pipelines/templates/stages/archetype-eval.yml index a3951a10dd58c..4e29b4c314ce3 100644 --- a/eng/common/pipelines/templates/stages/archetype-eval.yml +++ b/eng/common/pipelines/templates/stages/archetype-eval.yml @@ -99,7 +99,7 @@ extends: - stage: Summary displayName: 'Summarize results' dependsOn: Eval - condition: succeededOrFailed() + condition: always() jobs: - template: /eng/common/pipelines/templates/jobs/eval-summarize.yml parameters: diff --git a/eng/common/pipelines/templates/steps/credscan.yml b/eng/common/pipelines/templates/steps/credscan.yml index 7689542063b4e..a85bfca0333a2 100644 --- a/eng/common/pipelines/templates/steps/credscan.yml +++ b/eng/common/pipelines/templates/steps/credscan.yml @@ -52,4 +52,4 @@ steps: - pwsh: | Write-Host "Please check https://aka.ms/azsdk/credscan for more information about the cred scan failure." displayName: CredScan troubleshooting guide - condition: and(succeededOrFailed(), failed(), ne(variables['SKIP_CREDSCAN'], true)) + condition: and(failed(), ne(variables['SKIP_CREDSCAN'], true)) diff --git a/eng/common/pipelines/templates/steps/publish-artifact.yml b/eng/common/pipelines/templates/steps/publish-artifact.yml index 325d8a962eca3..6e9bdd0f30bd4 100644 --- a/eng/common/pipelines/templates/steps/publish-artifact.yml +++ b/eng/common/pipelines/templates/steps/publish-artifact.yml @@ -20,7 +20,7 @@ steps: path: '${{ parameters.ArtifactPath }}' - task: PublishPipelineArtifact@1 - condition: and(succeededOrFailed(), failed(), ${{ parameters.CustomCondition }}) + condition: and(failed(), ${{ parameters.CustomCondition }}) displayName: 'Publish failed ${{ parameters.ArtifactName }} Artifacts' inputs: artifactName: '${{ parameters.ArtifactName }}-FailedAttempt$(System.JobAttempt)' diff --git a/eng/common/pipelines/templates/steps/sparse-checkout.yml b/eng/common/pipelines/templates/steps/sparse-checkout.yml index 2908b2d97ff14..d7f1bc0d12462 100644 --- a/eng/common/pipelines/templates/steps/sparse-checkout.yml +++ b/eng/common/pipelines/templates/steps/sparse-checkout.yml @@ -144,4 +144,4 @@ steps: - pwsh: | git config unset --global "http.extraheader" displayName: Removing git config auth header - condition: succeededOrFailed() + condition: always() diff --git a/eng/pipelines/code-quality-reports.yml b/eng/pipelines/code-quality-reports.yml index a0c8af4f492f4..551a561c20c5f 100644 --- a/eng/pipelines/code-quality-reports.yml +++ b/eng/pipelines/code-quality-reports.yml @@ -112,7 +112,7 @@ extends: pwsh: true workingDirectory: $(Pipeline.Workspace) displayName: 'Generate Linting Reports' - condition: and(succeededOrFailed(), ne(variables['LintingGoals'], '')) + condition: and(always(), ne(variables['LintingGoals'], '')) - template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml parameters: diff --git a/eng/pipelines/templates/jobs/ci.tests.yml b/eng/pipelines/templates/jobs/ci.tests.yml index 86c52ffbd9817..6f3f990ff090f 100644 --- a/eng/pipelines/templates/jobs/ci.tests.yml +++ b/eng/pipelines/templates/jobs/ci.tests.yml @@ -103,7 +103,7 @@ jobs: artifactName: 'repository-$(System.JobName)' targetPath: '$(System.DefaultWorkingDirectory)' displayName: 'Capture repo state for analysis' - condition: and(succeededOrFailed(), or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))) + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) sbomEnabled: false # See eng/common/pipelines/templates/steps/upload-llm-artifacts.yml for corresponding file copy step diff --git a/eng/pipelines/templates/jobs/ci.versions.tests.yml b/eng/pipelines/templates/jobs/ci.versions.tests.yml index c1f5b750cbb10..39d4d723b4d3f 100644 --- a/eng/pipelines/templates/jobs/ci.versions.tests.yml +++ b/eng/pipelines/templates/jobs/ci.versions.tests.yml @@ -54,7 +54,7 @@ jobs: artifactName: 'repository-$(System.JobName)' targetPath: '$(System.DefaultWorkingDirectory)' displayName: 'Capture repo state for analysis' - condition: and(succeededOrFailed(), or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))) + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) sbomEnabled: false - ${{ each versionOverride in parameters.VersionOverrides }}: diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index e78e6b72a6720..753687a718f2a 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -72,7 +72,7 @@ jobs: artifactName: 'repository-$(System.JobName)' targetPath: '$(System.DefaultWorkingDirectory)' displayName: 'Capture repo state for analysis' - condition: and(succeededOrFailed(), or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule')))) + condition: or(eq(variables['CaptureRepositoryOnFailure'], 'true'), and(failed(), eq(variables['Build.Reason'],'Schedule'))) sbomEnabled: false steps: @@ -160,7 +160,7 @@ jobs: -LogFileDirectory $(Build.SourcesDirectory) -OutputDirectory $(System.DefaultWorkingDirectory) -UniqueId $(System.JobName) - condition: and(succeededOrFailed(), failed()) + condition: failed() - ${{ if ne(parameters.DisableAzureResourceCreation, 'true') }}: - ${{ each directory in coalesce(parameters.TestResourceDirectories, split(parameters.ServiceDirectory, '|')) }}: diff --git a/eng/pipelines/templates/stages/cosmos-sdk-client.yml b/eng/pipelines/templates/stages/cosmos-sdk-client.yml index 6f83534ddcaac..e93a86154e238 100644 --- a/eng/pipelines/templates/stages/cosmos-sdk-client.yml +++ b/eng/pipelines/templates/stages/cosmos-sdk-client.yml @@ -156,7 +156,7 @@ extends: } displayName: "Print ScalaTest report files" errorActionPreference: continue - condition: succeededOrFailed() + condition: always() - ${{ each mode in parameters.VnextEmulatorModes }}: - stage: displayName: Test VNext Emulator with ${{ mode }} diff --git a/eng/pipelines/templates/steps/build-and-test-native.yml b/eng/pipelines/templates/steps/build-and-test-native.yml index 16e6d6311b06d..e804033c7a5e2 100644 --- a/eng/pipelines/templates/steps/build-and-test-native.yml +++ b/eng/pipelines/templates/steps/build-and-test-native.yml @@ -126,7 +126,7 @@ steps: - template: /eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml - task: PublishTestResults@2 - condition: succeededOrFailed() + condition: always() inputs: testResultsFormat: 'JUnit' testResultsFiles: '**/TEST-*.xml' diff --git a/eng/pipelines/templates/steps/build-and-test.yml b/eng/pipelines/templates/steps/build-and-test.yml index 894b53889328a..915678f1784d4 100644 --- a/eng/pipelines/templates/steps/build-and-test.yml +++ b/eng/pipelines/templates/steps/build-and-test.yml @@ -257,10 +257,10 @@ steps: pwsh: true filePath: eng/pipelines/scripts/Update-TestNamesForReporting.ps1 workingDirectory: $(System.DefaultWorkingDirectory)/sdk - condition: succeededOrFailed() + condition: always() - task: PublishTestResults@2 - condition: succeededOrFailed() + condition: always() inputs: testResultsFormat: 'JUnit' testResultsFiles: '**/TEST-*.xml' diff --git a/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml b/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml index a6767f805d27f..2c27c3f37701d 100644 --- a/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml +++ b/eng/pipelines/templates/steps/retain-heap-dump-hprofs.yml @@ -12,4 +12,4 @@ steps: arguments: > -StagingDirectory $(System.DefaultWorkingDirectory) -OomArtifactName ${{ parameters.OomArtifactName }} - condition: succeededOrFailed() + condition: always() diff --git a/eng/pipelines/templates/steps/retain-test-logs.yml b/eng/pipelines/templates/steps/retain-test-logs.yml index 327d447b5654b..c644de203e194 100644 --- a/eng/pipelines/templates/steps/retain-test-logs.yml +++ b/eng/pipelines/templates/steps/retain-test-logs.yml @@ -12,4 +12,4 @@ steps: arguments: > -StagingDirectory $(System.DefaultWorkingDirectory) -TestLogsArtifactName ${{ parameters.TestLogsArtifactName }} - condition: succeededOrFailed() + condition: always() diff --git a/sdk/cosmos/cleanup-test-resources.yml b/sdk/cosmos/cleanup-test-resources.yml index 07b11fd3f814d..07fa6d540aa26 100644 --- a/sdk/cosmos/cleanup-test-resources.yml +++ b/sdk/cosmos/cleanup-test-resources.yml @@ -36,7 +36,7 @@ steps: exit 0 displayName: ${{ parameters.DisplayName }} - condition: succeededOrFailed() + condition: always() env: # Passed as environment variables rather than on the command line so the key is not echoed. CLEANUP_ACCOUNT_HOST: ${{ parameters.AccountHost }} diff --git a/sdk/cosmos/kafka.yml b/sdk/cosmos/kafka.yml index ff597dad74e88..1a62beae49243 100644 --- a/sdk/cosmos/kafka.yml +++ b/sdk/cosmos/kafka.yml @@ -64,4 +64,4 @@ extends: PostSteps: - script: docker logout "$(kafka-acr-login-server)" displayName: 'Logout from ACR' - condition: succeededOrFailed() \ No newline at end of file + condition: always() \ No newline at end of file