Skip to content

Show repository and ref in template picker group headings - #21831

Merged
Ankit Jain (radical) merged 2 commits into
mainfrom
mitchdenny-template-source-group-provenance
Nov 7, 2026
Merged

Ankit Jain (radical) merged 2 commits into
mainfrom
mitchdenny-template-source-group-provenance

Conversation

@mitchdenny

Copy link
Copy Markdown
Member

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:

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.

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?
    • 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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 5, 2026

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 -- 21831

Or

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

@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot November 5, 2026 22:57
@github-actions

This comment has been minimized.

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.

🟢 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 branch when 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

@github-actions

github-actions Bot commented Nov 5, 2026

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.

@github-actions

github-actions Bot commented Nov 6, 2026

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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Tests selector

2 / 101 PR test projects · 4 PR jobs, from 12 changed files.

Selected PR test projects (2 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.ConfiguredGitSources.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.ConfiguredSources.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/NewCommandLocalTemplateTests.InitConfig.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Interaction/ConsoleInteractionServiceTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=False_width=120.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=False_width=40.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=True_width=120.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ConsoleInteractionServiceTests.PromptForSelectionAsync_TemplateSourceHeadingsAreLiteralAndFitWidth_gitSource=True_width=40.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Commands/NewCommand.cs, src/Aspire.Cli/Interaction/ConsoleInteractionService.cs, src/Aspire.Cli/Interaction/SelectionChoiceGroup.cs, src/Aspire.Cli/Templating/ConfiguredTemplateSourceService.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 4f06afb.

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.

🟢 Approval recommended

No active review issues block the configured-template source heading changes.

No open issues 🎉

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 6, 2026

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.

James Newton-King (JamesNK) added a commit that referenced this pull request Nov 6, 2026
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>
@radical
Ankit Jain (radical) merged commit db62c35 into main Nov 7, 2026
429 of 434 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 7, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2087

Generated by PR Documentation Check · copilot · auto · 25.7 AIC · ⌖ 1.16 AIC · ⊞ 7.4K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#2087 targeting release/17.0.

Documented the new template picker heading format in aspire new reference page. Triggered signals: cli_command_file_changed (NewCommand.cs), pr_body_has_user_facing_section (User-facing usage example), pr_body_has_cli_flag_mention.

Note

This draft PR needs human review before merging.

James Newton-King (JamesNK) added a commit that referenced this pull request Nov 8, 2026
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>
James Newton-King (JamesNK) added a commit that referenced this pull request Nov 8, 2026
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>
Mitch Denny (mitchdenny) added a commit that referenced this pull request Nov 10, 2026
## 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)
Mitch Denny (mitchdenny) added a commit that referenced this pull request Nov 10, 2026
## 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)
Jose Perez Rodriguez (joperezr) pushed a commit that referenced this pull request Nov 11, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants