Repository navigation
Archive CLI starter validation diagnostics before artifact upload - #22348
Ankit Jain (radical) wants to merge 3 commits into
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 <223556219+Copilot@users.noreply.github.com>
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 <223556219+Copilot@users.noreply.github.com>
|
🚀 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 <223556219+Copilot@users.noreply.github.com>
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 |
|
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. |

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. The uploader compresses the uncompressed tar. The test-trigger map selects both starter validation and
Infrastructure.Testsfor script-only changes.scratch-cli-platform-smoke.ymluses the same reusable workflow.Refs #22347. The
release/17.0backport is pending human merge of this main fix.Evidence: https://github.com/microsoft/aspire/actions/runs/43968755832/job/133671867903 (PR #22340, macOS x64).
Validation:
dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile /p:NuGetAudit=false -- --filter-class '*.StageCliStarterValidationDiagnosticsTests' --filter-class '*.TestTriggerMapTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true': passed 193/193.taronPATH, with its session-local libraries):dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --no-launch-profile --no-build /p:NuGetAudit=false -- --filter-class '*.StageCliStarterValidationDiagnosticsTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true': passed 5/5. The unchanged test binary had just been built in the same session../restore.sh: failed because the NuGet audit endpoint was unavailable, after installing the pinned SDK. Targeted builds/tests succeeded with the local-only/p:NuGetAudit=falseoverride; repository package/feed configuration is unchanged.action_required, despite aSUCCESScheck rollup. Human action is needed; no approval bypass or rerun was attempted. Hosted CI, actual macOS/Windows execution, and the intermittent production race remain unvalidated. Previous-head green retries do not validate this commit or establish first-attempt success.Checklist
<remarks />and<code />elements on your triple slash comments?