Skip to content

Move progress prompt title to options - #19382

Merged
James Newton-King (JamesNK) merged 7 commits into
microsoft:mainfrom
JamesNK:reorder-progress-prompt-parameters
Aug 16, 2026
Merged

Move progress prompt title to options#19382
James Newton-King (JamesNK) merged 7 commits into
microsoft:mainfrom
JamesNK:reorder-progress-prompt-parameters

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

Makes progress prompt APIs consistent by keeping message as the only required positional argument and exposing nullable title through progress options. Native C# callers use ProgressInteractionOptions.Title, while polyglot callers use InteractionProgressOptions.title.

The C# API, ATS export, generated TypeScript, Python, Java, Go, and Rust APIs, tests, and samples now use this shape consistently.

User-facing usage

C# AppHost:

await interactionService.PromptProgressAsync(
    "Please wait while data is being processed...",
    new ProgressInteractionOptions
    {
        Title = "Processing",
        Work = async progress => await ProcessDataAsync(progress.CancellationToken)
    });

// Omit Title for a titleless progress dialog.
await interactionService.PromptProgressAsync(
    "Please wait while data is being processed...");

TypeScript AppHost:

await interactionService.promptProgress(
    "Please wait while data is being processed...",
    {
        title: "Processing",
        work: async () => await processData()
    });

Compatibility

PromptProgressAsync and the generated promptProgress capability are new and unshipped. The compatibility suppression declares the intentional pre-release removal of the positional polyglot title parameter after it moved into InteractionProgressOptions; no released callers are affected.

Validation:

  • dotnet build src/Aspire.Hosting/Aspire.Hosting.csproj --no-restore
  • All PromptProgressAsync_* tests (7 passed)
  • Two-pass code-generation snapshot tests for TypeScript, Python, Java, Go, and Rust (5 passed)
  • TypeScript API compatibility validation (1 intentional diagnostic suppressed; 0 undeclared breaks)
  • Both TypeScript AppHosts compiled against freshly restored local SDKs
  • Go and Python validation AppHosts compiled against freshly restored local SDKs
  • Java snapshot generation passed; local AppHost compilation was unavailable because javac is not installed
  • dotnet build playground/Stress/Stress.AppHost/Stress.AppHost.csproj --no-restore
  • git diff --check

Fixes # (issue)

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

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

Or

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

@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Aug 14, 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

Reorders progress-prompt parameters to consistently use nullable title before required message.

Changes:

  • Updates C# and ATS progress-prompt APIs.
  • Migrates C# and TypeScript callers and tests.
  • Regenerates the TypeScript API snapshot.

Reviewed changes

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

Show a summary per file
File Description
tests/Shared/TestInteractionService.cs Updates the test implementation signature.
tests/PolyglotAppHosts/Aspire.Hosting/TypeScript/apphost.mts Migrates the TypeScript test AppHost.
tests/Aspire.Hosting.Tests/InteractionServiceTests.cs Updates progress-prompt tests.
tests/Aspire.Hosting.CodeGeneration.TypeScript.Tests/Snapshots/TwoPassScanningGeneratedAspire.verified.ts Updates generated TypeScript API output.
src/Aspire.Hosting/InteractionService.cs Reorders implementation parameters.
src/Aspire.Hosting/IInteractionService.cs Changes the public experimental API.
src/Aspire.Hosting/Ats/InteractionExports.cs Reorders the exported ATS capability.
src/Aspire.Hosting/ApplicationModel/ResourceCommandService.cs Migrates the internal caller.
playground/TypeScriptAppHost/apphost.mts Updates the TypeScript sample.
playground/Stress/Stress.AppHost/InteractionCommands.cs Updates C# stress scenarios.

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

Comment thread src/Aspire.Hosting/Ats/InteractionExports.cs Outdated
@JamesNK James Newton-King (JamesNK) added the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Aug 14, 2026
@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.

Copilot AI review requested due to automatic review settings August 14, 2026 05:31

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 17 out of 17 changed files in this pull request and generated no new comments.

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

Copilot AI review requested due to automatic review settings August 14, 2026 06:05
@JamesNK James Newton-King (JamesNK) removed the breaking-change Issue or PR that represents a breaking API or functional change over a prerelease. label Aug 14, 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 18 out of 18 changed files in this pull request and generated no new comments.

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

Copilot AI review requested due to automatic review settings August 14, 2026 06:46

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 18 out of 18 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 14, 2026 06:56
@JamesNK James Newton-King (JamesNK) changed the title Fix progress prompt parameter order Move progress prompt title to options Aug 14, 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 18 out of 18 changed files in this pull request and generated 1 comment.

Comment thread src/Aspire.Hosting/IInteractionService.cs
Copilot AI review requested due to automatic review settings August 14, 2026 07:13

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 19 out of 19 changed files in this pull request and generated no new comments.

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

@mitchdenny Mitch Denny (mitchdenny) 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.

Went through the full diff plus the ATS compat tooling. The change itself is correct and complete — I traced the suppression story through tools/TypeScriptApiCompat/AtsCompatibilityComparer.cs and it holds up: capability parameters are matched by name, so removing title produces exactly one capability-parameter-removed diagnostic, and the shared parameter order (message, options, cancellationToken) is unchanged so capability-parameter-order-changed correctly doesn't fire. The new Title is nullable, so it lands in ATS as optional and rightly needs no dto-property-added-required suppression, unlike the CommandOptions.Progress precedent a few lines up in the same file. Every call site is migrated and all five language snapshots are consistent.

Two test-coverage gaps though: the title now flows through hand-written mappings in two places that nothing asserts, so either could be dropped without turning CI red. Details inline. Third comment is a non-blocking API note.

Comment thread src/Aspire.Hosting/ApplicationModel/ResourceCommandService.cs
Comment thread src/Aspire.Hosting/Ats/InteractionExports.cs
Comment thread src/Aspire.Hosting/IInteractionService.cs
The progress dialog title now reaches the interaction through two
hand-written mappings that nothing asserted: CommandProgressOptions.Title
-> ProgressInteractionOptions.Title in ResourceCommandService, and
InteractionProgressOptions.Title -> ProgressInteractionOptions.Title in
the ATS export. Either could be dropped without failing a test, silently
losing the title for command progress dialogs and for every polyglot
AppHost.

Both tests were verified to fail when the corresponding mapping is
removed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 16, 2026 07:53

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.

Review details

  • Files reviewed: 21/21 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@mitchdenny Mitch Denny (mitchdenny) 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.

Approving. The API shape change is correct and complete — I traced the ATS compat story through tools/TypeScriptApiCompat/AtsCompatibilityComparer.cs and it holds up: capability parameters are matched by name, so removing title yields exactly one capability-parameter-removed diagnostic, and the shared parameter order (message, options, cancellationToken) is unchanged so capability-parameter-order-changed correctly does not fire. The new Title is nullable and therefore optional in ATS, so it rightly needs no dto-property-added-required suppression, unlike the CommandOptions.Progress precedent. The CP0006 target update is right and leaves no stale entry. Every call site is migrated and all five language snapshots are consistent.

The two test-coverage gaps I raised are addressed in 6b0afcb, which I pushed to this branch. Both new assertions were verified to fail when the corresponding title mapping is removed, so they are real regression tests rather than happy-path padding.

CI on the previous head was fully green; the run for the new commit is still in progress.

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

@JamesNK
James Newton-King (JamesNK) merged commit beb7e41 into microsoft:main Aug 16, 2026
727 of 730 checks passed
@JamesNK

Copy link
Copy Markdown
Member Author

/backport to release/13.5

@github-actions github-actions Bot added this to the 13.6 milestone Aug 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.5 (link to workflow run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants