Skip to content

Fix PostBuildLogs artifact name collision across jobs#16651

Merged
mmitche merged 1 commit intodotnet:mainfrom
mmitche:fix-postbuild-logs-artifact-name
Mar 31, 2026
Merged

Fix PostBuildLogs artifact name collision across jobs#16651
mmitche merged 1 commit intodotnet:mainfrom
mmitche:fix-postbuild-logs-artifact-name

Conversation

@mmitche
Copy link
Copy Markdown
Member

@mmitche mmitche commented Mar 31, 2026

Summary

Multiple post-build jobs upload logs to the same artifact name PostBuildLogs_Attempt<N>, causing collisions when more than one job runs in the same build (e.g., see build 2940391 where PostBuildLogs_Attempt1 is uploaded from multiple places).

Root Cause

In eng/common/core-templates/steps/publish-logs.yml, the artifact name was:

artifactName: PostBuildLogs_Attempt$(System.JobAttempt)

The StageLabel and JobLabel parameters were only used for subdirectory structure within the artifact, not in the artifact name itself. When multiple jobs called this template (Signing Validation, Asset Registry Publish, Assets Publishing), they all collided on the same artifact name.

Fix

Include StageLabel and JobLabel in the artifact name so each job produces a uniquely-named artifact. Also added a StageLabel: 'BuildAssetRegistry' to the publish-build-assets.yml caller which was missing one.

Resulting artifact names:

Caller Artifact Name
Signing Validation (post-build.yml) PostBuildLogs_Validation_Signing_Attempt1
Asset Registry Publish (publish-build-assets.yml) PostBuildLogs_BuildAssetRegistry_Publish_Artifacts_Logs_Attempt1
Assets Publishing (publish.yml) PostBuildLogs_<stageName>_AssetsPublishing_Attempt1

Multiple jobs uploading post-build logs all used the same artifact name
PostBuildLogs_Attempt<N>, causing collisions when more than one job
ran in the same build (e.g., Signing Validation, Asset Registry Publish,
and Assets Publishing).

Include the StageLabel and JobLabel template parameters in the artifact
name so each job produces a uniquely-named artifact. Also add a
StageLabel to the publish-build-assets caller which was missing one.

Resulting artifact names:
- PostBuildLogs_Validation_Signing_Attempt1
- PostBuildLogs_BuildAssetRegistry_Publish_Artifacts_Logs_Attempt1
- PostBuildLogs_<stageName>_AssetsPublishing_Attempt1

Co-authored-by: Copilot <[email protected]>
@mmitche mmitche requested review from a team and akoeplinger March 31, 2026 18:11
@mmitche mmitche enabled auto-merge (squash) March 31, 2026 18:12
@mmitche mmitche merged commit bb726e8 into dotnet:main Mar 31, 2026
9 checks passed
Copilot AI pushed a commit that referenced this pull request Apr 7, 2026
mmitche added a commit to mmitche/arcade that referenced this pull request Apr 8, 2026
Co-authored-by: Copilot <[email protected]>
(cherry picked from commit bb726e8)

# Conflicts:
#	eng/common/core-templates/job/publish-build-assets.yml
#	eng/common/core-templates/steps/publish-logs.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants