Add TypeScript API compatibility check#17103
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a TypeScript ATS API compatibility checker and wires it into PR validation to detect undeclared breaking changes against the target-branch baseline.
Changes:
- Adds a new
TypeScriptApiCompattool for parsing ATS surfaces, comparing compatibility, applying suppressions, emitting reports, and GitHub annotations. - Adds unit coverage for parsing, comparison, suppressions, and runner/report behavior.
- Adds CI workflow integration and documentation for baselines and suppressions.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/TypeScriptApiCompat/TypeScriptApiCompatRunner.cs |
Coordinates loading, comparison, suppression, reporting, annotations, and exit codes. |
tools/TypeScriptApiCompat/TypeScriptApiCompat.csproj |
Defines the new compatibility checker tool project. |
tools/TypeScriptApiCompat/Program.cs |
Adds command-line options and invokes the runner. |
tools/TypeScriptApiCompat/GitHubAnnotationWriter.cs |
Emits GitHub Actions error annotations for failures. |
tools/TypeScriptApiCompat/CommandLineOptions.cs |
Defines parsed command-line option values. |
tools/TypeScriptApiCompat/AtsSurfaceParser.cs |
Parses ATS CI dump text into compatibility model objects. |
tools/TypeScriptApiCompat/AtsSurface.cs |
Defines ATS surface records and surface loading. |
tools/TypeScriptApiCompat/AtsCompatibilityComparer.cs |
Implements breaking-change detection between baseline and current surfaces. |
tools/TypeScriptApiCompat/ApiCompatSuppression.cs |
Loads and validates suppression files. |
tools/TypeScriptApiCompat/ApiCompatResult.cs |
Applies suppressions and classifies result state. |
tools/TypeScriptApiCompat/ApiCompatReport.cs |
Produces Markdown compatibility reports. |
tools/TypeScriptApiCompat/ApiCompatDiagnostic.cs |
Defines compatibility diagnostics and suppression keys. |
tests/Infrastructure.Tests/TypeScriptApiCompat/TypeScriptApiCompatTests.cs |
Adds tests for parser, comparer, suppressions, and runner output. |
tests/Infrastructure.Tests/Infrastructure.Tests.csproj |
References the new tool from infrastructure tests. |
docs/ci/typescript-api-compat.md |
Documents baseline behavior, breaking-change kinds, and suppression format. |
Aspire.slnx |
Adds the new tool project to the solution. |
.github/workflows/typescript-api-compat.yml |
Adds reusable PR-side TypeScript API compatibility workflow. |
.github/workflows/tests.yml |
Adds the compatibility workflow to PR test validation and final results. |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17103Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17103" |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ypescript-api-compat
|
🎬 CLI E2E Test Recordings — 85 recordings uploaded (commit View all recordings
📹 Recordings uploaded automatically from CI run #25948640209 |
mitchdenny
left a comment
There was a problem hiding this comment.
I wonder if some of these mgiht be good to implement as roslyn analyzers?
|
Built the tool locally and ran it through its paces. Build
Dynamic scenariosUsing
Code reviewWalked parser robustness (CRLF/LF/BOM handled via No bugs to flag. The mergeable-baseline design ( LGTM. Nice tool. |
|
See the workflow run for details: https://github.com/microsoft/aspire/actions/runs/26103895726 Added a new TypeScript API compatibility section to |
Description
Adds a PR-side TypeScript API compatibility check for the ATS surface used to generate polyglot AppHost SDKs. This prevents pull requests from introducing undeclared breaking changes after the baseline has been established, while still allowing intentional breaks through explicit suppressions with traceability.
The implementation adds a dedicated
TypeScriptApiCompattool, a reusable CI workflow wired into PR validation, tests covering parsing/comparison/suppressions/reporting, and documentation for baseline resets and suppression format. The check compares the target-branch ATS baseline against freshaspire sdk dump --format cioutput from the PR so baseline edits in the PR cannot hide breaks.Fixes #17041
Checklist
<remarks />and<code />elements on your triple slash comments?