Repository navigation
[release/17.0] Add Go AppHost initialization and stable restore E2E coverage - #22114
Conversation
## Description Adds focused Go AppHost E2E coverage for the initialization and package-resolution gaps identified while reviewing the Preview flag-removal PR. - Extends SDK-refresh coverage to interactive init, non-interactive `init --language go` in an empty directory, and non-interactive init alongside an existing Go application. The brownfield case verifies source preservation and wires the existing application through the default Go integration. - Builds and vets the consumer and explicitly vets the generated `.aspire/modules` module, which Go's root `./...` traversal skips. - Adds a separate stable-identity starter restore/build test with an isolated NuGet cache, exact Go/Redis package pins, SDK regeneration, and NuGet metadata assertions proving the packages came from the local hive. - Retains normal-channel starter startup coverage and adds guaranteed stop cleanup after resource assertions. Contributes to #21108 and #21110; companion coverage for #21183. This does not close either readiness issue or include the flag-removal changes. Existing flag-setup calls are unchanged so #21183 can remove them as planned. ### Execution lanes Initialization, code generation, build/vet, and normal-channel startup run in the existing regular CLI E2E lane. The stable restore/build test requires a stable-shaped local-hive archive and explicitly skips ordinary prerelease PR archives, matching the existing stable-emulation tests. The stabilization job in `ci.yml` is currently hard-disabled; this PR does not enable it or claim automated stable-release gating. The existing runtime-package routes already cover Go, its generator, Redis and SQL Server. The selector attributes the changed test files to `Aspire.Cli.EndToEnd.Tests`; no map changes are required. ### Validation | Command | Result | | --- | --- | | `.\restore.cmd` | Passed; reported existing dependency-advisory warnings. | | `dotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore -m:2 -v:quiet` | Passed, 0 warnings, 0 errors. | | `dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-class "*.GoCodegenValidationTests" --filter-class "*.GoStarterTemplateTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Initial run: all three init/codegen cases and normal-channel startup passed. An initially broader stable scenario failed at startup, after restore/build/vet passed, because the PR-stamped binary requested its original prerelease SDK from nuget.org. Stable restore/build is now a separate test, scoped to the requested package-resolution coverage. | | `dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method "*.RestoreAndBuildGoStarterFromStablePackages" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"` | Passed, 1 test, 0 skipped, against the final stable restore/build scenario. | | `.\localhive.ps1 -Version 17.0.99 -Output .\artifacts\go-stable-e2e -Rid linux-x64 -Archive` | Blocked by NU5104 for stable component packages depending on preview .NET 11 packages. The pack excludes the changed test project. A consumer-only retry with `$env:NoWarn='NU5104'` packed the packages, then hit Windows-to-Linux NativeAOT dashboard publishing restrictions. No warning suppression or build-policy changes are committed. | | `git diff --check` | Passed. | For the Docker executions, `ASPIRE_E2E_POLYGLOT_GO_IMAGE=aspire-go-e2e-6972:latest` selected an existing Go 1.26.10 image. `ASPIRE_E2E_ARCHIVE` pointed to a consumer archive assembled from the approved #21183 native CLI (`ecee5b208e`) and real `17.0.99` packages built from this worktree. This validates the consumer scenarios, not a fully rebuilt stable native bundle or stable-identity startup. Linux stable-hive reproduction commands are documented in `docs/contributing.md`. ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No --------- Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit 1b946a7)
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22114Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22114" |
Tests selector1 / 101 PR test projects · 0 PR jobs, from 4 changed files. Selected PR test projects (1 / 101)
Selected PR jobs (0)none How these were chosen — grouped by what changed🧪 🧪 🧪 🧪 Job reasonsnone Selection computed for commit |
There was a problem hiding this comment.
🔵 Needs a closer look
Release-branch Docker E2E validation remains unperformed, including restore/provenance testing with a stable-shaped archive, and source validation used a composite CLI/package bundle rather than a matching release build.
No open issues 🎉
What changed in this PR
Backports #21806 to release/17.0, adding Go AppHost initialization and stable-package restore coverage without changing production behavior.
Changes:
- Covers interactive and non-interactive initialization, existing Go source preservation, SDK refresh, and build/vet checks.
- Adds stable-identity restore coverage with an isolated NuGet cache and local-hive package provenance assertions, while retaining normal-channel startup coverage.
- Documents archive prerequisites and execution limits. Release-branch build and helper tests passed; Docker runtime scenarios were not run.
| File | Description |
|---|---|
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliInstallStrategyTests.cs | Tests stable-version detection from archive entries. |
| tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs | Adds stable package-version discovery in local-hive archives. |
| tests/Aspire.Cli.EndToEnd.Tests/GoStarterTemplateTests.cs | Adds stable restore/provenance checks, build/vet validation, and startup cleanup. |
| tests/Aspire.Cli.EndToEnd.Tests/GoCodegenValidationTests.cs | Expands initialization, source-preservation, and generated SDK coverage. |
| docs/contributing.md | Documents Go E2E execution and stable-archive prerequisites. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
fea7958
into
release/17.0
|
✅ No documentation update needed. excluded → base_branch_is_release, title_release_prefix, body_backport_marker. This is a backport of #21806 (docs belong to the forward PR). Triggered signals: pr_body_has_cli_flag_mention (only a dotnet |
Description
Backport of #21806 to
release/17.0, protecting Go AppHost initialization, source preservation, generated SDK build/vet, and stable restore package provenance. Test and contributing-documentation changes only; no production behavior change.This standalone replacement for closed #21998 cherry-picks the exact final merged squash
1b946a70114eaf152778109bd0b86df19ae47006withgit cherry-pick -x, without conflicts or adaptations, directly onto release tipcec195f2d0bf3f1d714badf74f205fa855fdf963. It has no stack or PR dependencies. It does not reopen or modify the previous stack, retry the bot, merge, or enable auto-merge.Relates to #21108 and #21110; neither issue is closed by this PR.
Checklist
<remarks />and<code />elements on your triple slash comments?Customer Impact
Adds coverage protecting Go AppHost initialization, existing application source preservation, generated SDK build/vet, and stable-package restore provenance. No production behavior change.
Testing
Release-branch validation performed for this PR
.\restore.cmddotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore -m:2 -v:quietdotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-class '*.CliInstallStrategyTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'git diff --check upstream/release/17.0 HEADgit diff --binary 1b946a70114eaf152778109bd0b86df19ae47006^ 1b946a70114eaf152778109bd0b86df19ae47006compared withgit diff --binary upstream/release/17.0 HEADgit diff 1b946a70114eaf152778109bd0b86df19ae47006^ 1b946a70114eaf152778109bd0b86df19ae47006 | git patch-id --stablecompared withgit diff upstream/release/17.0 HEAD | git patch-id --stable6dedbdbd911c022351e03d7b8fba822692d43b33.git status --porcelain=v1Release runtime validation of
GoCodegenValidationTests/GoStarterTemplateTestswas not run: noASPIRE_E2E_ARCHIVEis configured and no existing archive is present under this worktree's artifacts. No local-hive or native AOT build was initiated. The stable restore case additionally requires a stable-shaped local-hive archive. These runtime scenarios are not claimed as passed or as automated stable-release gating.Source PR evidence only (not release-branch validation)
Source #21806 records a clean E2E-project build, passing initialization/codegen and normal-channel startup cases, and one passing stable restore/build case. Full stable native-bundle build/startup was not validated.
.\restore.cmddotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore -m:2 -v:quietdotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-class "*.GoCodegenValidationTests" --filter-class "*.GoStarterTemplateTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-launch-profile -- --filter-method "*.RestoreAndBuildGoStarterFromStablePackages" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true".\localhive.ps1 -Version 17.0.99 -Output .\artifacts\go-stable-e2e -Rid linux-x64 -ArchiveRisk
Low, test-only changes, with possible effects limited to E2E execution.
Regression?
Unknown; source does not identify a regressing release.