Skip to content

[release/9.0] Avoid artifact name collisions on job retries - #39051

Merged
wtgodbe merged 3 commits into
release/9.0from
fix-artifact-retry-release-9.0
Oct 7, 2026
Merged

wtgodbe merged 3 commits into
release/9.0from
fix-artifact-retry-release-9.0

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

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.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The log artifact attempt suffix is only applied to the fallback artifact name, so retries can still collide when a custom artifactName is provided.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

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.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/common/templates/job/job.yml Resolved
Will Godbe and others added 2 commits September 21, 2026 13:47
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 21, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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.

Review effort: Lite
Findings: None

Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Make Windows build artifact name retry-safe

azure-pipelines.yml:144

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.

@wtgodbe
wtgodbe merged commit 7b7f63d into release/9.0 Oct 7, 2026
12 checks passed
@wtgodbe
wtgodbe deleted the fix-artifact-retry-release-9.0 branch October 7, 2026 23:00
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.

3 participants