Repository navigation
Make Integration Data Updater tolerate package failures and track them in one issue - #2047
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical gaps in failed-package preservation, version validation, and batch reconciliation can abort updates before failure reporting or publish inconsistent artifacts.
4 open issues
What changed in this PR
Following #1961, this PR aims to let the Integration Data Updater refresh successful packages despite individual API-generation failures and track failures in one GitHub issue.
Changes:
- Replaces the C# generator’s failure abort with preservation of existing files for failed packages.
- Adds updater warnings, PR-body details, and an
api_failuresoutput. - Adds workflow logic to create, update, or close a failure-tracking issue.
| File | Description |
|---|---|
src/tools/PackageJsonGenerator/generate-package-json.ps1 |
Allows partial generation and exempts failed packages from stale-file deletion. |
src/frontend/scripts/update-integration-data.ps1 |
Collects package failures and includes them in workflow outputs and PR descriptions. |
.github/workflows/update-integration-data.yml |
Adds issue tracking based on reported API-generation failures. |
Review effort: Balanced
| Stop-ApiRegeneration "C# API generation reported $($Matches.Failed) package failure(s). Aborting; no PR will be opened." | ||
| $pkgFailedLine = ($pkgLog -split "`n" | Where-Object { $_ -match '^\s*Failed packages:' } | Select-Object -First 1) | ||
| $pkgFailedPackages = if ($pkgFailedLine) { ($pkgFailedLine -replace '^\s*Failed packages:\s*', '').Trim() } else { "$($Matches.Failed) unnamed package(s)" } | ||
| Write-Warning "C# API generation failed for: $pkgFailedPackages. Continuing; existing data for these packages is kept." |
Comment on lines
1231
to
+1232
| if ($failCount -gt 0) { | ||
| Remove-Item -Path $OutputDir -Recurse -Force -ErrorAction SilentlyContinue | ||
| exit 1 | ||
| Write-Warning "Skipping $failCount package(s) that failed to generate; their existing data is kept." |
| if ($isFullReconciliation) { | ||
| foreach ($existingFile in Get-ChildItem -Path $FinalOutputDir -Filter "*.json" -File) { | ||
| if (-not $stagedNames.Contains($existingFile.Name)) { | ||
| if (-not $stagedNames.Contains($existingFile.Name) -and -not (Test-IsFailedPackageFile $existingFile.Name)) { |
Comment on lines
+239
to
+244
| if [ -z "$existing" ]; then | ||
| gh issue create --title "$title" --body "$body" | ||
| elif ! gh issue view "$existing" --json body --jq .body | grep -qF "$marker"; then | ||
| gh issue edit "$existing" --body "$body" | ||
| gh issue comment "$existing" --body "The set of failing packages changed: $RUN_URL" | ||
| fi |
Contributor
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
David Pine (IEvangelist)
deleted the
ievangelist-nonfatal-api-failures
branch
November 4, 2026 12:14
David Pine (IEvangelist)
added a commit
that referenced
this pull request
Nov 4, 2026
## Summary <!-- Describe what this pull request changes and why. --> Fix the complete package-failure path exposed by updater run 41827585564, rather than only suppressing its next validation error. Merge current `main` into this branch to resolve the conflict left by the squash merge of #2047. - Seed staging from committed API artifacts so failed packages actually retain their last-good data. When TypeScript generation fails after C# advances, restore both artifacts as a matching pair and rebuild the declarations. - Persist each failure's package, exact catalog version, generation stage, and reason in `src/frontend/src/data/api-generation-failures.json`. Both the updater and the generated data PR's CI use these narrowly deferred updates; other identity, provenance, exported-module, and declaration checks remain strict. - Retry pending failures even when catalog versions have not changed; clear the report on recovery. - Emit diagnostics immediately after each generator, before later phases can abort. Report package failures regardless of update-step success; do not close the issue after an incomplete generation pass. - Reuse one tracking issue, including reopening it on recurrence. Unchanged failures do not produce comments; changed diagnostics are preserved in issue comments, not just linked to expiring run logs. - Treat a completed C# batch's expected exit code 1 as partial success, preserving its per-package statuses. Crashes, incomplete batches, and contradictory statuses remain fatal. An all-package restore failure still reaches the final diagnostics and last-good-data preservation. - Add isolated tests that execute the actual PowerShell orchestrator and semantic validator with mocked external package generation; execute the actual C# batch reconciliation against completed-partial, crash, and incomplete fixtures; cover issue creation, deduplication, updates, closure, recurrence, and API errors. ## Third-party links and affiliations <!-- List any third-party links added or changed by this pull request and disclose any material affiliation with the linked organizations, such as employment, sponsorship, or ownership. Write "None" if this pull request doesn't add or change third-party links. --> None. Example URLs in tests are non-network fixture data. ## Validation <!-- List the checks you ran or explain why validation isn't needed. --> From `src/frontend`: - `node node_modules\vitest\vitest.mjs run --config vitest.structured-data.config.ts` — passed: 121 tests across 6 files, including 12 issue/orchestration regression tests. - `node node_modules\eslint\bin\eslint.js scripts\report-api-generation-failures.mjs scripts\validate-generated-api-data.ts tests\unit\integration-data-updater.vitest.test.ts tests\unit\validate-generated-api-data.vitest.test.ts vitest.structured-data.config.ts --max-warnings 0` — passed. - `node node_modules\tsx\dist\cli.mjs scripts\validate-generated-api-data.ts` — passed on current committed API artifacts: 210 catalog identities and 140 TypeScript modules. From the repository root: - `pwsh -NoProfile -File tests\PackageJsonGenerator.Tests\generate-package-json.Tests.ps1` — passed: catalog-filter regression plus completed partial-batch, crash, and incomplete-output checks. - `[System.Management.Automation.Language.Parser]::ParseFile(...)` for all three modified generator/orchestrator PowerShell scripts — passed: no parse errors. - `git diff --cached --check` — passed before each commit. No local production build or full live package regeneration was run. GitHub CI and an updater run on `main` after merge are still required before calling the live workflow fixed. The workflow was not dispatched on this PR branch, because doing so can update the real auto-merge data PR. --------- Co-authored-by: David Pine <7679720+IEvangelist@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Follow-up to #1961. After its fix, the Integration Data Updater gets past
apiReferencebut aborts because 3 CommunityToolkit packages (Hosting.Chroma,Hosting.Keycloak.Extensions,Hosting.Kindat17.0.0-beta.994) depend onAspire.Hosting >= 17.0.0-preview.1.26552.6, which is not on nuget.org (NU1102). One failing package blocked every data update.generate-package-json.ps1: a failed package no longer exits 1 or deletes the staged output; its existing generated files are kept instead of being removed as stale.update-integration-data.ps1: C# and TypeScript package failures warn and continue; failing package names are emitted as theapi_failuresoutput and listed in the PR body.update-integration-data.yml: new "Track API generation failures" step maintains a single issue. Its body lists the current failing packages; a comment is added only when that set changes, and the issue closes when nothing fails, so identical failures never create duplicates.Third-party links and affiliations
None.
Validation
generate-package-json.Tests.ps1: passed (209 included, 1 excluded).workflow_dispatchafter merge. Semantic validation for packages kept at old data is unverified.