Add git template system spec, feature flag, and command stubs (Phase 1)#16927
Open
mitchdenny wants to merge 1 commit into
Open
Add git template system spec, feature flag, and command stubs (Phase 1)#16927mitchdenny wants to merge 1 commit into
mitchdenny wants to merge 1 commit into
Conversation
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16927Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16927" |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR lays the foundation for a git-based Aspire template system by adding a detailed architecture spec plus a feature-flagged aspire template command group (stubs only), with wiring, localization resources, and unit tests to validate parsing and feature-flag gating.
Changes:
- Added the
gitTemplatesEnabledfeature flag (defaultfalse) and gated registration of the newaspire templatecommand group behind it. - Introduced
aspire template+list/search/refresh/newstub subcommands (return success with a “not yet implemented” message) and wired them into DI andRootCommand. - Added localized command strings resources (RESX + generated designer + XLF set) and unit tests covering command registration and invocation behavior.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs | Registers git template command stubs in the test DI container. |
| tests/Aspire.Cli.Tests/Commands/Template/GitTemplateCommandsTests.cs | Adds feature-flag gating + parsing/exit-code tests for the new command group and subcommands. |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.zh-Hant.xlf | Adds localization file for new template command strings (zh-Hant). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.zh-Hans.xlf | Adds localization file for new template command strings (zh-Hans). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.tr.xlf | Adds localization file for new template command strings (tr). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.ru.xlf | Adds localization file for new template command strings (ru). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.pt-BR.xlf | Adds localization file for new template command strings (pt-BR). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.pl.xlf | Adds localization file for new template command strings (pl). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.ko.xlf | Adds localization file for new template command strings (ko). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.ja.xlf | Adds localization file for new template command strings (ja). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.it.xlf | Adds localization file for new template command strings (it). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.fr.xlf | Adds localization file for new template command strings (fr). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.es.xlf | Adds localization file for new template command strings (es). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.de.xlf | Adds localization file for new template command strings (de). |
| src/Aspire.Cli/Resources/xlf/TemplateCommandStrings.cs.xlf | Adds localization file for new template command strings (cs). |
| src/Aspire.Cli/Resources/TemplateCommandStrings.resx | Adds base (en) resource strings for aspire template commands. |
| src/Aspire.Cli/Resources/TemplateCommandStrings.Designer.cs | Adds generated strongly-typed resource wrapper for template command strings. |
| src/Aspire.Cli/Program.cs | Registers git template command stubs in the CLI DI container. |
| src/Aspire.Cli/KnownFeatures.cs | Adds KnownFeatures.GitTemplatesEnabled with metadata and default false. |
| src/Aspire.Cli/Commands/Template/GitTemplateSearchCommand.cs | Adds stub aspire template search <keyword> command. |
| src/Aspire.Cli/Commands/Template/GitTemplateRefreshCommand.cs | Adds stub aspire template refresh command. |
| src/Aspire.Cli/Commands/Template/GitTemplateNewCommand.cs | Adds stub aspire template new [path] command. |
| src/Aspire.Cli/Commands/Template/GitTemplateListCommand.cs | Adds stub aspire template list command. |
| src/Aspire.Cli/Commands/Template/GitTemplateCommand.cs | Adds parent aspire template command and subcommand wiring. |
| src/Aspire.Cli/Commands/RootCommand.cs | Gates registration of aspire template on gitTemplatesEnabled. |
| src/Aspire.Cli/Aspire.Cli.csproj | Adds RESX + Designer integration for the new TemplateCommandStrings resources. |
| docs/specs/git-templates.md | Adds the git template system architecture spec and phased implementation plan. |
Copilot's findings
Files not reviewed (1)
- src/Aspire.Cli/Resources/TemplateCommandStrings.Designer.cs: Language not supported
- Files reviewed: 26/27 changed files
- Comments generated: 0
This is the first slice of resuming the git-based template work originally spiked in #14763. The architectural change vs. the spike is that template discovery is delegated to a single `aspire.dev` HTTP endpoint instead of a federated walk of `aspire-template-index.json` files in user-owned repos. That means: - No per-repo `aspire-template-index.json` schema (collapsed in §3 of the spec into a service-response schema). - No `includes` federation, cycle detection, depth limits, or `gh`-based personal/org auto-discovery. - No `aspire template new-index` command (end users don't author indexes; the catalog is owned by the aspire.dev service). - Configuration collapses to `templates.serviceUrl` + `templates.cacheTtlMinutes`. What this PR contains (foundation only — no real implementation yet): - `docs/specs/git-templates.md` — full architecture spec, revised for the service-delegated discovery model. - `KnownFeatures.GitTemplatesEnabled` feature flag (default `false`). - The `aspire template` command group with four stub subcommands behind the feature flag: - `aspire template list` - `aspire template search <keyword>` - `aspire template refresh` - `aspire template new [path]` - Wiring into `RootCommand` and DI in `Program.cs` /`CliTestHelper.cs`. - `TemplateCommandStrings.resx` + Designer + 13 generated XLFs. - Parse + feature-flag-gating tests. All new C# class names use a `Git` prefix (`GitTemplateCommand`, etc.) to avoid type-name collision with the existing `Aspire.Cli.Commands.TemplateCommand`, which is the per-template wrapper used by `NewCommand`. The user-facing CLI verb is unchanged: `aspire template`. Enable for local testing with`:` aspire config set features.gitTemplatesEnabled true Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6863a7a to
f2ff0bc
Compare
Contributor
|
🎬 CLI E2E Test Recordings — 77 recordings uploaded (commit View all recordings
📹 Recordings uploaded automatically from CI run #25646413155 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is the first slice of resuming the git-based template work originally spiked in #14763. The goal is to let users (and downstream catalogs) install Aspire project/item templates straight from git repositories, instead of being limited to NuGet template packs.
The architectural change vs. the spike is that template discovery is delegated to a single
aspire.devHTTP endpoint instead of a federated walk ofaspire-template-index.jsonfiles in user-owned repos. This keeps the CLI thin and lets the catalog evolve server-side.That means:
aspire-template-index.jsonschema (collapsed into a service-response schema in spec §3).includesfederation, cycle detection, depth limits, orgh-based personal/org auto-discovery.aspire template new-indexcommand (end users do not author indexes; the catalog is owned by the aspire.dev service).templates.serviceUrl+templates.cacheTtlMinutes.This PR is foundation only. There is no real implementation behind the commands yet, the work is gated behind a feature flag that defaults to
false, and end users see no behavior change. Subsequent phases (HTTP catalog client, repo cache, list/search/refresh,template new, polyglot engine) ship in their own PRs as outlined in spec §15.What this PR contains
docs/specs/git-templates.md: full architecture spec, revised for the service-delegated discovery model. Section 15 lays out the phased rollout.KnownFeatures.GitTemplatesEnabledfeature flag (defaultfalse).aspire templatecommand group with four stub subcommands behind the feature flag:aspire template listaspire template search <keyword>aspire template refreshaspire template new [path]RootCommandand DI inProgram.csandCliTestHelper.cs.TemplateCommandStrings.resx+ Designer + 13 generated XLFs.Notes for reviewers
Gitprefix (GitTemplateCommand, etc.) to avoid a type-name collision with the existingAspire.Cli.Commands.TemplateCommand, which is the per-template wrapper used byNewCommand. The user-facing CLI verb is unchanged:aspire template.IInteractionService.DisplayMessageand returnSuccessso they exercise the wiring without pretending to do work.aspire.dev) and exact JSON shape in §3 are placeholders subject to change as the service team finalizes the contract.Checklist
<remarks />and<code />elements on your triple slash comments?