You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[release/9.0] Avoid artifact name collisions on job retries - #39051
Description
Azure DevOps job retries reuse the build ID, while published artifact names must be unique within that build. Append $(System.JobAttempt) to always-published test-result and log artifact names so each attempt publishes distinct artifacts, including when a caller configures a custom log artifact name. TestResults uploads are non-blocking so diagnostic artifact failures do not mask the test result.
Customer impact
A retried CI job can fail while publishing logs or test results because the first attempt already created an artifact with the same name. This masks the retried job result and requires queuing a new build. There is no product runtime impact.
How found
Found from an EF Core servicing build failure reported in #39005.
Regression
This is not a product regression. It is a CI configuration issue exposed when Azure DevOps retries a job in the same build.
Testing
0 tests modified. Validated the YAML changes and confirmed all affected log and test-result artifact names include the job-attempt suffix.
Risk
Extremely low. This is a YAML-only artifact naming and publication change; no quirk is applicable.
This PR updates EF Core’s Azure DevOps pipeline templates to prevent build artifact publishing failures when a job is retried within the same build, by making artifact names unique per job attempt.
Changes:
Append $(System.JobAttempt) to published log artifact names in shared job templates.
Append $(System.JobAttempt) to published TestResults artifact names in internal and public pipeline YAMLs.
File
Description
eng/common/templates/job/job.yml
Adds a job-attempt suffix to the default build-artifact log name to avoid retry collisions.
eng/common/templates-official/job/job.yml
Adds a job-attempt suffix to the default build-artifact log name for official templates.
azure-pipelines.yml
Updates TestResults pipeline-artifact names to include the job attempt.
azure-pipelines-public.yml
Updates TestResults build-artifact names to include the job attempt.
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
There are still retry-unsafe artifact names in the modified templates/pipeline (e.g., pipeline-log artifacts with custom names and a BinArtifacts output) that can collide and/or fail on job retry.
The Windows 1ES build publishes a pipeline artifact named 'BinArtifacts' with condition: always(). If the job is retried in the same build, this artifact name will collide and can fail the retry before reaching the updated TestResults upload. Consider making the artifact name attempt-scoped, consistent with the other retry-safe artifact names in this PR.
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
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.
Fixes #39005
Backports #39048
Description
Azure DevOps job retries reuse the build ID, while published artifact names must be unique within that build. Append
$(System.JobAttempt)to always-published test-result and log artifact names so each attempt publishes distinct artifacts, including when a caller configures a custom log artifact name. TestResults uploads are non-blocking so diagnostic artifact failures do not mask the test result.Customer impact
A retried CI job can fail while publishing logs or test results because the first attempt already created an artifact with the same name. This masks the retried job result and requires queuing a new build. There is no product runtime impact.
How found
Found from an EF Core servicing build failure reported in #39005.
Regression
This is not a product regression. It is a CI configuration issue exposed when Azure DevOps retries a job in the same build.
Testing
0 tests modified. Validated the YAML changes and confirmed all affected log and test-result artifact names include the job-attempt suffix.
Risk
Extremely low. This is a YAML-only artifact naming and publication change; no quirk is applicable.