Repository navigation
[ci] Archive CLI starter validation diagnostics before artifact upload - #22348
Conversation
upload-artifact fails with ENOENT when a starter's node_modules changes after it enumerates the upload root. Upload a private copy without node_modules instead. Refs #22347 Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Script-only changes can skip StageCliStarterValidationDiagnosticsTests because the script is missing from the Infrastructure.Tests trigger rule, leaving a runtime consumer untested.
1 open issue
What changed in this PR
This PR addresses the diagnostics-upload race tracked in #22347 by staging CLI starter validation output separately from generated projects that installers may still modify.
Changes:
- Add a staging script that excludes
node_modulesand directory symbolic links, while tolerating entries that disappear during copying. - Upload the staged directory and clarify that dependency cleanup remains best effort.
- Add behavioral tests and route script changes to starter validation.
| File | Description |
|---|---|
tests/Infrastructure.Tests/PowerShellScripts/StageCliStarterValidationDiagnosticsTests.cs |
Tests copying, exclusions, dangling links, and missing-source behavior. |
eng/scripts/stage-cli-starter-validation-diagnostics.ps1 |
Creates an isolated diagnostics copy for upload. |
eng/scripts/cli-starter-validation.ps1 |
Clarifies the cleanup rationale in comments; no behavior change. |
eng/github-ci/test-trigger-map.yml |
Routes staging-script changes to starter validation. |
.github/workflows/cli-starter-validation.yml |
Stages diagnostics before uploading the copied directory. |
Review effort: Balanced
StageCliStarterValidationDiagnosticsTests loads the script at runtime, so script-only changes must also select Infrastructure.Tests. Co-authored-by: Copilot <[email protected]>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22348Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22348" |
This comment has been minimized.
This comment has been minimized.
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Exclude dependencies and hidden files, retain generated sources, and publish only completed archives. Cover GNU/BSD tar behavior and archive failures. Co-authored-by: Copilot <[email protected]>
This comment has been minimized.
This comment has been minimized.
|
Ready for human review at head Current-head CI 44020721715 and native hosting validation 44020721077 completed successfully. CI attempt 1 was All six starter-validation platforms passed and produced nonempty diagnostics artifacts. Both macOS variants executed the new archive and upload steps successfully, including the affected macOS x64 job. Infrastructure.Tests also passed. Code-review skill completed on this published head with no findings; all review threads are resolved, with no new feedback. The earlier description of hosted validation as pending is superseded by these results. The intermittent race is not claimed to have been reproduced in this successful run, and long-term reliability is not yet established. Refs #22347; the release/17.0 backport remains pending human merge of this main fix. No workflow was dispatched or rerun by this worker. |
Use the existing PowerShellCommand harness directly instead of a file-local RunScript wrapper. Preserve output capture, process cleanup, the two-minute timeout, and every archive assertion. macOS tar synthesizes AppleDouble entries despite hidden-file exclusions. Follow tools/CreateLayout/Program.cs by disabling copyfile metadata and macOS extended attributes. This also avoids binary PAX attributes that .NET's TarReader cannot parse. Restore the caller's environment afterward. Refs #22347 Co-authored-by: Copilot App <[email protected]>
Tests selector1 / 101 PR test projects · 1 PR job, from 6 changed files. Selected PR test projects (1 / 101)
Selected PR jobs (1)
How these were chosen — grouped by what changed📄 📄 📄 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
Current-head CI is still running, leaving cross-platform archive/upload behavior and the intermittent installer/upload race unvalidated pending human review of hosted jobs and retained diagnostics artifacts.
No open issues 🎉
Review effort: Balanced

Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
8848ddee8533bee493addca4155693c0a4d35ee8↓ New-head hosted Linux/Windows execution and the intermittent upload race remain unverified; CI is running.
↓ The original installer/upload race was not reproduced end-to-end.
↓ The macOS metadata correction addresses archive correctness, not proof of the original race's timing.
Description
The macOS CLI starter validation job intermittently fails in "Upload starter validation diagnostics":
The starter's npm installer can still change
node_modulesafteraspire stopreturns. The pinned uploader enumerates paths and then stats each result; a disappearing entry fails the upload. Negative upload globs remove results but still traverse excluded directories.Archive the diagnostics with
tar --exclude=node_modulesbefore uploading, rather than maintaining a recursive copier. Only the completedstarter-validation.taris uploaded; failed creation removes the partial archive and fails the step. All nonzero tar exits remain errors, including files changing or disappearing outside excluded directories. This is not an atomic filesystem snapshot.The archive retains generated project sources/manifests and diagnostics under the validation-root directory. It preserves the uploader's default exclusion of hidden files/directories and records symbolic links without following their targets. macOS filesystem metadata is omitted using the existing
CreateLayoutapproach, so synthesized AppleDouble entries cannot bypass hidden-file exclusions. The uploader compresses the uncompressed tar.The tests invoke the existing
PowerShellCommandharness directly, retaining its timeout, output capture, and process cleanup. The test-trigger map selects both starter validation andInfrastructure.Testsfor script-only changes.scratch-cli-platform-smoke.ymluses the same reusable workflow.Evidence: https://github.com/microsoft/aspire/actions/runs/43968755832/job/133671867903 (PR #22340, macOS x64).
Validation:
MSBUILDTERMINALLOGGER=false dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile -- --filter-class '*.StageCliStarterValidationDiagnosticsTests' --filter-class '*.TestTriggerMapTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true': passed 193/193, no skipped tests, against the final source committed as the assessed revision.014fc591cafcd2f5fca46cdb80451db718482759failed two of the five archive scenarios on unexpected._validationentries. The unchanged assertions now pass; Linux-only infrastructure CI would not exercise Apple's synthesized metadata.COPYFILE_DISABLE../restore.sh: passed, zero warnings/errors. No package/feed configuration or audit override was changed.Current-head hosted execution and the intermittent production race remain unvalidated. The prior-head CI run succeeded at attempt 2 with all six starter platform jobs successful; it does not validate the assessed revision or establish first-attempt reliability. Local Linux validation could not run because the Docker daemon socket is absent.
Refs #22347. The
release/17.0backport is pending human merge of this main fix.Checklist
<remarks />and<code />elements on your triple slash comments?