Skip to content

Unblock Integration Data Updater and parallelize API regeneration - #1813

Merged
David Pine (IEvangelist) merged 3 commits into
microsoft:mainfrom
IEvangelist:ievangelist-fix-integration-data-updater
Oct 5, 2026
Merged

David Pine (IEvangelist) merged 3 commits into
microsoft:mainfrom
IEvangelist:ievangelist-fix-integration-data-updater

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the failing scheduled Integration Data Updater run, and makes API regeneration faster and more resilient.

Root cause. The TypeScript API phase failed with 144 succeeded, 2 failed, 7 skipped. The two failures were Aspire.Hosting.Azure.Provisioning.Kusto and Aspire.Hosting.Azure.Provisioning.Network (13.6.0-preview.1.26479.8).

The shipped Aspire CLI (13.6.0+56f3e9c0d) exports an inherited AddTo once per derived proxy type, all under the base type's capability ID. It reports every collision as a Duplicate capability error and exits 1, although it still writes the dump. Since #1599 the generator fails closed on any dump error, so the whole run aborted. The scanner fix is microsoft/aspire#20443.

Changes

  • Narrow tolerance (AtsJsonGenerator). The new --tolerate-known-scanner-diagnostics flag accepts only the inherited duplicate-capability diagnostic. Both definitions must be in the capability's namespace, on different types, with the same member name, and that name must match the capability method. Each defining type must also be a handle type in the dump that is the type owning the capability ID or lists it in HandleTypes.BaseTypeHierarchy, so unrelated types that share a capability ID still fail. Each tolerated message is printed, and any other error diagnostic still fails.

  • Fail-closed script wiring. generate-ts-api-json.ps1 passes the flag only when the CLI exits nonzero without timing out and still writes a dump. The package fails if nothing was actually tolerated.

  • Reporting (orchestrator). update-integration-data.ps1 emits a ::warning annotation for tolerated diagnostics. It also adds a Tolerated ATS scanner diagnostics section and a review checklist item to the PR body it generates. The section lists the packages and has a collapsible list of diagnostics.

  • Faster, more resilient TypeScript generation. generate-ts-api-json.ps1 processes packages concurrently in dependency waves:

    1. core
    2. independent packages
    3. packages that need a supporting scan context

    Up to min(cores, 8) packages run at a time. Set ASPIRE_TS_API_PARALLELISM to override this; -AspireRepoPath runs stay sequential. Each Aspire CLI dump and export call has a 10-minute timeout and gets up to 3 attempts. The transformer and the enum supplement each have a 5-minute timeout. Each package's log is printed as a block when that package finishes, so logs stay readable.

  • Faster C# generation. generate-package-json.ps1 restores package graphs concurrently and retries each restore up to 3 times. It honors -Parallelism and -Sequential, and its output and summary format are unchanged. Each restore's retry warnings and status line print together from the main runspace when that restore finishes.

  • Docs. Updated the update-integrations skill and both generator READMEs.

Reviewer notes

  • Remove the tolerance once the CLI that the workflow installs includes [release/13.6] Fix duplicate inherited ATS method exports aspire#20443. KnownScannerDiagnostics.cs says this too.
  • nuget.org replaced 13.6.0-preview.1.26478.8 with 13.6.0-preview.1.26479.8. The first bot PR will bump the 50 catalog entries that are pinned to 26478.8; this PR doesn't include that bump.
  • The next bot PR will remove an export from the Aspire.Hosting.Radius module. This isn't caused by this PR.
    • With the stable CLI, the regenerated module drops withDotnetProgramContainerImage, the IDotnetProgramResource overload of withContainerImage. This happens even with the Aspire.Hosting.Dotnet scan context, and the script on main drops it too.
    • The semantic validator doesn't check whether every export is present, so it won't flag this.
  • After merging, run gh workflow run update-integration-data.yml --repo microsoft/aspire.dev instead of waiting for the next scheduled run.

Third-party links and affiliations

None

Validation

All runs used the same Aspire CLI as CI (13.6.0+56f3e9c0d, set via ASPIRE_CLI_PATH) on a 20-core Windows machine. The default parallelism there was 8; CI's 4-vCPU runner will use 4.

  • dotnet test tests/AtsJsonGenerator.Tests: passed (37/37). This includes new tests that accept and report matching diagnostics. They also reject look-alike and unrelated errors, unrelated types that share a capability ID, and defining types missing from the dump's HandleTypes.
  • After the review fix, I re-dumped Kusto and Network with the stable CLI and ran the transformer with --tolerate-known-scanner-diagnostics. Both exited 0, with 5 and 2 diagnostics tolerated. Without the flag, both still fail.
  • After the second review fix (c644c4c7), I ran generate-package-json.ps1 on three packages with -Framework bogus -Parallelism 2 to force the retry and failure path. Each package's retry warnings and status line printed as one block from the main runspace, and failure details followed in package order. The script on eca5c048 interleaved output from concurrent restores. Success runs, in parallel and with -Sequential, produced identical JSON.
  • Upstream runners were backed up, so I also ran the PR checks that support workflow_dispatch on my fork at c644c4c7. All passed: Tools Tests (41 PackageJsonGenerator and 37 AtsJsonGenerator tests), Forbidden Words over 96fb149d..c644c4c7, and CodeQL (no C# alerts; the only JS/TS alert is in existing code this PR doesn't touch). All upstream checks passed on eca5c048, and c644c4c7 only changes generate-package-json.ps1.
  • pnpm exec vitest run --config vitest.config.ts tests/unit/update-integrations.vitest.test.ts (in src/frontend): passed (42/42).
  • End-to-end replay of the regeneration phases. I temporarily bumped the catalog to 26479.8, used a cold NuGet cache, and pointed ASPIRE_API_* at a staging directory.
    • pwsh src/tools/PackageJsonGenerator/generate-package-json.ps1 -OutputDir <stage>/pkgs: Done! Success: 210 | Failed: 0 | Skipped: 7 in 3:21.
    • pnpm run normalize:api-data -- --pkgs: passed.
    • pnpm run update:ts-api: Complete: 146 succeeded, 0 failed, 7 skipped in 4:05 (3:47 of it generation). It tolerated 5 Kusto and 2 Network diagnostics.
    • pnpm run validate:api-data: passed. It reconciled 217 package identities, matched 146 modules to C# provenance, checked 74 DTO shapes and 2,873 inheritance chains, and checked attribute payloads against HEAD.
    • Run against the real update:ts-api log, the orchestrator's parsing and PR-body code rendered both packages, all 7 diagnostics, and the ::warning annotation.
  • Comparison with the scripts on main, using the same inputs:
    • TypeScript: 3:48 in parallel vs 13:46 sequentially. All 122 modules that both runs produced are byte-identical. Both runs had the same failures for packages pinned to the deleted 26478.8 builds.
    • C#: 3:21 in parallel with a cold cache vs 8:28 sequentially with a warm cache. Both runs reported Success: 210 | Failed: 0 | Skipped: 7, and 208 of 210 files are byte-identical. The other 2 (Aspire.Hosting and Aspire.Hosting.JavaScript 13.6.0) differ only in sourceCommit, because my warm cache held a pre-release build of those packages.
  • For reference, the failed CI job spent 8m02s in C# generation and 12m46s in TypeScript generation before it failed.

The scheduled Integration Data Updater failed in the TypeScript API phase
because the shipped Aspire CLI (13.6.0) reports a known scanner defect as
"Duplicate capability" errors for inherited proxy AddTo methods in
Aspire.Hosting.Azure.Provisioning.Kusto and .Network. The scanner fix is in
microsoft/aspire#20443. Since the 13.6 content update, the generator fails
closed on any dump error, so the whole run aborted.

- AtsJsonGenerator: add --tolerate-known-scanner-diagnostics. It accepts only
  the inherited duplicate-capability diagnostic, prints each tolerated
  message, and still fails on any other error.
- generate-ts-api-json.ps1: generate packages concurrently in dependency
  waves (core, independent packages, scan-context packages), add timeouts and
  retries for the Aspire CLI and the transformer, and list tolerated
  diagnostics in the summary.
- update-integration-data.ps1: surface tolerated diagnostics as workflow
  warnings and in a PR-body section with a review checklist item.
- generate-package-json.ps1: restore package graphs concurrently, with
  retries.
- Update the update-integrations skill and the generator READMEs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The matcher can suppress genuine same-namespace duplicate capabilities without verifying inheritance.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Adds resilient, parallel API regeneration and a temporary ATS scanner-diagnostic tolerance.

Changes:

  • Parallelizes C# restores and TypeScript generation with retries and timeouts.
  • Tolerates and reports recognized inherited-capability diagnostics.
  • Documents the updated generation workflow.
File Description
tests/​AtsJsonGenerator.Tests/​AtsTransformerHelperTests.cs Tests diagnostic matching and rejection.
tests/​AtsJsonGenerator.Tests/​AtsJsonGeneratorTests.cs Tests reporting tolerated diagnostics.
src/​tools/​PackageJsonGenerator/​README.md Documents parallel restores and retries.
src/​tools/​PackageJsonGenerator/​generate-package-json.ps1 Parallelizes and retries package restores.
src/​tools/​AtsJsonGenerator/​README.md Documents generation behavior.
src/​tools/​AtsJsonGenerator/​Helpers/​KnownScannerDiagnostics.cs Recognizes tolerated scanner diagnostics.
src/​tools/​AtsJsonGenerator/​Helpers/​AtsTransformer.cs Adds optional diagnostic tolerance.
src/​tools/​AtsJsonGenerator/​GenerateCommand.cs Exposes the tolerance CLI option.
src/​tools/​AtsJsonGenerator/​generate-ts-api-json.ps1 Adds parallel waves, retries, timeouts, and reporting.
src/​frontend/​scripts/​update-integration-data.ps1 Surfaces tolerated diagnostics in CI and PR bodies.
.agents/​skills/​update-integrations/​SKILL.md Updates integration-generation guidance.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tools/AtsJsonGenerator/Helpers/KnownScannerDiagnostics.cs Outdated
The known-scanner-diagnostic tolerance matched only the message shape, so a
genuine collision between unrelated types that share a capability ID (for
example, Contoso.Generated/BaseProxy.addTo defined independently by FooProxy
and BarProxy) would also have been suppressed.

The matcher now also requires both defining types to be handle types in the
dump that are, or derive from, the type that owns the capability ID, per
HandleTypes.BaseTypeHierarchy. Types missing from the dump fail closed. The
affected Kusto and Network dumps from the stable CLI still tolerate all seven
diagnostics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@IEvangelist
David Pine (IEvangelist) enabled auto-merge (squash) October 2, 2026 14:13
@IEvangelist
David Pine (IEvangelist) requested a balanced review from Copilot October 2, 2026 18:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 Medium severity

Open (2)
Resolved since last review (1)

Comment thread src/tools/AtsJsonGenerator/generate-ts-api-json.ps1
Comment thread src/tools/PackageJsonGenerator/generate-package-json.ps1 Outdated
Invoke-PackageRestore runs inside ForEach-Object -Parallel workers, but it
wrote its status line with Write-Host and Resolve-NuGetPackageRestoreGraph
wrote retry warnings with Write-Warning from those workers, so output from
concurrent restores interleaved nondeterministically.

Capture retry warnings with -WarningVariable and return them, along with the
status details, as data. A new Write-PackageRestoreStatus function prints each
restore's warnings and status as one block on the main runspace as results
stream in, for both the parallel and sequential paths. Failure details are
still reported in package order after all restores finish.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@IEvangelist
David Pine (IEvangelist) merged commit 8ebddb7 into microsoft:main Oct 5, 2026
20 checks passed
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.

3 participants