Repository navigation
Append attempt number to build log artifact names - #55058
Merged
MichaelSimons merged 1 commit intoJun 29, 2026
Merged
Conversation
Prevent binlogs from being overwritten on job retry by appending _Attempt$(System.JobAttempt) to the Publish Logs artifact name, matching the pattern already used for PostBuildLogs artifacts. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures build log artifacts aren’t overwritten when an Azure DevOps job is retried by making the published log artifact name attempt-specific.
Changes:
- Update the “Publish Logs” artifact name to include
$(System.JobAttempt)so each retry publishes a uniquely named log artifact (e.g.,..._Attempt1,..._Attempt2).
MichaelSimons
enabled auto-merge (squash)
June 29, 2026 21:27
nagilson
approved these changes
Jun 29, 2026
MichaelSimons
deleted the
michaelsimons/fix-binlog-artifact-attempt-naming
branch
June 29, 2026 21:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a build job is retried, the
Publish Logsstep ineng/pipelines/templates/jobs/sdk-build.ymlpublishes artifacts using the static name$(System.PhaseName)_Logs. Because the name does not change between attempts, a retry overwrites the binlogs from the previous (failed) attempt, making it impossible to diagnose what went wrong on the original run.Fix
Append
_Attempt$(System.JobAttempt)to the log artifact name so each attempt produces a uniquely named artifact -- for example,Build_windows_x64_Logs_Attempt1andBuild_windows_x64_Logs_Attempt2.This mirrors the pattern already used in
eng/common/core-templates/steps/publish-logs.ymlforPostBuildLogsartifacts, which correctly includes_Attempt$(System.JobAttempt)in its artifact name.Non-log artifacts (
_Assets,_AotSizeAnalysis) are intentionally left unchanged -- overwriting those on retry is acceptable since later successful builds supersede earlier ones.Change
Note
This is especially valuable when investigating known flaky or broken builds where jobs are being retried -- whether manually or via auto-retry (e.g.,
build-configuration.json). Previously, the only binlogs available after a retry were from the final attempt, making it impossible to compare failure signatures across attempts or confirm whether a transient issue reproduced consistently. With this change, logs from every attempt are preserved and independently accessible in the pipeline artifacts.