Share generated integration closure infrastructure - #19915
Share generated integration closure infrastructure#19915David Negstad (danegsta) wants to merge 11 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2dd71101-249d-428b-81e7-9b247b9b3a2a
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d38799a7-a99c-48c5-b45b-9d6594dd1830
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d38799a7-a99c-48c5-b45b-9d6594dd1830
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 19915Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 19915" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Filesystem-path deduplication can omit references, explicit hosting overrides can conflict, and credential-bearing restore metadata remains persisted.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Centralizes generated integration project, restore-source, closure-manifest, cache-path, and runtime-environment infrastructure.
Changes:
- Adds shared project and closure generation models.
- Consolidates restore-source resolution and cache handling.
- Expands tests for closure generation, source handling, and path normalization.
File summaries
| File | Description |
|---|---|
src/Aspire.Cli/Projects/CSharpProjectFile.cs |
Adds generated C# project model. |
src/Aspire.Cli/Projects/IntegrationClosureBuilder.cs |
Centralizes closure generation and reading. |
src/Aspire.Cli/Projects/IntegrationClosureEnvironment.cs |
Centralizes integration environment setup. |
src/Aspire.Cli/Projects/IntegrationRestoreSourceResolver.cs |
Consolidates restore-source resolution. |
src/Aspire.Cli/Projects/PrebuiltAppHostServer.cs |
Adopts shared closure and restore infrastructure. |
src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs |
Uses the shared project model. |
src/Aspire.Cli/Utils/CliPathHelper.cs |
Adds shared cache-path helpers. |
tests/Aspire.Cli.Tests/Projects/PrebuiltAppHostServerTests.cs |
Extends prebuilt-server coverage. |
tests/Aspire.Cli.Tests/Projects/AppHostServerProjectTests.cs |
Covers explicit-channel source selection. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 3
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
It changes shared restore, cache, generated-project, and runtime setup paths that warrant final human validation despite no definite defect found.
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Generated projects can fail with NETSDK1022 because appsettings.json is emitted as a duplicate None Include item.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f88e5112-114e-41f8-af5a-930b169bc353
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
Cache ownership across symlinks and manifest path preservation have correctness issues.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f88e5112-114e-41f8-af5a-930b169bc353
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
The central generated MSBuild contract lacks a build-backed test that verifies its targets and redirected outputs actually execute correctly.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/Aspire.Cli/Projects/IntegrationClosureBuilder.cs:83
- The new shared MSBuild contract is only checked as serialized XML. The project-reference tests stub
BuildAsyncand write the closure files directly (PrebuiltAppHostServerTests.cs:2867-2873, 2919-2955), so they cannot catch regressions in_ResolvedProjectReferencePaths, target execution, or the redirectedobj/binpaths. Add a test that builds a minimal generated project with a localProjectReferenceand verifies the emitted closure and project-reference files under the configured restore directory.
- Files reviewed: 8/8 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f88e5112-114e-41f8-af5a-930b169bc353
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f88e5112-114e-41f8-af5a-930b169bc353
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
Cache ownership is incorrect when a workspace AppHost path is a symlink to an external directory.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/Aspire.Cli/Projects/IntegrationClosureBuilder.cs:143
- Canonicalizing
appHostDirectorybefore workspace discovery changes cache ownership for symlinked AppHosts. If<workspace>/apphostpoints to a directory outside the workspace,GetIntegrationCacheDirectorystarts from the external target, misses the workspace'saspire.config.json, and places the cache outside<workspace>/.aspire. Discover the cache root from the lexical path, canonicalize that root separately, and use the canonical AppHost path only for the hash.
- Files reviewed: 8/8 changed files
- Comments generated: 0 new
- Review effort level: Balanced
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔵 Needs a closer look
The cross-platform cache and generated-MSBuild changes warrant final human validation despite no confirmed defects found.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f88e5112-114e-41f8-af5a-930b169bc353
Tests selector2 / 99 PR test projects · 4 PR jobs · 1 advisory-only target, from 8 changed files. Selected PR test projects (2 / 99)
Selected PR jobs (4)
Advisory workflow impact (1)
How these were chosen — grouped by what changed📦 affected project 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
PR Testing ReportPR Information
Artifact Version Verification
Changes AnalyzedFiles Changed
Change Categories
Test Scenarios ExecutedScenario 1: TypeScript AppHost with local C# integrationObjective: Verify that the PR CLI builds a local C# hosting integration through the shared generated closure, generates its TypeScript API, and starts a resource that uses the exported API. Coverage Type: Happy path Status: Passed Steps:
Evidence:
Observations:
Scenario 2: Referenced integration refreshObjective: Verify that changing the local integration invalidates and rebuilds the closure instead of retaining stale generated APIs. Coverage Type: Boundary Status: Passed Steps:
Evidence:
Observations:
Scenario 3: Invalid referenced integrationObjective: Verify that a compile failure in the referenced project stops AppHost preparation and is not masked by the previously valid closure. Coverage Type: Unhappy path Status: Passed Steps:
Expected Outcome: AppHost preparation fails safely with the integration build diagnostic and does not start from stale generated output. Evidence:
Observations:
Environment ObservationThe initial online Summary
Overall ResultPR VERIFIED The artifact matched the current PR head and all targeted shared-closure scenarios passed. The only delay was an external NPM registry stall also reproduced on |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Description
Polyglot AppHost paths previously generated and interpreted integration projects independently, making their project shape, closure manifests, output paths, project-reference discovery, and runtime setup prone to drift.
This change introduces shared
CSharpProjectFile,IntegrationClosureBuilder, andIntegrationClosureEnvironmentinfrastructure. The generated project paths now use the same closure contract and cache layout, including project-reference assembly discovery.This is the foundational PR for #19763, which adds shared NuGet restore-source and configuration composition plus restore hardening on top.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?