Skip to content

[release/17.0] Close Go AppHost CLI preview readiness gaps - #22105

Merged
Jose Perez Rodriguez (joperezr) merged 3 commits into
release/17.0from
backport/pr-21823-to-release/17.0
Nov 11, 2026
Merged

Jose Perez Rodriguez (joperezr) merged 3 commits into
release/17.0from
backport/pr-21823-to-release/17.0

Conversation

@aspire-repo-bot

@aspire-repo-bot aspire-repo-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #21823 to release/17.0

/cc David Pine (@IEvangelist)

Description

Standalone backport of Go AppHost CLI preview readiness fixes. Targets release/17.0 directly; the old chained backport #22002 is left untouched.

Contributes to #21115, #21201, #21207, and #21208 without closing those umbrella issues.

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

aspire init can 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 targets release/17.0 directly and has no native stack membership.

Source-PR validation, not rerun locally on this backport:

dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-restore --no-launch-profile -- --filter-class '*.GoAppHostToolingCheckTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'

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.

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

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

3 / 101 PR test projects · 4 PR jobs, from 30 changed files.

Selected PR test projects (3 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Infrastructure.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

📄 eng/github-ci/test-trigger-map.yml (changed)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Cli/Resources/InitCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

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

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

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

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

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

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

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

🧪 tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_Help_ShowsFileBasedOption.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Infrastructure.Tests/TestTriggerMap/TestTriggerMapTests.cs (changed test)
→ 1 directly: Infrastructure.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Program.cs, src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs, src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs, src/Aspire.Cli/Resources/InitCommandStrings.resx, src/Aspire.Cli/Resources/xlf/InitCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.zh-Hant.xlf, src/Aspire.Cli/Scaffolding/ScaffoldingService.cs, src/Aspire.Cli/Utils/EnvironmentChecker/GoAppHostToolingCheck.cs, src/Aspire.Cli/Utils/EnvironmentChecker/TypeScriptAppHostToolingCheck.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 227973f.

@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 3850a1a into release/17.0 Nov 11, 2026
432 of 435 checks passed
@aspire-repo-bot

Copy link
Copy Markdown
Contributor Author

✅ No documentation update needed.

excluded → backport. Exclusion reasons: base_branch_is_release, head_branch_is_backport, title_release_prefix, body_backport_marker (title prefixed [release/17.0], body says "Backport of #21823"). Triggered signals: cli_resource_strings_changed (InitCommandStrings.resx), pr_body_has_cli_flag_mention. Docs belong to the original forward PR.

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