Port: Fix installing playwright-cli with aspire agent init on Windows#15640
Port: Fix installing playwright-cli with aspire agent init on Windows#15640
Conversation
…n Windows (#15559) * Backport NpmRunner and SigstoreNpmProvenanceChecker changes from mad-skills * Clean up empty .playwright directory after skill installation * Add missing IsAvailable property to test INpmRunner implementations
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15640Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15640" |
|
🎬 CLI E2E Test Recordings — 52 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23630962100 |
There was a problem hiding this comment.
Pull request overview
Ports fixes from release/13.2 to improve aspire agent init reliability on Windows when installing playwright-cli, including provenance/logging tweaks and post-install cleanup.
Changes:
- Adjust Sigstore provenance verification logging to use a consistent
{PackageSpecifier}format. - Add cleanup to remove an empty
.playwrightdirectory afterplaywright-cli install --skills. - Update test fake
INpmRunnerimplementation to reportIsAvailable = true.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/TestServices/FakePlaywrightServices.cs | Updates fake npm runner availability to match new INpmRunner.IsAvailable usage in tests. |
| src/Aspire.Cli/Npm/SigstoreNpmProvenanceChecker.cs | Normalizes log fields/messages to use NpmPackageInfo.FormatPackageSpecifier(...). |
| src/Aspire.Cli/Agents/Playwright/PlaywrightCliRunner.cs | Adds best-effort cleanup of empty .playwright directory after skill installation. |
| logger.LogDebug("Removed empty .playwright directory from {WorkingDirectory}", workingDirectory); | ||
| } | ||
| } | ||
| catch (IOException ex) |
There was a problem hiding this comment.
CleanupEmptyPlaywrightDirectory runs in a finally block, so any exception it throws will override the install result and can fail an otherwise-successful install. Currently only IOException is caught, but Directory.GetFileSystemEntries/Directory.Delete can also throw UnauthorizedAccessException, SecurityException, DirectoryNotFoundException, etc. This cleanup should be best-effort: broaden the catch (or pre-check) so cleanup failures never escape the finally block.
| catch (IOException ex) | |
| catch (Exception ex) |
Description
Port of #15559 from release/13.2 to main.
Fix installing playwright-cli with
aspire agent initon Windows:IsAvailableproperty to testINpmRunnerimplementationsChecklist