Retry transient Windows bundle directory moves#18839
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d0bf13f7-53de-4d9d-951d-cf6bcde7e820
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18839Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18839" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
Adds bounded retries for transient Windows bundle-promotion failures.
Changes:
- Classifies retryable Windows lock errors.
- Retries directory promotion with exponential backoff.
- Adds unit and Windows integration coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Aspire.Cli/Bundles/BundleService.cs |
Implements promotion retries. |
tests/Aspire.Cli.Tests/BundleServiceTests.cs |
Tests error classification. |
tests/Aspire.Cli.Tests/BundleServiceIntegrationTests.cs |
Tests promotion after releasing a lock. |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
Test Scenarios ExecutedScenario 1: PR CLI artifact install/version verificationObjective: Install the dogfood CLI artifact into an isolated Windows temp directory and verify it matches the PR head commit. Steps:
Evidence:
Observations:
Scenario 2: Bundle-backed template happy pathObjective: Validate the installed PR CLI can create a new starter project from the PR hive using non-interactive template flags. Steps:
Evidence:
Observations:
Scenario 3: AppHost start/wait/describe/stop smokeObjective: Exercise the installed PR CLI through AppHost orchestration after project creation and verify generated resources reach healthy state. Steps:
Evidence:
Observations:
Scenario 4: Non-empty output directory unhappy pathObjective: Verify deterministic user errors still fail cleanly and are not masked by retry behavior. Steps:
Evidence:
Expected Unhappy-Path Outcome: Non-zero exit code with a clear message that the output directory already exists and is not empty. Observations:
Scenario 5: Targeted Windows source testsObjective: Directly exercise the PR's new retry classification and Windows file-lock behavior in the PR source checkout. Steps:
Evidence:
Observations:
Summary
Overall Result✅ PR VERIFIED Recommendations
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d0bf13f7-53de-4d9d-951d-cf6bcde7e820
Tests selector (audit mode)The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement. 2 / 100 test projects · 5 jobs, from 3 changed files. Selected test projects (2 / 100)
Selected jobs (5)
How these were chosen — grouped by what changed📦 affected project 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
What the change does
Rationale for Test ApproachThe fix targets a Windows race where an AV scanner/indexer briefly opens a freshly-extracted bundle file without delete-sharing, making the atomic promotion Test Scenarios ExecutedScenario 1: HRESULT classification (unit)Objective: Only the three transient Windows lock HRESULTs are retryable; deterministic errors are not. Scenario 2: Platform guard (unit)Objective: Retry logic never engages off Windows. Scenario 3: End-to-end retry after a temporary Windows file lock (integration)Objective: A move blocked by an open, non-delete-shared file retries and then succeeds once the lock is released. Scenario 4: Regression — full BundleService suitesObjective: The Commands & Evidence
Summary
Overall Result✅ PR VERIFIED Observations / Recommendations
|
Description
Freshly extracted bundle files can be opened briefly by antivirus, indexing, or other automated scanners on Windows. When those handles do not share delete access, the atomic move from the temporary extraction directory to the active version directory fails immediately.
Retry only the bundle promotion move on Windows using the CLI's existing bounded exponential-backoff pattern. Retries are limited to the Win32 access-denied, sharing-violation, and lock-violation HRESULTs so deterministic failures such as a full disk or an existing destination still fail immediately. Tests cover the error classification, non-Windows behavior, and promotion after a temporary Windows file lock is released.
Fixes #18275
Checklist
<remarks />and<code />elements on your triple slash comments?