Skip to content

Migrate eng/pipelines from PublishBuildArtifacts to PublishPipelineArtifact#128498

Open
mmitche wants to merge 1 commit into
dotnet:mainfrom
mmitche:dev/migrate-pipeline-artifacts
Open

Migrate eng/pipelines from PublishBuildArtifacts to PublishPipelineArtifact#128498
mmitche wants to merge 1 commit into
dotnet:mainfrom
mmitche:dev/migrate-pipeline-artifacts

Conversation

@mmitche
Copy link
Copy Markdown
Member

@mmitche mmitche commented May 22, 2026

Summary

Migrates all remaining PublishBuildArtifacts@1 / DownloadBuildArtifacts@0 usage in eng/pipelines/ to PublishPipelineArtifact@1 / DownloadPipelineArtifact@2.

Pipeline Artifacts use dedup-based upload and are 10-100x faster than legacy Build Artifacts. This migration reduces agent time spent on artifact publishing and returns agents to the pool sooner, reducing queue pressure for all pipelines sharing the same pools.

Artifact naming strategy

Pipeline Artifacts cannot be overwritten on retry (unlike Build Artifacts), so artifact names must account for System.JobAttempt:

  • Diagnostic artifacts (logs, binlogs, test results): suffixed with _Attempt$(System.JobAttempt) to avoid collisions on retry
  • Intermediate artifacts consumed by downstream jobs: use stable names (no Attempt suffix) and publish only on succeeded() so retries can publish cleanly

Changes

Publish wrapper

  • eng/pipelines/common/templates/publish-build-artifacts.yml: PublishBuildArtifacts@1 / 1ES.PublishBuildArtifacts@1PublishPipelineArtifact@1 / 1ES.PublishPipelineArtifact@1
  • upload-artifact-step.yml, upload-intermediate-artifacts-step.yml: updated input names (PathtoPublishtargetPath, etc.)

WASM

  • wasm-post-build-steps.yml: 2 direct calls migrated; stable artifact names preserved for downstream consumption

Performance templates

  • build-perf-sample-apps.yml: 10 binlog publish steps → _Attempt$(System.JobAttempt) suffix (diagnostic)
  • build-perf-bdn-app.yml: 1 binlog → _Attempt suffix
  • build-perf-maui-apps-net6.yml, build-perf-maui-apps-net7.yml: 6 binlogs each → _Attempt suffix

Downloads

  • download-artifact-step.yml, download-specific-artifact-step.yml, browser-wasm-build-tests.yml, browser-wasm-coreclr-build-tests.yml: migrated to DownloadPipelineArtifact@2

Not changed

  • eng/common/ files (managed by Arcade; the templates/job/job.yml wrapper already routes enablePublishBuildArtifacts through publish-pipeline-artifacts with _Attempt suffix)
  • enablePublishBuildArtifacts: true parameter references in SuperPMI/libraries templates (parameter name only; already handled by Arcade wrapper)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the runtime repo’s Azure Pipelines YAML under eng/pipelines/ to use Pipeline Artifacts (PublishPipelineArtifact@1 / DownloadPipelineArtifact@2) instead of legacy Build Artifacts, including updating shared helper templates so callers pass the correct input names.

Changes:

  • Replace PublishBuildArtifacts@1 with PublishPipelineArtifact@1 (and 1ES equivalents) and update inputs (pathtoPublish/PathtoPublish/pathToPublishtargetPath).
  • Replace DownloadBuildArtifacts@0 with DownloadPipelineArtifact@2 and update download destinations (downloadPathtargetPath).
  • Update perf templates’ binlog artifact naming to include _Attempt$(System.JobAttempt) to avoid retry collisions.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
eng/pipelines/performance/templates/build-perf-sample-apps.yml Switch binlog publishing to Pipeline Artifacts and suffix names with job attempt.
eng/pipelines/performance/templates/build-perf-maui-apps-net7.yml Switch MAUI binlog publishing to Pipeline Artifacts with attempt-suffixed artifact names.
eng/pipelines/performance/templates/build-perf-maui-apps-net6.yml Switch MAUI binlog publishing to Pipeline Artifacts with attempt-suffixed artifact names.
eng/pipelines/performance/templates/build-perf-bdn-app.yml Switch Benchmarks.Droid binlog publishing to Pipeline Artifacts with attempt-suffixed artifact name.
eng/pipelines/common/wasm-post-build-steps.yml Publish WASM intermediate artifacts/WBT via Pipeline Artifacts (stable names).
eng/pipelines/common/upload-intermediate-artifacts-step.yml Update intermediate artifact publish helper to pass Pipeline Artifact inputs.
eng/pipelines/common/upload-artifact-step.yml Update shared archive+publish helper to publish Pipeline Artifacts (uses targetPath).
eng/pipelines/common/templates/publish-build-artifacts.yml Replace build-artifact publish wrapper with pipeline-artifact publish wrapper.
eng/pipelines/common/templates/browser-wasm-coreclr-build-tests.yml Migrate artifact downloads to DownloadPipelineArtifact@2 with explicit targetPath.
eng/pipelines/common/templates/browser-wasm-build-tests.yml Migrate artifact downloads to DownloadPipelineArtifact@2 with explicit targetPath.
eng/pipelines/common/download-specific-artifact-step.yml Migrate “download specific run” helper to DownloadPipelineArtifact@2 and update input names.
eng/pipelines/common/download-artifact-step.yml Migrate “download current run” helper to DownloadPipelineArtifact@2 and update to targetPath.

Comment on lines +69 to 72
# - task: DownloadPipelineArtifact@2
# displayName: Download built nugets for multi-threaded runtime
# inputs:
# buildType: current
Comment on lines 24 to 31
- template: /eng/pipelines/common/templates/publish-build-artifacts.yml
parameters:
isOfficialBuild: ${{ parameters.isOfficialBuild }}
displayName: 'Publish ${{ parameters.displayName }}'
inputs:
PathtoPublish: $(Build.StagingDirectory)/${{ parameters.artifactName }}${{ parameters.archiveExtension }}
artifactName: ${{ parameters.artifactName }}
targetPath: $(Build.StagingDirectory)/${{ parameters.artifactName }}${{ parameters.archiveExtension }}
artifactName: ${{ parameters.artifactName }}
condition: ${{ parameters.condition }}
@mmitche
Copy link
Copy Markdown
Member Author

mmitche commented May 22, 2026

This will for sure need some scrutiny but should start to cut some time off PR builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants