Skip to content

Only warn about CLI/SDK skew when the CLI is older - #20477

Merged
Shayne Boyer (spboyer) merged 1 commit into
mainfrom
fix/20389-cli-sdk-skew-warning
Sep 28, 2026
Merged

Shayne Boyer (spboyer) merged 1 commit into
mainfrom
fix/20389-cli-sdk-skew-warning

Conversation

@spboyer

Copy link
Copy Markdown
Member

Description

Newer Aspire CLIs can run AppHosts pinned to older SDKs without a misleading version-skew warning. The warning now appears only when the CLI has lower SemVer precedence than the SDK; metadata-only differences remain ignored, and unparseable versions retain the existing case-insensitive comparison fallback.

During aspire update, the warning compares against the target SDK instead of the stale on-disk config. This also prevents missing a warning when an update moves the SDK ahead of the CLI. Warning guidance now recommends updating the CLI rather than changing the AppHost SDK, with the corresponding localization files regenerated.

Fixes #20389

Examples

CLI SDK used for code generation Warning
13.6.0-pr.19847.g8be64f3a 13.5.4 No
13.6.0-pr.19847.g8be64f3a 13.6.0 Yes
13.1.0-preview.1.26218.1 13.1.0-preview.1.26227.1 Yes
13.5.4 13.5.4+abc123 No

For example, with CLI 13.5.0, an update from SDK 13.4.0 to 13.6.0 warns about the target 13.6.0, not the old 13.4.0.

Validation

  • Both affected CLI test classes passed: 94 passed, 0 failed, 0 skipped. Coverage includes version ordering, prereleases, build metadata, unparseable versions, and the fake-backed package-update flow with explicit CLI identities.
  • dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj --no-restore succeeded.
  • Rubber-duck critique identified the stale-config update gap; the implementation and regression tests address it. The subsequent GPT-5.6 Terra code-review pass reported no significant issues.
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj \
  --no-restore --no-launch-profile -- \
  --filter-class "*.GuestAppHostProjectSkewTests" \
  --filter-class "*.GuestAppHostProjectTests" \
  --filter-not-trait "quarantined=true" \
  --filter-not-trait "outerloop=true"

No new dependencies or public APIs.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Compare CLI and SDK versions directionally and use the target SDK during updates. Preserve unparseable-version fallback and update warning guidance and regression coverage.

Fixes #20389

Co-authored-by: Copilot <[email protected]>

Copilot-Session: e9b58819-1030-4a10-b494-48379b8c0353
@github-actions

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 -- 20477

Or

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

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

2 / 99 PR test projects · 4 PR jobs, from 18 changed files.

Selected PR test projects (2 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Projects/GuestAppHostProjectSkewTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Projects/GuestAppHostProjectTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Projects/GuestAppHostProject.cs, src/Aspire.Cli/Resources/ErrorStrings.Designer.cs, src/Aspire.Cli/Resources/ErrorStrings.resx, src/Aspire.Cli/Resources/xlf/ErrorStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.de.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.es.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.it.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.zh-Hant.xlf
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit fa3886c.

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

🟢 Approval recommended

The implementation matches the stated behavior and includes focused coverage for ordering, metadata, fallback, and update flows.

Review effort: Balanced
Findings: None

What changed in this PR

Updates CLI/SDK skew detection so warnings appear only when the CLI is older than the SDK used for code generation.

Changes:

  • Uses SemVer precedence while ignoring build metadata.
  • Compares aspire update against its target SDK version.
  • Updates warning text, localization sources, and regression coverage.
File Description
src/​Aspire.Cli/​Projects/​GuestAppHostProject.cs Implements directional skew detection and target-version comparison.
src/​Aspire.Cli/​Resources/​ErrorStrings.resx Updates warning guidance.
src/​Aspire.Cli/​Resources/​ErrorStrings.Designer.cs Regenerates the resource accessor documentation.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.cs.xlf Updates Czech localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.de.xlf Updates German localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.es.xlf Updates Spanish localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.fr.xlf Updates French localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.it.xlf Updates Italian localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.ja.xlf Updates Japanese localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.ko.xlf Updates Korean localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.pl.xlf Updates Polish localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.pt-BR.xlf Updates Brazilian Portuguese localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.ru.xlf Updates Russian localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.tr.xlf Updates Turkish localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.zh-Hans.xlf Updates Simplified Chinese localization source.
src/​Aspire.Cli/​Resources/​xlf/​ErrorStrings.zh-Hant.xlf Updates Traditional Chinese localization source.
tests/​Aspire.Cli.Tests/​Projects/​GuestAppHostProjectSkewTests.cs Covers directional precedence and fallback behavior.
tests/​Aspire.Cli.Tests/​Projects/​GuestAppHostProjectTests.cs Covers target SDK handling during package updates.
Files not reviewed (1)
  • src/Aspire.Cli/Resources/ErrorStrings.Designer.cs: Generated file

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@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.

@spboyer
Shayne Boyer (spboyer) enabled auto-merge (squash) September 25, 2026 15:56
@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.

@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.

@eerhardt

Copy link
Copy Markdown
Member

@spboyer
Shayne Boyer (spboyer) merged commit 57eac11 into main Sep 28, 2026
736 of 745 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 14.0 milestone Sep 28, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1786

Generated by PR Documentation Check · copilot · auto · 33.9 AIC · ⌖ 17 AIC · ⊞ 20.2K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1786 targeting release/13.6.

Updated the CLI/SDK skew warning docs (new message text, warns only when CLI is older, update-time target SDK comparison) in get-started/troubleshooting.mdx and app-host/typescript-apphost.mdx. Signals: cli_resource_strings_changed (ErrorStrings.resx CodegenVersionSkewWarning reworded), pr_body_has_cli_flag_mention.

Note

This draft PR needs human review before merging.

Maddy Montaquila (maddymontaquila) pushed a commit to microsoft/aspire.dev that referenced this pull request Sep 29, 2026
Documents changes from microsoft/aspire#20477 by ``@davidfowl-unknown``

Targeting `release/13.6` — the latest release branch on
`microsoft/aspire.dev` — because `release/14.0` (from the source PR
milestone `14.0`) does not exist there.

## Why
The source PR changes the CLI/SDK skew warning: it now appears only when
the CLI is older than the SDK, build metadata is ignored, `aspire
update` compares against the target SDK, and the message text was
reworded (`CodegenVersionSkewWarning`). Triggered signals:
`cli_resource_strings_changed`, `pr_body_has_cli_flag_mention`.

## Changes (updated pages)
- `src/frontend/src/content/docs/get-started/troubleshooting.mdx`
- `src/frontend/src/content/docs/app-host/typescript-apphost.mdx`

> Generated by [PR Documentation
Check](https://github.com/microsoft/aspire/actions/runs/36487180665) for
#20477 · copilot · auto · 33.9 AIC · ⌖ 17 AIC · ⊞ 20.2K ·
[◷](https://github.com/search?q=repo%3Amicrosoft%2Faspire.dev+%22gh-aw-workflow-id%3A+pr-docs-check%22&type=pullrequests)

<!-- gh-aw-agentic-workflow: PR Documentation Check, engine: copilot,
model: auto, id: 36487180665, workflow_id: pr-docs-check, run:
https://github.com/microsoft/aspire/actions/runs/36487180665 -->

<!-- gh-aw-workflow-id: pr-docs-check -->
<!-- gh-aw-workflow-call-id: microsoft/aspire/pr-docs-check -->

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only warn about CLI/SDK version skew when the CLI is older than the SDK

3 participants