Skip to content

Remove refresh-typescript-sdks workflow and script - #18288

Merged
Ankit Jain (radical) merged 5 commits into
mainfrom
copilot/investigate-broken-workflows
Jun 23, 2026
Merged

Remove refresh-typescript-sdks workflow and script#18288
Ankit Jain (radical) merged 5 commits into
mainfrom
copilot/investigate-broken-workflows

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the Refresh TypeScript Playground SDKs workflow (.github/workflows/refresh-typescript-sdks.yml) and its script (eng/refreshTypeScriptSdks.ps1).

Why

The workflow regenerated the TypeScript AppHost SDK modules (aspire.*, base.*, transport.*) under .aspire/modules / .modules and opened a daily PR to commit them. But those generated files:

  • are gitignored (.gitignore ignores .aspire/ and .modules/),
  • are never tracked in the repo (not on main, not on disk by default), and
  • are regenerated on demand by aspire restore / aspire run.

To commit them at all, the workflow had to force past .gitignore (git add -f, added in cd0c171cb7 specifically because the PR was otherwise a no-op). Committing ephemeral, per-build generated code only creates churn and drifts against whatever the local CLI generates. There's no value in maintaining a scheduled PR for it, so the workflow and script are removed entirely.

No other files reference the workflow or script.

Co-authored-by: radical <1472+radical@users.noreply.github.com>
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18288

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18288"

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.

Pull request overview

This PR fixes the refresh-typescript-sdks.yml CI workflow, which had been silently failing on every run because the underlying eng/refreshTypeScriptSdks.ps1 script still targeted a removed playground directory layout (playground/polyglot/TypeScript/<app>/ValidationAppHost/apphost.ts). The TypeScript playground was restructured into playground/TypeScriptAppHost and playground/TypeScriptApps/*, with entry points renamed from apphost.ts to apphost.mts.

Changes:

  • Updated AppHost discovery to recursively search multiple playground roots (TypeScriptAppHost, TypeScriptApps) for apphost.mts/apphost.ts entry points instead of using the removed fixed path.
  • Made SDK verification extension-aware: generated module file names (.mts vs .ts) are now derived from the entry-point extension.
  • Refactored per-app metadata into a pscustomobject with Directory, EntryPoint, and DisplayName properties for cleaner downstream usage.

Comment thread eng/refreshTypeScriptSdks.ps1 Outdated
Comment thread eng/refreshTypeScriptSdks.ps1 Outdated
The refresh script derived generated-file extensions per entry point
(.mts vs legacy .ts) but hardcoded '.aspire/modules' as the output
directory for both the pre-restore cleanup and the post-restore
verification. The CLI writes a legacy 'apphost.ts' app's generated SDK
to '.modules/' instead (ILanguageDiscovery.LegacyGeneratedFolderName),
so a legacy app would have its real output left untouched during
cleanup and then fail verification looking in the wrong directory.

Add Get-GeneratedModulesDir to resolve the output directory from the
entry-point extension the same way the file names are derived, and use
it for both the cleanup and Assert-GeneratedSdkFiles. No playground app
uses 'apphost.ts' today, so this fixes the latent legacy path rather
than a current failure.

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

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@radical

Copy link
Copy Markdown
Member

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: b29d7c13d8c3a9b3f7b61a16af0a5d57364dbddd
  • Tested Artifact: eng/refreshTypeScriptSdks.ps1 fetched directly from the PR head SHA via the GitHub contents API.
  • Status: ✅ Verified (tested the exact PR head version of the changed file)

Changes Analyzed

Files Changed

  • eng/refreshTypeScriptSdks.ps1 — MODIFIED (+54 / −21). The only file in the PR.

Change Categories

  • CLI changes
  • Hosting integration changes
  • Dashboard changes
  • CI infrastructure changes — a CI script (eng/refreshTypeScriptSdks.ps1) invoked by .github/workflows/refresh-typescript-sdks.yml
  • VS Code extension changes

This is an infra-only PR, so it was validated using the ci-infra-testing.md GitHub Actions track rather than the CLI dogfood / template scenarios.

CI Infrastructure Validation (GitHub Actions track)

What runs on this PR

  • Nothing. refresh-typescript-sdks.yml triggers only on workflow_dispatch and a daily schedule, and the single job is guarded by if: github.repository_owner == 'microsoft'. It does not run on PRs, and a fork dispatch would skip the job. The workflow YAML itself is unchanged by this PR, so no trigger / permission / matrix / job-count change was introduced.

Automated tests

  • None exist for this script. eng/refreshTypeScriptSdks.ps1 is referenced only by its workflow; there is no Infrastructure.Tests class covering it. Validation was therefore done by exercising the script's pure logic directly (below).

gh-aw / lock files

  • n/a — no .github/aw/ or *.lock.yml involved.

Logic validation (the core of the fix)

The end-to-end run (restoredotnet build → per-app npmaspire restore) is CI-only, as the PR states. The discovery + helper logic is the substance of the fix and was validated locally by loading the real PR functions via PowerShell AST extraction (no copy/paste drift) and asserting against the actual repo layout (pwsh 7.5.4).

Pre-condition confirmed (reproduces the bug the PR fixes): the old hard-coded root playground/polyglot/TypeScript no longer exists, so the previous script would throw "TypeScript playground directory not found" on every run. The current layout is:

playground/TypeScriptAppHost/apphost.mts
playground/TypeScriptApps/RpsArena/apphost.mts
playground/TypeScriptApps/AzureFunctionsSample/AppHost/apphost.mts

Harness result: 13 / 13 assertions passed.

# Scenario Coverage Result
1 Discovery with default -AppPattern * resolves exactly the 3 current AppHosts, all with apphost.mts entry points and correct DisplayNames, and the directories exist on disk Happy path ✅ Passed
2 Get-RequiredGeneratedFiles maps apphost.mtsaspire.mts/base.mts/transport.mts and legacy apphost.tsaspire.ts/base.ts/transport.ts Happy path + legacy ✅ Passed
3 Get-GeneratedModulesDir maps apphost.mts.aspire/modules and legacy apphost.ts.modules Happy path + legacy ✅ Passed
4 -AppPattern filtering: *RpsArena* → 1 app; *AppHost*TypeScriptAppHost + AzureFunctionsSample/AppHost (correctly excludes RpsArena) Boundary ✅ Passed
5 No-match pattern throws with the new wording No TypeScript playground AppHost directories matched ... Unhappy path ✅ Passed
6 A missing playground root is skipped (Test-Pathcontinue), not fatal; discovery still resolves the existing root Unhappy path ✅ Passed

Source verification of CLI-behavior assumptions

Because the verification step (Assert-GeneratedSdkFiles) only catches regressions if it looks in the right folder for the right files, I cross-checked the script's assumptions against the CLI source at the PR head:

  • ILanguageDiscovery.GeneratedFolderName = Path.Combine(".aspire", "modules") and LegacyGeneratedFolderName = ".modules" (src/Aspire.Cli/Projects/ILanguageDiscovery.cs:52,59).
  • GuestAppHostProject.cs:1558–1567 writes to .aspire/modules by default and switches to .modules only when ShouldEmitLegacyTypeScriptGeneratedFiles is true.
  • ShouldEmitLegacyTypeScriptGeneratedFiles (GuestAppHostProject.cs:1616–1627) is true iff the entry point is apphost.ts (TypeScriptAppHostFileName), vs apphost.mts (TypeScriptMtsAppHostFileName).
  • ConvertGeneratedFilesForLegacyTypeScriptAppHost (:1596–1601) maps aspire.mts→aspire.ts, base.mts→base.ts, transport.mts→transport.ts.

This matches the script's entry-point→folder and entry-point→file-extension coupling exactly. The verification step will therefore target the directory and file names the CLI actually writes, for both modern and legacy AppHosts.

Failure-modes scan

  • Trigger / permission / fork: workflow unchanged; no new triggers or permissions. Org guard means it never runs on forks — unchanged.
  • Lock drift: n/a (no gh-aw).
  • Enumeration shrink: discovery now finds 3 AppHosts where the old code found 0 (it threw). No risk of fewer apps than baseline.
  • Recursion into node_modules (minor observation, not a blocker): discovery uses Get-ChildItem -Recurse. In CI the checkout is fresh and discovery runs before npm install, so no node_modules exists to descend into; the repo commits no stray apphost.mts/apphost.ts. A pre-existing node_modules on a dirty local tree could theoretically surface a nested entry point, but this does not occur in the CI environment the workflow runs in.

Residual CI-only coverage (not exercised)

A real workflow_dispatch run on microsoft/aspire would exercise npm ci/npm install + aspire restore + the actual SDK file generation, and would open/update a real automated PR. That is a side-effecting upstream operation and the agreed-CI-only end-to-end; it was intentionally not triggered. The logic that previously broke (discovery) and the verification targets are validated above.

Summary

Scenario Status Notes
Discovery resolves current 3 AppHosts ✅ Passed Was the failing path pre-PR
Generated-file name mapping (modern + legacy) ✅ Passed Matches CLI source
Generated-modules dir mapping (modern + legacy) ✅ Passed Matches CLI source
-AppPattern filtering ✅ Passed Incl. correct exclusion
No-match error path ✅ Passed New wording
Missing-root tolerance ✅ Passed Non-fatal skip
Source-verified CLI assumptions ✅ Passed folder + extension coupling correct

Overall Result

✅ PR VERIFIED

The fix correctly replaces the removed playground/polyglot/TypeScript/*/ValidationAppHost layout with entry-point-based discovery under playground/TypeScriptAppHost and playground/TypeScriptApps, resolves all three current AppHosts, and derives the generated-module folder and file extensions in a way that matches the CLI source for both modern (apphost.mts) and legacy (apphost.ts) AppHosts. The previously-failing discovery path now succeeds. The npm + aspire restore end-to-end remains CI-only by design.

Recommendations

  • None blocking. Optionally, a future hardening could scope discovery with -Depth or prune node_modules to avoid recursion surprises on dirty local trees, but this is not a problem in the CI environment.

@adamint
Adam Ratzman (adamint) marked this pull request as draft June 18, 2026 19:55
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 18, 2026 20: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.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 2

Comment thread eng/refreshTypeScriptSdks.ps1 Outdated
Comment thread eng/refreshTypeScriptSdks.ps1 Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@adamint
Adam Ratzman (adamint) marked this pull request as ready for review June 23, 2026 17:24
The generated AppHost SDK output is ignored by the repo-level .gitignore, so the scheduled refresh workflow could successfully regenerate files and still produce an empty PR. Stage those ignored SDK files explicitly before invoking the shared create-pull-request action.

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

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@sebastienros

Copy link
Copy Markdown
Contributor

I think we should actually delete this workflow, it must have been created at the very beginning of polyglot when we decided we should keep the generated code in the repos before we had aspire run do it automatically. Proof is that the files it's trying to keep updated are ignored in the .gitignore

@sebastienros

Copy link
Copy Markdown
Contributor

Assuming we are ok with this explanation I will update this PR to delete the file instead

The generated TypeScript AppHost SDKs under .aspire/modules and .modules are
gitignored and regenerated on demand by 'aspire restore'/'aspire run'. The
scheduled workflow had to force-add these ignored files to commit them, which
only produced churn and drift against locally generated output. Remove the
workflow and its script entirely.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 23, 2026 18:30
@sebastienros Sébastien Ros (sebastienros) changed the title Fix refresh-typescript-sdks workflow for current TypeScript playground layout Remove refresh-typescript-sdks workflow and script Jun 23, 2026

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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector (audit mode)

The full test matrix and all jobs still run in audit mode. The tests and jobs below are what selective CI would run under enforcement.

Runs the full test matrix + all jobs (ALL) — a rule matching '.github/actions/enumerate-tests/action.yml' selects ALL


Selection computed for commit 442e3f7.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@adamint Adam Ratzman (adamint) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(automated review)

looks good to me now. I pushed the workflow staging fix for the ignored generated SDK outputs; the unrelated template timeout passed on rerun and CI is green.

@radical

Copy link
Copy Markdown
Member

Thank you Adam Ratzman (@adamint) and Sébastien Ros (@sebastienros) for fixing this!

@radical
Ankit Jain (radical) merged commit 036a501 into main Jun 23, 2026
645 of 648 checks passed
@radical
Ankit Jain (radical) deleted the copilot/investigate-broken-workflows branch June 23, 2026 19:53
@github-actions github-actions Bot added this to the 13.5 milestone Jun 23, 2026
Ankit Jain (radical) added a commit to radical/aspire that referenced this pull request Jun 30, 2026
Address review findings on the failure-issue automation:

- The monitor watch list still named refresh-typescript-sdks.yml and
  update-github-models.yml, but both workflows were removed on main
  (microsoft#18288 and microsoft#18405). monitor-scheduled-workflows.js looks each entry
  up via listWorkflowRuns({ workflow_id }), so every 2-hour run would
  404 on these two and log a warning while monitoring nothing. Remove
  both from the config and from the watch-list prose in the doc.

- monitor-scheduled-workflows.md linked internal-build-failure-
  notifications.md, which does not exist in the repo. Drop the dangling
  link, keep the sentence.

- specialized-test-failure-issues.md described extractionFailed as true
  "only when every .trx was unreadable". The implementation is
  readErrors > 0 && failedTests.Count == 0 (at least one unreadable trx
  with no failures collected); the partial case is also flagged. Match
  the markdown to the code and its in-code comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants