Optimize TypeScript compatibility checks#17415
Conversation
Install the native TypeScript checker in the polyglot TypeScript validation image and run the validation AppHosts with bounded parallelism. This speeds up the compatibility validation while preserving per-AppHost failure reporting. Co-authored-by: Copilot <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 -- 17415Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17415" |
There was a problem hiding this comment.
Pull request overview
This PR speeds up TypeScript polyglot validation by switching per-AppHost type-checking from tsc to the native TypeScript checker (tsgo) and by running validations in bounded parallel batches to reduce overall wall-clock time in CI.
Changes:
- Install
@typescript/native-previewin the TypeScript validation container image and usetsgofor type-checking. - Update the TypeScript playground validation script to run AppHost validations in parallel batches, with per-AppHost isolated logs/results and a configurable max parallelism.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/polyglot-validation/test-typescript-playground.sh | Switches to tsgo and adds bounded parallel execution with per-AppHost logging/results. |
| .github/workflows/polyglot-validation/Dockerfile.typescript | Installs @typescript/native-preview (providing tsgo) into the validation image. |
Use the checked-in ATS release baseline from the target branch instead of regenerating the base surface for each PR. Invoke the already-built CLI and compatibility tool with dotnet exec, and generate current integration ATS files with bounded parallelism. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TypeScriptApiCompat targets net8.0, so use its net8.0 build output when verifying and invoking the already-built tool in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add an sdk dump output-directory mode that builds one capability scanner for many integrations and writes one ATS file per integration assembly. Use it in the TypeScript API compatibility workflow so the current PR surface is generated with one CLI/AppHost startup instead of one per integration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The workflow only needs the PR checkout plus the explicitly fetched base branch, so remove fetch-depth: 0 from the initial checkout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ignore ATS symbols owned by other packages when loading a package surface so release baselines that include referenced core symbols do not produce false package-local removals. Keep exported values unchanged because their paths are not consistently assembly-qualified. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mitchdenny
left a comment
There was a problem hiding this comment.
Reviewed for correctness. Two prefix-overmatch bugs and one minor logging concern. See inline comments.
mitchdenny
left a comment
There was a problem hiding this comment.
A few issues but approving assuming you’ll fix those up.
…sgo-compatibility # Conflicts: # .github/workflows/polyglot-validation/Dockerfile.typescript # .github/workflows/polyglot-validation/test-typescript-playground.sh
Use most-specific known package and assembly ownership when normalizing ATS surfaces and filtering diagnostics, and log batched sdk dump failures at warning level for CI visibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
❓ CLI E2E Tests unknown — 96 passed, 0 failed, 5 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #26381053515 |
|
See the workflow run for details: https://github.com/microsoft/aspire/actions/runs/26381935807 Added CLI reference documentation for the |
Description
The TypeScript API Compatibility check was doing unnecessary work on every pull request: it regenerated the base ATS surface even though the release baseline is already checked in, and it started a fresh CLI/AppHost scanner for each integration. This change makes the check compare against the checked-in release baseline and generate the PR surface with far fewer process/build cycles.
Actual changes in this PR:
dotnet execinstead ofdotnet run --no-build.aspire sdk dump --output-directoryso one capability-scanner AppHost can scan many integrations and write one ATS file per integration assembly.@typescript/native-preview, usetsgo, and run those AppHost type checks in bounded parallel batches.Measured CI improvement for Tests / TypeScript API Compatibility / TypeScript API Compatibility:
4dbcd268, run26338878979)9129483, run26340613003)Validation performed:
./restore.sh./dotnet.sh build src/Aspire.Cli/Aspire.Cli.csproj --configuration Release /p:SkipNativeBuild=true./dotnet.sh build tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --configuration Release /p:SkipNativeBuild=true./dotnet.sh test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --configuration Release --no-launch-profile -- --filter-class "*.SdkDumpCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"./dotnet.sh test --project tests/Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.csproj --configuration Release --no-launch-profile -- --filter-class "*.AtsContextFilterTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"./dotnet.sh test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj --configuration Release --no-launch-profile -- --filter-class "*.TypeScriptApiCompatTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"aspire sdk dump --format ci --output-directorysmoke test for Redis and Garnetsdk dumpoutputgit diff --checkFixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?