Skip to content

Archive CLI starter validation diagnostics before artifact upload - #22348

Open
Ankit Jain (radical) wants to merge 3 commits into
mainfrom
cif/22347-r1-main-fix
Open

Ankit Jain (radical) wants to merge 3 commits into
mainfrom
cif/22347-r1-main-fix

Conversation

@radical

@radical Ankit Jain (radical) commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Description

The macOS CLI starter validation job intermittently fails in "Upload starter validation diagnostics":

ENOENT: no such file or directory, stat '.../aspire-go-starter/AspireCliGoStarterSmoke/frontend/node_modules'

The starter's npm installer can still change node_modules after aspire stop returns. 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_modules before uploading, rather than maintaining a recursive copier. Only the completed starter-validation.tar is 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.Tests for script-only changes. scratch-cli-platform-smoke.yml uses the same reusable workflow.

Refs #22347. The release/17.0 backport is pending human merge of this main fix.

Evidence: https://github.com/microsoft/aspire/actions/runs/43968755832/job/133671867903 (PR #22340, macOS x64).

Validation:

  • GNU tar 1.35, PowerShell 7.5.4, Linux:
    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.
  • BSD tar 3.7.2, PowerShell 7.5.4, Linux (BSD tar exposed as tar on PATH, 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.
  • Tests cover retained file contents, nested dependencies, hidden files/directories, paths containing spaces, dangling/directory links, missing source and stale output, and tar exit codes 1/2 with partial output. The BSD run caught a hidden-file-pattern portability bug before the final implementation.
  • ./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=false override; repository package/feed configuration is unchanged.
  • Code-review skill completed locally; no outstanding findings after correcting hidden-file handling. Current-head CI run 44020721715 and six other workflows report action_required, despite a SUCCESS check 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

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

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>
@radical Ankit Jain (radical) added the cif-pr Pull request managed by the CIF CI automation group label Nov 16, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 16, 2026 23:58

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.

🟡 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_modules and 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

Comment thread eng/github-ci/test-trigger-map.yml Resolved
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>

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.

🟢 Approval recommended

No active review issues are recorded for the change to stage CLI starter diagnostics separately before artifact upload.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22348

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22348"

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

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>
@radical Ankit Jain (radical) changed the title Stage CLI starter validation diagnostics before artifact upload Archive CLI starter validation diagnostics before artifact upload Nov 17, 2026
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 17, 2026 04:58

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.

🔵 Needs a closer look

Current-head CI requires human action, leaving hosted macOS/Windows validation of the tar/upload changes and verification of the reported macOS race outstanding.

No open issues 🎉

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

1 / 101 PR test projects · 1 PR job, from 6 changed files.

Selected PR test projects (1 / 101)

Infrastructure.Tests

Selected PR jobs (1)

cli-starter-validation


How these were chosen — grouped by what changed

📄 .github/workflows/cli-starter-validation.yml (changed)
→ 1 directly: Infrastructure.Tests

📄 eng/github-ci/test-trigger-map.yml (changed)
→ 1 directly: Infrastructure.Tests

📄 eng/scripts/stage-cli-starter-validation-diagnostics.ps1 (changed)
→ 1 directly: Infrastructure.Tests

🧪 tests/Infrastructure.Tests/PowerShellScripts/StageCliStarterValidationDiagnosticsTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

🧪 tests/Infrastructure.Tests/TestTriggerMap/TestTriggerMapTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

Job reasons

Job Triggered by
cli-starter-validation .github/workflows/cli-starter-validation.yml, eng/scripts/cli-starter-validation.ps1, eng/scripts/stage-cli-starter-validation-diagnostics.ps1

Selection computed for commit 014fc59.

@radical
Ankit Jain (radical) marked this pull request as ready for review November 17, 2026 21:59

Copy link
Copy Markdown
Member Author

Ready for human review at head 014fc591cafcd2f5fca46cdb80451db718482759.

Current-head CI 44020721715 and native hosting validation 44020721077 completed successfully. CI attempt 1 was action_required; attempt 2 executed validation and passed. This does not establish first-attempt success.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cif-pr Pull request managed by the CIF CI automation group

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants