Merged
Conversation
Contributor
There was a problem hiding this comment.
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));
davidfowl
reviewed
Apr 3, 2025
| { | ||
| var id = packageResult.GetProperty("id").GetString(); | ||
|
|
||
| // var version = prerelease switch { |
davidfowl
approved these changes
Apr 3, 2025
Member
|
/backport to release/9.2 |
Contributor
|
Started backporting to release/9.2: https://github.com/dotnet/aspire/actions/runs/14246085285 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #8515
This PR updates the
aspire newcommand 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.ProjectTemplatespackage 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
--prereleaseswitch has been removed from the CLI as it is redundant.The
--sourceswitch 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