Skip to content

[release/17.0] Add Go AppHost initialization and stable restore E2E coverage - #22114

Merged
Jose Perez Rodriguez (joperezr) merged 1 commit into
release/17.0from
ievangelist-go-init-restore-backport
Nov 11, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 1 commit into
release/17.0from
ievangelist-go-init-restore-backport

Conversation

@IEvangelist

Copy link
Copy Markdown
Member

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 1b946a70114eaf152778109bd0b86df19ae47006 with git cherry-pick -x, without conflicts or adaptations, directly onto release tip cec195f2d0bf3f1d714badf74f205fa855fdf963. 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

  • 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

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

Exact command Result
.\restore.cmd Passed (exit 0); dependency-advisory warnings reported.
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 '*.CliInstallStrategyTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' Passed: 72 succeeded, 0 failed, 0 skipped. Tests the changed archive/stable-version helpers without Docker.
git diff --check upstream/release/17.0 HEAD Passed.
git diff --binary 1b946a70114eaf152778109bd0b86df19ae47006^ 1b946a70114eaf152778109bd0b86df19ae47006 compared with git diff --binary upstream/release/17.0 HEAD Exact diff text identical; all five changed files also have identical source/backport Git blob IDs.
git diff 1b946a70114eaf152778109bd0b86df19ae47006^ 1b946a70114eaf152778109bd0b86df19ae47006 | git patch-id --stable compared with git diff upstream/release/17.0 HEAD | git patch-id --stable Matching patch ID: 6dedbdbd911c022351e03d7b8fba822692d43b33.
git status --porcelain=v1 Clean after validation; no accepted snapshot drift.

Release runtime validation of GoCodegenValidationTests / GoStarterTemplateTests was not run: no ASPIRE_E2E_ARCHIVE is 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.

Exact source command Source result
.\restore.cmd Passed with 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" Source initial run: three initialization/codegen cases and normal-channel startup passed. An initially broader stable scenario failed at startup after restore/build/vet passed; the final patch separates stable restore/build from startup. Not a claim of a final all-green class run.
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" Source final stable restore/build case passed: 1 succeeded, 0 skipped, with a special consumer archive using the approved #21183 native CLI and real 17.0.99 packages. This setup is not available in this release worktree.
.\localhive.ps1 -Version 17.0.99 -Output .\artifacts\go-stable-e2e -Rid linux-x64 -Archive Source full stable archive attempt was blocked by NU5104; a consumer-only retry then hit Windows-to-Linux NativeAOT restrictions. No warning suppression or build-policy changes are included.

Risk

Low, test-only changes, with possible effects limited to E2E execution.

Regression?

Unknown; source does not identify a regressing release.

## 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)
@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 -- 22114

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

1 / 101 PR test projects · 0 PR jobs, from 4 changed files.

Selected PR test projects (1 / 101)

Aspire.Cli.EndToEnd.Tests

Selected PR jobs (0)

none


How these were chosen — grouped by what changed

🧪 tests/Aspire.Cli.EndToEnd.Tests/GoCodegenValidationTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/GoStarterTemplateTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliE2ETestHelpers.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/CliInstallStrategyTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

Job reasons

none


Selection computed for commit f264cd3.

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

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

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

@joperezr
Jose Perez Rodriguez (joperezr) merged commit fea7958 into release/17.0 Nov 11, 2026
319 of 321 checks passed
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ 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 --no-restore flag in the test plan). Changes are test and contributing docs only.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants