Skip to content

Inherit template sources from explicit init configuration - #21388

Merged
Mitch Denny (mitchdenny) merged 11 commits into
mainfrom
mitchdenny-init-config-template-sources
Nov 1, 2026
Merged

Mitch Denny (mitchdenny) merged 11 commits into
mainfrom
mitchdenny-init-config-template-sources

Conversation

@mitchdenny

@mitchdenny Mitch Denny (mitchdenny) commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Description

Enterprises can distribute template sources through their existing init-config repository without asking each developer to register those sources globally. This follows the template-source commands merged in #21329.

When ASPIRE_INIT_SOURCE_URL is explicitly set, interactive aspire new search combines that repository's templateSources with the user's global sources. Source listing has a separate consent contract:

  • Human-readable aspire template source list uses the same candidate selection and consent prompt as aspire new. Accepting includes inherited sources; declining lists only global definitions. An employee-detected candidate can be offered through this consent flow. Non-interactive listing with an available candidate requires --use-config-source to accept or --use-config-source false to decline.
  • aspire template source list --format json never prompts and defaults to global-only output without resolving, validating, or fetching an init source. Add --use-config-source to acquire and include inherited definitions; Git authentication is unattended and diagnostics remain on stderr.
  • On every command exposing it (new, init, and template-source listing), bare --use-config-source means true. Explicit true/false values remain accepted for compatibility. Omitting the option retains nullable, unspecified consent rather than silently opting in.
  • Global aliases win case-insensitively as complete definitions, without inheriting repository/ref/path fields from an overridden source.
  • Non-colliding sources coexist, including branch-pinned Git sources and personal local-directory sources.
  • Inherited sources are runtime-only: they are never written to user or project configuration. Project-level template sources remain ignored, and listing never materializes project files.
  • Add/remove continue editing only global definitions. Removing a global override reveals the inherited source again when inheritance is enabled.
  • Existing project-materialization consent remains unchanged. For template discovery/search, an explicit environment URL authorizes runtime template-config acquisition; employee detection alone does not enable discovery inheritance.

The implementation reuses init-config validation, Git authentication, cancellation, timeout, and immutable snapshot acquisition. Search and opted-in listing share collision behavior, and repeated reads reuse the invocation's snapshot. Attempted source acquisition failures remain explicit rather than returning a successful global-only result.

User-facing usage

For an init repository containing:

{
  "templateSources": {
    "enterprise": {
      "repository": "https://git.acme.example/platform/templates",
      "ref": "template-preview",
      "path": "templates"
    }
  }
}
export ASPIRE_INIT_SOURCE_URL=https://git.acme.example/platform/aspire-init
export ASPIRE_INIT_SOURCE_REF=config-preview
# Global-only JSON; no init-source acquisition or consent prompt.
aspire template source list --format json
# Include inherited sources without prompting.
aspire template source list --format json --use-config-source
# Prompt whether to include the proposed configuration source.
aspire template source list
aspire new
# Skip source consent with a bare opt-in on new/init as well.
aspire new aspire-starter --use-config-source
aspire init --use-config-source

The existing Search for more templates flow searches both enterprise and personal global sources. Unsetting ASPIRE_INIT_SOURCE_URL removes the explicit inherited source from subsequent invocations; human-readable listing may still offer an employee-detected candidate through its normal consent flow.

Security considerations

An explicitly set environment variable authorizes fetching template configuration during discovery/search without another consent prompt. Listing instead requires consent: human-readable output prompts when unspecified, while JSON requires explicit --use-config-source (or its compatible true form). Acquisition can make outbound Git connections and publish snapshots under Aspire home using the existing source-validation, authentication, timeout, locking, and cache infrastructure. JSON opt-in disables interactive Git authentication. Only templateSources is overlaid, and project-file materialization still requires its existing consent. No separate threat model or security review has been performed.

Validation

Passed after the bare-flag change: 782 tests, 0 skipped, 0 failures:

MSBUILDTERMINALLOGGER=false DiffEngine_Disabled=true \
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \
  --filter-class '*.NewCommandLocalTemplateTests' \
  --filter-class '*.ConfigSourceServiceTests' \
  --filter-class '*.ConfigSourceCommandTests' \
  --filter-class '*.InitCommandTests' \
  --filter-class '*.TemplateSourceStartupTests' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true'

Final parser validation passed 9 tests after removing an unnecessary async test signature:

MSBUILDTERMINALLOGGER=false DiffEngine_Disabled=true \
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- \
  --filter-method '*.TemplateSourceList_ConfigSourceOption*' \
  --filter-not-trait 'quarantined=true' \
  --filter-not-trait 'outerloop=true'

Passed: MSBUILDTERMINALLOGGER=false dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj --no-restore -v:quiet and git diff --check.

Passed: MSBUILDTERMINALLOGGER=false dotnet build tests/Aspire.Cli.EndToEnd.Tests/Aspire.Cli.EndToEnd.Tests.csproj --no-restore -v:quiet with 0 warnings/errors. Existing E2E helper invocations now use the bare flag; the Linux-only Docker E2E suite was not executed locally.

Behavioral command-invocation tests cover interactive accept/decline, omitted/bare/explicit true/false options, invalid values, following-option parsing, JSON no-prompt/no-fetch defaults, non-interactive consent, absent/detected candidates, alias precedence, preserved refs, output snapshots, and unchanged configuration files. new and init materialization tests now exercise bare acceptance.

An isolated actual-CLI proof against a generic local Git fixture verified bare opt-in before/after --format json, compatible explicit/inline true, global-plus-inherited parseable JSON, ref/path preservation, unchanged settings, default/false no-fetch behavior, help on all three commands, invalid Boolean rejection, and bare new/init selecting the source without consuming subsequent options. Earlier real authenticated remote init/template proof covered combined interactive search, generation, overrides, non-persistence, environment removal, and unavailable-ref failure. Private fixture contents and screenshots are not included in this public PR.

The full repository suite was 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

Merge runtime template sources with global definitions without persisting inherited settings. Preserve source refs and whole-definition global precedence across discovery and listing.

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

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

Or

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

@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.

🔵 Needs a closer look

Allowing authenticated Git acquisition during discovery based solely on an environment URL changes the consent boundary and warrants human security review, which the PR explicitly reports has not occurred.

No open issues 🎉

What changed in this PR

Extends the global template-source support from #21329 so enterprises can provide sources through an explicitly configured init repository, without requiring developers to register them globally.

Changes:

  • Adds runtime-only inheritance for interactive template search and source listing, reusing existing configuration acquisition and snapshot caching.
  • Merges aliases case-insensitively, with global definitions replacing inherited definitions completely; add/remove remain global-only.
  • Documents the authorization and persistence boundaries and adds tests for overrides, failures, search, generation, and JSON output.
File Description
tests/​Aspire.Cli.Tests/​Snapshots/​NewCommandLocalTemplateTests.InitConfigSources_ListJsonIncludesInheritedSourcesWithoutSavingConfiguration.verified.json Captures inherited-source JSON output, including unknown fields.
tests/​Aspire.Cli.Tests/​Configuration/​ConfigurationServiceTests.cs Supplies the new store dependency in permission-preservation tests.
tests/​Aspire.Cli.Tests/​Configuration/​ConfigSourceServiceTests.cs Tests explicit environment selection, snapshot reuse, validation, and non-persistence.
tests/​Aspire.Cli.Tests/​Commands/​NewCommandLocalTemplateTests.InitConfig.cs Tests inherited listing, overrides, search, generation, and acquisition failures.
src/​Aspire.Cli/​Templating/​TemplateSourceStore.cs Combines inherited and global sources for listing.
src/​Aspire.Cli/​Templating/​TemplateSourceConfiguration.cs Adds shared case-insensitive, whole-definition merging.
src/​Aspire.Cli/​Templating/​ConfiguredTemplateSourceService.cs Includes inherited sources in template discovery.
src/​Aspire.Cli/​Configuration/​ConfigSourceService.cs Acquires and validates environment-authorized template sources.
docs/​specs/​cli-config-sources.md Defines runtime inheritance, precedence, consent, and persistence behavior.

Review effort: Balanced

@github-actions

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.

Reuse the new command's configuration-source selection and consent flow. Keep JSON listing global-only without acquisition unless explicitly opted in, and disable interactive Git authentication for machine-readable listing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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.

🔵 Needs a closer look

The runtime-inheritance flow lacks CLI end-to-end regression coverage for repository acquisition, inherited and global template search, inherited-template generation, settings non-persistence, and opted-in JSON listing.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Add CLI regression test for runtime source inheritance

src/​Aspire.Cli/​Templating/​ConfiguredTemplateSourceService.cs:33

The new runtime-inheritance flow has no CLI end-to-end regression covering real init-repository acquisition followed by inherited-template search and generation. Add a terminal scenario that declines project materialization, searches inherited and global sources, generates an inherited template, and verifies that inherited definitions are not persisted in global or project settings. Also cover opted-in JSON listing with --use-config-source true to protect its acquisition and output contract.

Review effort: Balanced

@github-actions

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

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found 2 issues: 1 compilation failure in the PR merge and 1 CLI E2E coverage gap. Native CLI checks covered JSON opt-in/out, inheritance, complete-definition overrides, explicit failures, and non-persistence; interactive search and private Git authentication were not exercised.

Update callers added on main for the explicit config-source listing argument, preserving their global-only management semantics.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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.

🟡 Changes recommended

The command documentation promises inherited sources without showing the required --use-config-source true flag for JSON output or explaining the separate consent flow for table output.

1 open issue

Review effort: Balanced

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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.

🔵 Needs a closer look

Human assessment is needed because inherited configuration is validated only after snapshot publication and cleanup, risking listing/search failures and loss of the last known-good cached snapshot.

No open issues 🎉

1 resolved since last review
2 files not reviewed
  • src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated file
  • src/Aspire.Cli/Resources/ErrorStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5e88623..22b18b5 with focus on SSH. Found 1 correctness issue, documented inline. Validation: 771 tests passed, 2 skipped; isolated Windows CLI reproduction confirmed the issue.

Comment thread src/Aspire.Cli/Git/GitCommandRunner.cs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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.

🔵 Needs a closer look

Changes to environment-authorized acquisition and cross-platform unattended SSH policy alter consent and authentication boundaries, warranting human security review and Git/OpenSSH validation given the reported absence of a threat model or security review.

No open issues 🎉

2 files not reviewed
  • src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated file
  • src/Aspire.Cli/Resources/ErrorStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

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

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

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

Copy link
Copy Markdown
Contributor

Tests selector

3 / 100 PR test projects · 4 PR jobs, from 89 changed files.

Selected PR test projects (3 / 100)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Infrastructure.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

🔧 src/Aspire.Cli/Resources/ConfigSourceStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Cli/Resources/ErrorStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Cli/Resources/NewCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/Helpers/ConfigSourceTestContext.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Commands/ConfigSourceCommandTests.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/Commands/NewCommandLocalTemplateTests.SourceList.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

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

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

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

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

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

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

🧪 tests/Aspire.Cli.Tests/Git/GitCommandRunnerTests.Authentication.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

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

🧪 tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_Help_ShowsFileBasedOption.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.InitConfigSources_ListJsonIncludesInheritedSourcesWithoutSavingConfiguration.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=False_interactive=False_useSource=False_accept=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=False_interactive=False_useSource=True_accept=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=False_interactive=True_useSource=False_accept=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=False_interactive=True_useSource=True_accept=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=False_interactive=True_useSource=null_accept=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=False_interactive=True_useSource=null_accept=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=True_interactive=False_useSource=False_accept=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=True_interactive=False_useSource=True_accept=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=True_interactive=False_useSource=null_accept=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=True_interactive=True_useSource=False_accept=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=True_interactive=True_useSource=True_accept=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_ConsentControlsInitConfiguration_json=True_interactive=True_useSource=null_accept=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=False_useSource=False_accept=False_priorCache=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=False_useSource=null_accept=False_priorCache=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=False_useSource=null_accept=False_priorCache=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=False_useSource=null_accept=True_priorCache=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=True_useSource=False_accept=False_priorCache=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=True_useSource=False_accept=False_priorCache=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=True_useSource=True_accept=False_priorCache=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=True_useSource=null_accept=False_priorCache=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/NewCommandLocalTemplateTests.TemplateSourceList_RealGitAcquisitionFollowsConsentWithoutPersistingSettings_json=True_useSource=null_accept=False_priorCache=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

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

🧪 tests/Aspire.Cli.Tests/TestServices/TestConfigSourceServices.cs (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/TemplateManagementCommand.cs, src/Aspire.Cli/Configuration/AspireConfigFile.cs, src/Aspire.Cli/Configuration/ConfigSourceService.cs, src/Aspire.Cli/Git/GitCommandException.cs, src/Aspire.Cli/Git/GitCommandRunner.cs, src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs, src/Aspire.Cli/Resources/ConfigSourceStrings.resx, src/Aspire.Cli/Resources/ErrorStrings.Designer.cs, src/Aspire.Cli/Resources/ErrorStrings.resx, src/Aspire.Cli/Resources/NewCommandStrings.resx, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.de.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.es.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.it.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hant.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.de.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.es.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.it.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/ErrorStrings.zh-Hant.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/NewCommandStrings.zh-Hant.xlf, src/Aspire.Cli/Templating/ConfiguredTemplateSourceService.cs, src/Aspire.Cli/Templating/TemplateSourceConfiguration.cs, src/Aspire.Cli/Templating/TemplateSourceStore.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 1fbf6c6.

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.

🔵 Needs a closer look

Human assessment is needed to evaluate the compatibility impact of SSH validation rejecting safely quoted executable paths containing parentheses.

No open issues 🎉

2 files not reviewed
  • src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated file
  • src/Aspire.Cli/Resources/ErrorStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

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.

@mitchdenny
Mitch Denny (mitchdenny) merged commit 262105c into main Nov 1, 2026
417 of 421 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Nov 1, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2013

Generated by PR Documentation Check · copilot · auto · 28.6 AIC · ⌖ 1.15 AIC · ⊞ 7.1K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

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

Documents --use-config-source and inherited template sources in aspire new and aspire init references. Signals: cli_command_file_changed (TemplateManagementCommand.cs), cli_resource_strings_changed (ConfigSourceStrings.resx), pr_body_has_cli_flag_mention, pr_body_has_user_facing_section. Note: aspire template source list has no docs page yet; it is described in aspire-new.mdx.

Note

This draft PR needs human review before merging.

Mitch Denny (mitchdenny) added a commit that referenced this pull request Nov 5, 2026
## Description

Show templates from configured Git and directory sources alongside
built-in templates in interactive `aspire new`, without a separate
source submenu. This builds on #21329, #21388, and #21420; it does not
close those already-merged issues/PRs.

The terminal picker uses nonselectable source headings, retains built-in
ordering and defaults, and selects the exact discovered template object
even when names collide. Leaves use `Template Name (Template
Description)` without repeating the source or short name; missing
descriptions leave just the name. The separate search action has been
removed from the initial picker; explicit template search/invocation
support is unchanged.

Template source objects support optional `displayName` in global and
accepted init-source configuration, for example:

```json
{
  "templateSources": {
    "company": {
      "repository": "https://github.com/example/templates",
      "displayName": "Company templates"
    }
  }
}
```

Missing, null, empty, or space-only display names use the alias. Other
types and control characters fail existing strict configuration
validation. `aspire config set templateSources.company.displayName
"Company templates" --global` edits an existing source; no new flag is
added. Typed load/save, source listing, configuration edits and runtime
inheritance preserve the field. Global-over-inherited alias collisions
replace the entire definition, including the display name. Inherited
values are never persisted to global or generated-project configuration.

Aliases remain the stable group identity, command reference and
source-disambiguating flat label; identical display names do not merge
sources or select a different source. Headings now use bold/default
foreground, following existing CLI section headings such as `aspire
doctor`, rather than Spectre's faded disabled grey. Leaf-only navigation
is unchanged.

Grouped console labels normalize multiline whitespace and truncate the
combined name/description with an ellipsis to the available
terminal-cell width, reserving arrow, indentation and padding. Source
headings and the selected-value echo also fit the width. Spectre's
cell-aware cropping preserves grapheme clusters, wide characters and
combining sequences; metadata is safely escaped. Full template metadata
is retained.

The pinned Spectre.Console 0.57.2 uses the same converter for display
and search and has no separate search predicate. Following the explicit
UX decision to keep Spectre and truncate in the CLI, case-insensitive
search matches only the visible prefix of a truncated label, not its
hidden tail. No dependency update or custom prompt is introduced.
Type-to-search moves to a matching choice; it does not filter the list.

Grouping and terminal display labels are optional interaction-service
metadata. VS Code retains the unchanged flat `string[]` RPC and complete
unique source-qualified labels; extension grouping and description
search remain deferred. Existing inherited-source consent/no-fetch
boundaries, explicit and noninteractive flows, source acquisition
warnings, cached snapshots, authentication protections, and post-action
authorization remain intact.

Validation for the latest friendly-heading revision:

```bash
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class '*.ConsoleInteractionServiceTests' --filter-class '*.ExtensionInteractionServiceTests' --filter-class '*.NewCommandLocalTemplateTests' --filter-class '*.TemplateSourceConfigurationTests' --filter-class '*.AspireConfigFileTests' --filter-class '*.ConfigSourceServiceTests' --filter-class '*.SettingsSchemaBuilderTests' --filter-class '*.ConfigCommandTests' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'
```

Result: **1048 passed, 0 failed, 1 skipped**. Covers typed serialization
and schema, strict field validation, source updates/listing, inherited
display names without persistence, complete global alias precedence,
duplicate friendly headings and exact template generation,
consent/no-fetch, unchanged extension fallback, terminal cell-width
thresholds and narrow terminals, Unicode/combining sequences, escaped
markup, normalized multiline labels and visible-prefix-only search.
Rendering and configuration snapshots were reviewed and the suite rerun
successfully.

```bash
dotnet build /t:UpdateXlf src/Aspire.Cli/Aspire.Cli.csproj -v:q
git diff --check
```

Result: **both passed**. Localized display-name validation and
allowed-field diagnostics regenerated.

A refreshed screenshot of the actual repository-built CLI, with friendly
source names, bold/default headings and a long description cropped with
an ellipsis, is provided in the associated Copilot handoff, not uploaded
GitHub media. Earlier screenshots and the description-search recording
predate these latest formatting changes. No cloud resources or external
account changes were used.

## 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>
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.

3 participants