Skip to content

Fix SQL polyglot AppHost test restore environment - #2529

Merged
aaronpowell merged 3 commits into
aaronpowell-go-apphost-example-parityfrom
aaronpowell-sql-polyglot-restore-fix
Nov 13, 2026
Merged

aaronpowell merged 3 commits into
aaronpowell-go-apphost-example-parityfrom
aaronpowell-sql-polyglot-restore-fix

Conversation

@aaronpowell

@aaronpowell aaronpowell commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Linked issue: Not identified. Relates to #2438.

Root cause

SqlProjectBuilderExtensions statically calls MSBuildLocator.RegisterDefaults(). Earlier SQL tests can thereby configure process-wide MSBUILD_EXE_PATH, MSBuildExtensionsPath, and MSBuildSDKsPath for SDK 10. The Go and TypeScript tests inherit those paths in the child Aspire integration build, which then encounters NETSDK1045 when restoring the integration's net11.0 target even though SDK 11 is installed.

In the diagnostic Ubuntu CI run, rebuilding the generated integration projects after the failures exposed NETSDK1045 for both AppHosts. The missing IntegrationRestore.csproj.nuget.dgspec.json is a symptom of the failed build, not the established root cause; Aspire suppresses detailed build output when that graph is absent. Clean, isolated restores pass because they do not inherit MSBuildLocator's process-wide paths. This contamination arises specifically in the SQL test assembly from its SQL integration's registration; other integration test projects do not run that SQL initialization, so the same explanation should not be assumed for them.

Fix

Temporarily clear those three variables around the SQL polyglot tests and restore their original values in finally, including when the test fails. The SQL test assembly disables parallel execution. Regression coverage verifies all three variables are cleared and restored on failure. Temporary diagnostic code was removed; Aspire remains at 17.0.0-preview.1.26555.11.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main) — separate repository branch
  • Based off latest main branch of toolkit — intentionally targets Add Go AppHost examples and parity coverage #2438
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • New integration (not applicable)
    • Docs are written (not applicable)
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that) (not applicable)
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Other information

Validation:

  • dotnet build tests\CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.Tests\CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.Tests.csproj --no-restore -c Release --verbosity quiet — passed locally with existing warnings.
  • From the SQL test project directory, with all three inherited MSBuild paths set to nonexistent locations: dotnet .\bin\Release\net10.0\CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.Tests.dll --filter-method '*GoAppHostCompiles' — passed using Aspire CLI 17.0.0-preview.1.26555.11.
  • From the same directory: dotnet .\bin\Release\net10.0\CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects.Tests.dll --filter-method '*RestoresMSBuildEnvironmentAfterFailure' — passed.
  • Hosted CI run 43159001917 ran dotnet run --project "$TEST_PROJECT_PATH" --no-build --configuration Release --crashdump --hangdump --hangdump-timeout 7m --results-directory "$GITHUB_WORKSPACE/testresults" --filter-not-trait "category=failing" --report-trx --report-trx-filename <matrix-name>.trx --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --report-github — SQL test jobs passed on Ubuntu and Windows. TRX confirms Go on both, TypeScript on Ubuntu, and the environment regression on both. Windows CI did not discover the Docker-required TypeScript test; local Docker is unavailable, so Windows TypeScript startup was not validated in this run.
  • The separate submit-nuget check failed restoring the unrelated Ollama AppHost with SDK 10 / NETSDK1045; it is outside this PR's scope. The .NET CI builds, SQL test jobs, package, and publish checks passed.

aaronpowell and others added 2 commits November 12, 2026 15:55
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aaronpowell aaronpowell changed the title Diagnose SQL polyglot AppHost restore failures Fix SQL polyglot AppHost test restore environment Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
CommunityToolkit.Aspire.Hosting.SqlDatabaseProjects 68% 59% 137 ➖
Summary 68% (267 / 391) 59% (58 / 98) 137 ➖

@aaronpowell
aaronpowell deployed to azure-artifacts November 12, 2026 05:12 — with GitHub Actions Active
@aaronpowell
aaronpowell marked this pull request as ready for review November 13, 2026 00:03
@aaronpowell
aaronpowell merged commit 9085b97 into aaronpowell-go-apphost-example-parity Nov 13, 2026
10 of 11 checks passed
@aaronpowell
aaronpowell deleted the aaronpowell-sql-polyglot-restore-fix branch November 13, 2026 01:17
aaronpowell added a commit that referenced this pull request Nov 16, 2026
* feat(adminer): add Go AppHost example

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat: add six Go AppHost examples

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat: add five more Go AppHost examples

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat: add Go messaging AppHost examples

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add five Go AppHost counterparts

Check endpoint wrapper errors in existing Go examples.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add Loki and Tempo Go AppHosts

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add GoFeatureFlag and KurrentDB Go AppHosts

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add Logto Go AppHost

Document the Umami parameter serialization blocker.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add SFTP Go AppHost

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add Solr Go AppHost

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add Listmonk Go AppHost

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: document Meilisearch Go SDK blocker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add MySQL extensions Go AppHost

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: document Redis Go SDK blocker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: document SQL Server Go SDK blocker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: document MCP Inspector Go SDK blocker

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test: cover affected Go AppHost test selection

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: record additional Go AppHost blockers

Distinguish Floci run-only behavior from SDK parity gaps.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test(k3s): validate existing Go AppHost parity

Align compile-only project APIs and surface model construction errors.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add first batch of Go AppHost counterparts

Add ActiveMQ, Azure extensions, Dapr, Azure Dapr, Data API Builder, DbGate, Deno, and Elasticsearch extensions examples. Preserve the TypeScript graphs and use exported sidecar references for Dapr. Document the ActiveMQ preview Go SDK serialization blocker.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add third batch of Go AppHosts

Add Perl, PowerShell, Rust, SQL Database Projects, Stripe, SurrealDB, and Zitadel counterparts preserving the TypeScript graphs. Document preview limitations for SQL native loading and optional Zitadel resource serialization.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* test: register Go AppHost batch coverage

Document ActiveMQ and SQL model validation limitations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* feat(examples): add second batch of Go AppHost counterparts

Add Flare, Floci, Java, JavaScript extensions, k6, Keycloak PostgreSQL, Kind and Ngrok Go examples with generated-SDK regression tests. Preserve preview API limitations and document compile-only coverage for optional parameter handles and the run-only Floci graph.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(examples): check Go endpoint wrapper errors

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* docs: clarify Go model validation gaps

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Fix SQL polyglot AppHost test restore environment (#2529)

* test: diagnose SQL polyglot restore failures

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: isolate SQL polyglot tests from MSBuild locator

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix(ci): align affected-tests selector restore and build targets

Explicitly target net10.0 so SDK 11's file-based default does not conflict with Directory.Build.props. Exercise the same restore-target override in existing Go selection tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant