Skip to content

[ci] Archive CLI starter validation diagnostics before artifact upload - #22348

Merged
Damian Edwards (DamianEdwards) merged 4 commits into
mainfrom
cif/22347-r1-main-fix
Nov 24, 2026
Merged

Damian Edwards (DamianEdwards) merged 4 commits into
mainfrom
cif/22347-r1-main-fix

Conversation

@radical

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

Copy link
Copy Markdown
Member

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 8848ddee8533bee493addca4155693c0a4d35ee8

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Native macOS archive and routing tests passed 193/193; binary-xattr probe preserved log contents and restored the environment.
↓ New-head hosted Linux/Windows execution and the intermittent upload race remain unverified; CI is running.
Diagnosis confidence 9/10 ↑ Reported uploader failure names the changing dependency directory excluded by tar; native macOS baseline reproduced synthesized hidden metadata entries.
↓ The original installer/upload race was not reproduced end-to-end.
Evidence fit 8/10 ↑ The retained failure evidence matches the starter job, upload step, and frontend/node_modules path addressed by this archive boundary.
↓ 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":

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. macOS filesystem metadata is omitted using the existing CreateLayout approach, so synthesized AppleDouble entries cannot bypass hidden-file exclusions. The uploader compresses the uncompressed tar.

The tests invoke the existing PowerShellCommand harness directly, retaining its timeout, output capture, and process cleanup. 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.

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

Validation:

  • macOS 27.2.1 arm64, .NET SDK 11.0.100, PowerShell 7.6.6, BSD tar 3.5.3 / libarchive 3.7.4:
    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.
  • The native macOS baseline at 014fc591cafcd2f5fca46cdb80451db718482759 failed two of the five archive scenarios on unexpected ._validation entries. The unchanged assertions now pass; Linux-only infrastructure CI would not exercise Apple's synthesized metadata.
  • 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.
  • A native tar probe with an injected binary macOS xattr retained the log, omitted the xattr and synthesized metadata files, and confirmed that the script restores the caller's 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.0 backport is pending human merge of this main fix.

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 <[email protected]>
@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 <[email protected]>

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 <[email protected]>
@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

This comment has been minimized.

@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.

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]>
@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 8848dde.

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 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

@radical Ankit Jain (radical) changed the title Archive CLI starter validation diagnostics before artifact upload [ci] Archive CLI starter validation diagnostics before artifact upload Nov 24, 2026
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 fixes-ci pr:needs-maintainer Maintainer must take the next action (review/merge/decision)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants