-
Notifications
You must be signed in to change notification settings - Fork 695
Interactive prompting for aspire new
#8520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
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 adds interactive prompting to the "aspire new" command and standardizes telemetry tracing throughout the CLI project. Changes include the introduction of prompt utilities for string and selection inputs, updates to ActivitySource naming conventions, and method signature adjustments to support interactive prompting and improved telemetry instrumentation.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/Aspire.Cli/Utils/PromptUtils.cs | Introduces helper methods for interactive prompting. |
src/Aspire.Cli/Program.cs | Updates OpenTelemetry configuration and standardizes ActivitySource naming. |
src/Aspire.Cli/NuGetPackageCache.cs | Adjusts method signature to use DirectoryInfo instead of FileInfo. |
src/Aspire.Cli/DotNetCliRunner.cs | Standardizes ActivitySource naming and removes explicit ActivityKind values. |
src/Aspire.Cli/Commands/* | Normalize ActivitySource naming and update NewCommand to use interactive prompts. |
src/Aspire.Cli/Backchannel/AppHostBackchannel.cs | Standardizes ActivitySource naming for backchannel operations. |
Comments suppressed due to low confidence (1)
src/Aspire.Cli/Program.cs:21
- [nitpick] Changing the ActivitySource name to just 'Program' reduces context compared to the previous 'Aspire.Cli.Program'. Consider using the fully qualified name to maintain clarity in telemetry.
private static readonly ActivitySource s_activitySource = new ActivitySource(nameof(Program));
{ | ||
var id = packageResult.GetProperty("id").GetString(); | ||
|
||
// var version = prerelease switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code?
/backport to release/9.2 |
Started backporting to release/9.2: https://github.com/dotnet/aspire/actions/runs/14246085285 |
Fixes #8515
This PR updates the
aspire new
command to support interactive prompting. Here is a video of the interactive prompt, but read below for some more technical details/decisions from this approach.aspire-new-interactive.mp4
A few notes on the technical implementation:
I do not use a pick-list for selecting the template version. When using multiple feeds (paritcularly our internal ones) where we have thousands of versions of the
Aspire.ProjectTemplates
package it becomes difficult to present a list that makes sense. Instead, we just prompt for the version of the templates and default to the CLI version number. The thinking here is that the CLI will become the primary driver of newer template adoption, and generally you want to use the latest CLI and templates.The
--prerelease
switch has been removed from the CLI as it is redundant.The
--source
switch is still supported to cope with the situation where the same package version might be available from two sources, but it is not prompted - this is more of an advanced scenario.Here is the non-interactive flow still working for comparison:
aspire-new-noninteractive.mp4