Repository navigation
[release/17.0] Show repository and ref in template picker group headings - #22110
Mitch Denny (mitchdenny) wants to merge 1 commit into
Conversation
## 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)
|
Stop. It's here: #22109 |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22110Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22110" |
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 |
Description
Backport of #21831 to
release/17.0, preserving provenance from commitdb62c3556439a1139d969b394869585c657d7df8withgit cherry-pick -x. Applied without conflicts to the live release tipcec195f2d0bf3f1d714badf74f205fa855fdf963; the patch matches the original exactly.Layer 1 of 4 in the requested backport stack: #21831 → #21883 → #21855 → #21852. This bottom layer targets
release/17.0; higher-layer PRs are forthcoming and will target the preceding layer. This PR contains only #21831. It providesSelectionChoiceGroup.Styleand configured-template metadata needed by #21855. No new dependencies; stack metadata will be registered separately when all four PRs exist. Do not merge layers independently of the coordinated set.Customers using configured template sources can see the repository and configured ref (or directory path) directly in
aspire newsource headings, while retaining friendly names. Selection identity, acquisition, trust/consent behavior, and the extension's flat-choice protocol remain unchanged.User-facing usage
Run
aspire newwith configured template sources. Example headings:Screenshots / Recordings
Validation
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, 0 failed, 0 skipped.git diff --check origin/release/17.0...HEAD— passed.git diff origin/release/17.0...HEAD | git patch-id --stableandgit show --format= db62c3556439a1139d969b394869585c657d7df8 | git patch-id --stable— passed: identical patch IDa7647278352501d4cd7763d66ffbe3dd4e25b539.Quarantined/outerloop tests, manual interactive capture, and the full repository suite were not run.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?Customer Impact
Configured template sources previously appeared under only a friendly name or alias, making it difficult for users to tell which repository and ref supply a template. The picker now shows that provenance, or the directory path for local sources.
Testing
Focused release-branch CLI validation passed all 750 tests, including configured/default refs, alias fallback, directory and inherited sources, duplicate names, credential-bearing source rejection, literal markup handling, and terminal-width cropping. Exact command and patch-equivalence results are recorded above.
Risk
Low. This is a localized CLI presentation and metadata change with existing literal-text escaping and width cropping preserved; selection identity, acquisition, and consent semantics are unchanged.
Regression?
Unknown — the source PR does not identify this as a regression or name an affected release.