Repository navigation
[release/17.0] Close Go AppHost CLI preview readiness gaps - #22105
Jose Perez Rodriguez (joperezr) merged 3 commits into
Conversation
Isolate brownfield Go AppHosts, tighten doctor diagnostics, and address documentation and dev-server build regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
## Description Add focused product coverage for initializing a Go AppHost in a repository that already has a root Go module, with and without a root `go.work`. The existing application must remain buildable while the generated AppHost is independently buildable and runnable under `aspire-apphost`. **Merge dependency: #21823 must merge first.** This PR targets `ievangelist-go-apphost-epic` and depends on parent CLI commit `b959c96fcb`, which detects a root `go.mod`, nests the AppHost, and supplies a nested `go.work` containing `go 1.26` and `use .`. This is a separate, implementation-dependent test PR; it does not duplicate the CLI implementation. The two theory cases verify byte-for-byte preservation of root `go.mod`, `main.go`, and an existing `go.work` (or its continued absence). They assert nested `apphost.go`, `go.mod`, and `go.work`, build the original module, then restore, build, vet, start, and stop the nested host without overriding `GOWORK`. The test uses the existing Go Docker image and terminal/lifecycle helpers, with workspace capture on failure. Only `tests/Aspire.Cli.EndToEnd.Tests/GoRootModuleInitTests.cs` is added. Existing graph attribution selects CLI E2E tests, and existing `Go*` class discovery supplies the prebuilt Go image; no routing changes are required. Relates to #21201. ### Validation - `.\restore.cmd` — passed; installed the repository-pinned SDK and restored the repository. - `dotnet build tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-restore --verbosity quiet` — passed with 0 warnings and 0 errors. - `dotnet test --project tests\Aspire.Cli.EndToEnd.Tests\Aspire.Cli.EndToEnd.Tests.csproj --no-build --no-launch-profile --list-tests -- --filter-class '*.GoRootModuleInitTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed; discovered both `hasWorkspace: False` and `hasWorkspace: True`. Discovery only, not lifecycle execution. - `dotnet run --project tools\SelectTests -- --from b959c96 --explain` — passed; the single changed file is graph-attributed to `Aspire.Cli.EndToEnd.Tests`, with no unattributed files or run-all fallback. - `git diff --cached --check` — passed before commit. - An initial discovery invocation put `--list-tests` after `--` and failed with an SDK/test-host discovery-mode mismatch (exit 12); the corrected invocation above passed. **Linux lifecycle execution is explicitly unvalidated locally.** This host is Windows; the Hex1b scenarios require Linux, and no Linux CLI/archive containing parent commit `b959c96fcb` was available. The older shared stable consumer archive does not contain the nesting fix and was not used. PR CI must execute both cases using this PR's CLI artifacts; build and discovery do not establish lifecycle success. Auto-merge is not enabled. ## 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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22105Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22105" |
Tests selector3 / 101 PR test projects · 4 PR jobs, from 30 changed files. Selected PR test projects (3 / 101)
Selected PR jobs (4)
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. |
3850a1a
into
release/17.0
|
✅ No documentation update needed. excluded → backport. Exclusion reasons: |
Backport of #21823 to release/17.0
/cc David Pine (@IEvangelist)
Description
Standalone backport of Go AppHost CLI preview readiness fixes. Targets
release/17.0directly; the old chained backport #22002 is left untouched.Contributes to #21115, #21201, #21207, and #21208 without closing those umbrella issues.
Checklist
<remarks />and<code />elements on your triple slash comments?Customer Impact
aspire initcan initialize a Go AppHost inside an existing Go repository without replacing its application module or workspace. The change also corrects tooling checks and help, enables documentation-response decompression, and prevents copied file-based C# sources from entering subsequent dev-server compilations.Testing
Backport verification: the aggregate diff has the same stable patch ID as merged source commit
8e264bfdae2931bd41a485f908887db997127984:04b990263618ffbd44a817150577e5c356df6cdb. The PR targetsrelease/17.0directly and has no native stack membership.Source-PR validation, not rerun locally on this backport:
Passed: 61 tests after the final guard-scope adjustment. The source also records a combined CLI selection with 253 passed and TestTriggerMapTests with 174 passed. The broader selector namespace run was not green on the Windows host and is not counted as successful validation; details and controls are recorded in #21823.
No local release-branch tests were rerun. Release-branch CI was pending when this section was written; this is not a claim that backport CI has passed.
Risk
Medium. Touches shared scaffolding, tooling checks, HTTP clients, and dev-server build inputs in addition to the Go-specific behavior.
Regression?
Unknown. The source PR does not identify a regressing release.