Repository navigation
Show repository and ref in template picker group headings - #21831
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21831Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21831" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the changes that add source provenance to template-picker headings.
No open issues 🎉
What changed in this PR
This follow-up to #21754 makes configured template sources easier to identify in the aspire new picker by adding provenance to existing friendly headings.
Changes:
- Git headings show the repository and configured ref, using
default branchwhen omitted; directory headings show the local path. - Source metadata reaches the heading formatter without changing group identity or flat-choice labels.
- Tests, console snapshots, and specifications cover the expanded headings, literal-text escaping, and width-aware cropping.
| File | Description |
|---|---|
tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=True_width=40.verified.txt |
Captures cropped Git headings. |
tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=True_width=120.verified.txt |
Captures full Git headings with literal brackets. |
tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=False_width=40.verified.txt |
Captures cropped directory headings. |
tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=False_width=120.verified.txt |
Captures full directory headings with literal brackets. |
tests/Aspire.Cli.Tests/Interaction/ConsoleInteractionServiceTests.cs |
Tests heading rendering at two terminal widths. |
tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.InitConfig.cs |
Updates inherited-source heading expectations. |
tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.ConfiguredSources.cs |
Checks directory headings and password-bearing SSH URL rejection. |
tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.ConfiguredGitSources.cs |
Tests repository, ref, and friendly-name heading combinations. |
src/Aspire.Cli/Templating/ConfiguredTemplateSourceService.cs |
Carries source metadata with discovered templates. |
src/Aspire.Cli/Commands/NewCommand.cs |
Formats source headings with repository/ref or path. |
docs/specs/git-templating.md |
Documents heading formats and rendering behavior. |
docs/specs/cli-config-sources.md |
Clarifies friendly-name fallback and provenance display. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Tests selector2 / 101 PR test projects · 4 PR jobs, from 12 changed files. Selected PR test projects (2 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🧪 🧪 🧪 🧪 🧪 🧪 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Restore the shared localized default-branch label needed by the incoming picker changes while keeping default refs omitted from configuration-source onboarding. Validation: 1160 CLI tests passed; 2 skipped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pull request created: #2087
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2087 targeting Documented the new template picker heading format in Note This draft PR needs human review before merging. |
Restore the shared localized default-branch label needed by the incoming picker changes while keeping default refs omitted from configuration-source onboarding. Validation: 1160 CLI tests passed; 2 skipped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the shared localized default-branch label needed by the incoming picker changes while keeping default refs omitted from configuration-source onboarding. Validation: 1160 CLI tests passed; 2 skipped. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Description Configured template sources currently appear in the `aspire new` picker under a friendly name or alias alone, making it difficult to tell which repository and ref will supply a template. Show that provenance directly in each source heading while retaining the friendly name. Git headings now use `Name (repository @ ref)`. An omitted ref is explicitly displayed as `default branch`, rather than guessing a branch name or displaying the acquired commit. Directory headings use `Name (path)` instead. Built-in grouping, collision-safe source IDs and selections, trust/consent behavior, acquisition semantics, and the extension's flat-choice protocol remain unchanged. Existing literal-text escaping and terminal-width cropping apply to the expanded headings. Follow-up to #21754. No new dependencies. ### User-facing usage Run `aspire new` with configured template sources. Example headings: ```text Company templates (https://github.com/example/templates @ release/templates) company (https://github.com/example/templates @ default branch) Company templates (/work/templates) ``` ### Screenshots / Recordings > **This PR includes CLI prompt changes.** TODO: add a screenshot or recording of `aspire new` with Git and directory sources, including a narrow terminal. > > Rendered console snapshots cover full headings at 120 columns and literal-text escaping/cropping at 40 columns. No screenshot or recording is attached. <!-- Add screenshots/recordings here --> ### Validation - `./restore.sh` — passed. - `dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.NewCommandLocalTemplateTests' --filter-class '*.ConsoleInteractionServiceTests' --filter-class '*.ExtensionInteractionServiceTests' --filter-class '*.TemplateSourceConfigurationTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, 750 tests. - `git diff --check` — passed. Coverage includes configured/default refs, commit and fully qualified branch refs, friendly names and alias fallback, directory sources, inherited sources, duplicate names, credential-bearing source rejection, markup-containing locations, and width-aware rendering. Git acquisition uses the existing test runner, not live repositories. Quarantined/outerloop tests and the full repository suite were not run. Fixes # (issue) ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit db62c35)
## Description Configured template sources currently appear in the `aspire new` picker under a friendly name or alias alone, making it difficult to tell which repository and ref will supply a template. Show that provenance directly in each source heading while retaining the friendly name. Git headings now use `Name (repository @ ref)`. An omitted ref is explicitly displayed as `default branch`, rather than guessing a branch name or displaying the acquired commit. Directory headings use `Name (path)` instead. Built-in grouping, collision-safe source IDs and selections, trust/consent behavior, acquisition semantics, and the extension's flat-choice protocol remain unchanged. Existing literal-text escaping and terminal-width cropping apply to the expanded headings. Follow-up to #21754. No new dependencies. ### User-facing usage Run `aspire new` with configured template sources. Example headings: ```text Company templates (https://github.com/example/templates @ release/templates) company (https://github.com/example/templates @ default branch) Company templates (/work/templates) ``` ### Screenshots / Recordings > **This PR includes CLI prompt changes.** TODO: add a screenshot or recording of `aspire new` with Git and directory sources, including a narrow terminal. > > Rendered console snapshots cover full headings at 120 columns and literal-text escaping/cropping at 40 columns. No screenshot or recording is attached. <!-- Add screenshots/recordings here --> ### Validation - `./restore.sh` — passed. - `dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.NewCommandLocalTemplateTests' --filter-class '*.ConsoleInteractionServiceTests' --filter-class '*.ExtensionInteractionServiceTests' --filter-class '*.TemplateSourceConfigurationTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'` — passed, 750 tests. - `git diff --check` — passed. Coverage includes configured/default refs, commit and fully qualified branch refs, friendly names and alias fallback, directory sources, inherited sources, duplicate names, credential-bearing source rejection, markup-containing locations, and width-aware rendering. Git acquisition uses the existing test runner, not live repositories. Quarantined/outerloop tests and the full repository suite were not run. Fixes # (issue) ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> (cherry picked from commit db62c35)
## Description Backport five merged CLI changes to `release/17.0` so users can identify configured content sources, understand agent setup results, and see acquisition progress without routine Git output clutter. Cherry-picked in order: 1. #21831 (`db62c35564`) - Show repository and ref in template picker group headings. 2. #21883 (`2fefac5abe`) - Clarify source and skill summaries in `aspire agent init`. 3. #21855 (`4954c76a62`) - Unify CLI source onboarding, presentation, and selection. 4. #21852 (`575c3bc76b`) - Quiet routine Git acquisition output. 5. #21982 (`7f897adec4`) - Show configuration source repositories and Git acquisition progress. The first four cherry-picks applied cleanly. The fifth conflicted in four dashboard resource designer files; those changes were excluded by retaining the release branch's versions. This PR contains no dashboard changes and no additional prerequisite commits. ### User-facing usage With configuration and template sources configured, run: ```shell aspire new --use-config-source ``` The CLI identifies source repositories, shows acquisition progress, and includes repository/ref information in template-source headings. ```shell aspire agent init ``` The setup summary separates configured remote sources from installed skills and identifies their agent-specific locations. ### Screenshots / Recordings > **This PR includes UI changes.** Please add screenshots or screen recordings so reviewers can evaluate the visual changes without running locally. > > - For before/after comparisons, place them side-by-side or label them clearly. > - For interactive changes (animations, transitions, new flows), prefer a short screen recording (GIF or video). > - If you cannot capture visuals now, note what scenario to test and mark this section as TODO. TODO: Capture the template-source picker, configuration-source acquisition progress, and `aspire agent init` source/skill summaries. No screenshots or recordings were captured for this backport. <!-- Add screenshots/recordings here --> ### Validation Focused CLI tests using the repository's existing .NET SDK (`11.0.100-rc.2.26504.105`): ```powershell dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.ConfigSourceServiceGitTests' --filter-class '*.ConfigSourceServiceTests' --filter-class '*.ConfigSourceCommandTests' --filter-class '*.AgentInitCommandTests' --filter-class '*.AgentInitClientSelectionTests' --filter-class '*.GitClientTests' --filter-class '*.GitCommandRunnerTests' --filter-class '*.ConsoleInteractionServiceTests' --filter-class '*.NewCommandLocalTemplateTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true' ``` **Passed:** 1,453 succeeded, 2 skipped, 0 failed. The build emitted the existing NU1903 advisory for the pinned `Microsoft.DotNet.ILCompiler` package. This PR does not change dependency versions. Verified that the branch contains exactly five commits on top of `release/17.0`, that the cherry-picked patches match the originals apart from the excluded dashboard files, and that the backport worktree is clean. CLI E2E tests and live interactive scenarios were not run. Fixes # (issue) ## Checklist - Is this feature complete? - [x] Yes. Ready to ship. - [ ] No. Follow-up changes expected. - Are you including unit tests for the changes and scenario tests if relevant? - [x] 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 - [x] 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 - [x] No --------- Co-authored-by: Mitch Denny <midenn@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Ella Hathaway <67609881+ellahathaway@users.noreply.github.com> Copilot-Session: a47a61ad-c59b-4674-8e74-e493bff49b02
Description
Configured template sources currently appear in the
aspire newpicker under a friendly name or alias alone, making it difficult to tell which repository and ref will supply a template. Show that provenance directly in each source heading while retaining the friendly name.Git headings now use
Name (repository @ ref). An omitted ref is explicitly displayed asdefault branch, rather than guessing a branch name or displaying the acquired commit. Directory headings useName (path)instead. Built-in grouping, collision-safe source IDs and selections, trust/consent behavior, acquisition semantics, and the extension's flat-choice protocol remain unchanged. Existing literal-text escaping and terminal-width cropping apply to the expanded headings.Follow-up to #21754. No new dependencies.
User-facing usage
Run
aspire newwith configured template sources. Example headings:Screenshots / Recordings
Validation
./restore.sh— passed.dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.NewCommandLocalTemplateTests' --filter-class '*.ConsoleInteractionServiceTests' --filter-class '*.ExtensionInteractionServiceTests' --filter-class '*.TemplateSourceConfigurationTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed, 750 tests.git diff --check— passed.Coverage includes configured/default refs, commit and fully qualified branch refs, friendly names and alias fallback, directory sources, inherited sources, duplicate names, credential-bearing source rejection, markup-containing locations, and width-aware rendering. Git acquisition uses the existing test runner, not live repositories. Quarantined/outerloop tests and the full repository suite were not run.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?