Skip to content

Add --file-based to aspire init - #20004

Merged
Mitch Denny (mitchdenny) merged 4 commits into
mainfrom
mitchdenny-aspire-force-empty
Sep 11, 2026
Merged

Mitch Denny (mitchdenny) merged 4 commits into
mainfrom
mitchdenny-aspire-force-empty

Conversation

@mitchdenny

@mitchdenny Mitch Denny (mitchdenny) commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Description

Repositories can contain incidental .sln or .slnx files that cause aspire init to prompt for a solution or scaffold a solution-based AppHost when the user only wants an empty, file-based AppHost at the repository root.

Adds --file-based to bypass .NET solution discovery entirely and reuse the existing C# single-file scaffold in the current directory. The option requires C#: selecting another language explicitly, through configuration, or at the language prompt fails with a clear error before scaffolding or persisting language selection. Existing-file protection, supporting configuration, and agent setup remain unchanged. Omitting the flag or passing --file-based false preserves normal initialization for all languages.

User-facing usage

Run from the repository root:

aspire init --file-based --language csharp

For non-interactive scaffolding without agent setup:

aspire init --file-based --language csharp --non-interactive --suppress-agent-init

New option in aspire init --help:

--file-based  Create apphost.cs in the current directory, skipping .NET solution discovery. Requires C#.

Includes localized help, a localized validation error, and a CLI README example.

Validation

  • All 75 InitCommandTests passed, including explicit, configured, and prompted non-C# rejection; no project/configuration changes on rejection; unchanged behavior with the option false or omitted; discovery bypass; existing-file preservation; and help/skeleton snapshots.
  • Three CLI E2E cases passed in Linux arm64 Docker against a freshly built CLI archive. FileBasedInitRejectsTypeScriptWithoutChangingFiles covers explicit and configured TypeScript selections and verifies exit code 1, the error message, and unchanged project/configuration files. FileBasedCSharpInitIgnoresIncidentalSolutions preserves incidental solutions/projects, starts the generated root AppHost, and confirms it has no resources.
  • The earlier dogfood report documents the original --force-empty spelling at commit b9ad0621. It is historical evidence: the option was subsequently renamed to --file-based and now rejects non-C# selections in response to review feedback.

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

Bypass .NET solution discovery while preserving language selection and existing scaffolding safeguards. Include localized help, documentation, unit coverage, and a CLI end-to-end regression.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: a1def9cc-ebd2-4303-bac9-cbcc1c2c0a97
@github-actions

github-actions Bot commented Sep 9, 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 -- 20004

Or

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

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

Copilot review overview

🟢 Approval recommended

The behavior change is narrowly scoped, matches the PR description, and is covered by both unit/snapshot tests and an end-to-end regression scenario.

Review tier: Lite
Findings: None

What changed in this PR

Adds a new aspire init option to force single-file, repo-root C# initialization even when incidental .sln/.slnx files are present, avoiding solution selection prompts and solution-based AppHost scaffolding.

Changes:

  • Added --force-empty to InitCommand to bypass .NET solution discovery for C# and always use the single-file skeleton in the working directory.
  • Added/updated unit + snapshot tests to cover help output and discovery-bypass behavior (including incidental/nested solutions).
  • Added an end-to-end test for --force-empty and updated CLI README + localized resources for the new help text.
File Description
src/​Aspire.Cli/​Commands/​InitCommand.cs Adds and wires --force-empty to skip solution discovery for C# initialization.
src/​Aspire.Cli/​Resources/​InitCommandStrings.resx Adds localized string for the new option description.
src/​Aspire.Cli/​Resources/​InitCommandStrings.Designer.cs Adds strongly-typed accessor for ForceEmptyOptionDescription.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.cs.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.de.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.es.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.fr.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.it.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.ja.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.ko.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.pl.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.pt-BR.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.ru.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.tr.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.zh-Hans.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​Resources/​xlf/​InitCommandStrings.zh-Hant.xlf Adds XLIFF entry for the new option description.
src/​Aspire.Cli/​README.md Documents aspire init --force-empty usage and expected behavior.
tests/​Aspire.Cli.Tests/​Commands/​InitCommandTests.cs Adds/extends coverage for --force-empty (skip discovery, help text, behavior alongside TypeScript and existing-file cases).
tests/​Aspire.Cli.Tests/​TestServices/​TestSolutionLocator.cs Adds a test double to assert solution discovery is not invoked.
tests/​Aspire.Cli.Tests/​Snapshots/​InitCommandTests.InitCommand_Help_ShowsForceEmptyOption.verified.txt Snapshot for updated init --help output including the new option.
tests/​Aspire.Cli.Tests/​Snapshots/​InitCommandTests.InitCommand_ForceEmpty_SkipsSolutionDiscovery.verified.txt Snapshot for the generated single-file AppHost content when discovery is bypassed.
tests/​Aspire.Cli.EndToEnd.Tests/​CSharpInitTests.cs Adds E2E scenario ensuring --force-empty ignores incidental solutions and still produces a runnable, empty root AppHost.
Files not reviewed (1)
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@mitchdenny

Copy link
Copy Markdown
Member Author

PR Testing Report

PR Information

  • PR: #20004 - Add --force-empty to aspire init
  • Head commit: b9ad06218484cc9fe4cf1dc16cdf24d84fe95ed7
  • Tested at: 2026-09-09T05:56:06Z
  • Execution target: Repository container runner, Ubuntu 24.04, Linux arm64 on Docker Desktop.
  • Result: All eight final scenario checks passed. No product defect was found.

Artifact Version Verification

  • Artifact source: Dogfood installation instructions.
  • Build: GitHub Actions run 34302778727.
  • Expected commit: b9ad06218484cc9fe4cf1dc16cdf24d84fe95ed7.
  • Installed CLI: /workspace/.aspire/dogfood/pr-20004/bin/aspire.
  • Installed version: 13.6.0-pr.20004.gb9ad0621.
  • Status: VERIFIED. The embedded short SHA matches the PR head. The head was rechecked after testing and had not changed.
  • Prerequisites: .NET SDK 10.0.401, Node.js v24.20.0, npm 11.19.0.

The official dogfood command was used without extra installer flags. The installation completed successfully. The skill's example follow-up binary path, /workspace/.aspire/bin/aspire, did not exist; subsequent commands used the actual path printed by the installer. No CLI artifact or bundle was repaired or replaced.

Changes Analyzed

Files Changed

  • src/Aspire.Cli/Commands/InitCommand.cs: registers the option and bypasses solution discovery when enabled.
  • src/Aspire.Cli/README.md: usage and behavior boundaries.
  • src/Aspire.Cli/Resources/InitCommandStrings.resx: option help.
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: resource accessor.
  • Thirteen src/Aspire.Cli/Resources/xlf/InitCommandStrings.*.xlf files: generated localization units.
  • tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs: focused and regression coverage.
  • tests/Aspire.Cli.Tests/TestServices/TestSolutionLocator.cs: shared solution-locator fake.
  • tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_ForceEmpty_SkipsSolutionDiscovery.verified.txt: empty skeleton.
  • tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_Help_ShowsForceEmptyOption.verified.txt: help output.
  • tests/Aspire.Cli.EndToEnd.Tests/CSharpInitTests.cs: end-to-end force-empty scenario.

Change Categories

CLI behavior, localization/documentation, and tests. No hosting integration, dashboard, project-template, client/component, VS Code extension, or CI infrastructure implementation changes.

Method

Each initialization scenario used a fresh temporary directory seeded with only its intended existing files. Using aspire new before an aspire init scenario would pre-create an AppHost and test the wrong path; aspire new was exercised separately in scenario 8.

All init invocations were non-interactive with explicit language selection and --suppress-agent-init. C# source was compared against the complete expected empty skeleton; original fixture files were compared byte-for-byte, except the TypeScript root package manifest, whose complete expected merged JSON was asserted. Structured JSON assertions checked configured AppHost paths and runtime resources.

Runtime checks used aspire start, then dashboard HTTP readiness and aspire describe --format json, followed by aspire stop. The force-empty startup deliberately omitted --apphost to validate normal discovery beside incidental solutions. Follow-up commands specified the AppHost path explicitly.

Test Scenarios Executed

1. Force-empty with root and nested incidental solutions

Coverage: Happy path. Status: PASSED.

Seeded a root .sln, a nested .slnx, and an existing .csproj. Ran:

aspire init --language csharp --non-interactive --suppress-agent-init --force-empty

Initialization succeeded without a solution-selection prompt. The current directory contained the exact empty apphost.cs, apphost.run.json, and a configuration pointing to apphost.cs. No additional .csproj was created. All existing solution and project files remained unchanged.

Evidence: logs/confirmed-incidental.log, generated-projects.tar.gz.

2. Malformed incidental solutions

Coverage: Negative/boundary. Status: PASSED.

Seeded deliberately invalid root .sln and nested .slnx contents. Ran the same force-empty command.

Expected outcome: Do not parse or select those files; successfully create an empty C# AppHost and leave them untouched.

The generated source and configured path matched scenario 1. Both malformed files remained byte-for-byte unchanged, and no project files were created.

Evidence: logs/confirmed-malformed.log, generated-projects.tar.gz.

3. Preserve an existing AppHost and configuration

Coverage: Boundary/overwrite protection. Status: PASSED.

Seeded a user-owned apphost.cs, custom apphost.run.json, custom aspire.config.json, and an incidental solution. Ran force-empty.

Expected outcome: Report that apphost.cs exists and skip it; do not overwrite the AppHost or existing configuration.

All four files remained byte-for-byte unchanged. The command exited successfully with the existing-file message. As intended by the existing initialization flow, NuGet source setup still ran.

Evidence: logs/confirmed-existing.log, generated-projects.tar.gz.

4. Omitted flag retains solution-based initialization

Coverage: Regression. Status: PASSED.

In a fresh directory containing Existing.slnx, ran:

aspire init --language csharp --non-interactive --suppress-agent-init

The command installed the PR template and created Existing.AppHost/Existing.AppHost.csproj and Existing.AppHost/AppHost.cs. It did not create a root apphost.cs. The original solution was preserved.

Evidence: logs/confirmed-omitted.log, generated-projects.tar.gz.

5. Explicit false retains solution-based initialization

Coverage: Option boundary/regression. Status: PASSED.

In a separate fresh directory containing Existing.slnx, ran:

aspire init --language csharp --non-interactive --suppress-agent-init --force-empty false

The output structure matched scenario 4: a project-based Existing.AppHost, no root file-based AppHost, and unchanged solution contents.

Evidence: logs/confirmed-explicit-false.log, generated-projects.tar.gz.

6. TypeScript brownfield selection remains intact

Coverage: Language-selection/layout regression. Status: PASSED.

Seeded an existing package.json, server.js, and incidental .slnx. Ran:

aspire init --language typescript --force-empty --non-interactive --suppress-agent-init

The command created aspire-apphost/apphost.mts, installed its npm dependencies, and configured appHost.path as aspire-apphost/apphost.mts with language typescript/nodejs. It did not create a C# AppHost. The existing server and solution were unchanged. The root package manifest preserved its original fields and start script while adding the expected three Aspire delegate scripts.

Evidence: logs/confirmed-typescript.log, generated-projects.tar.gz.

7. Start the force-empty AppHost beside incidental solutions

Coverage: Runtime/end-to-end. Status: PASSED.

Started the AppHost generated in scenario 1 through normal discovery:

aspire start --format json --non-interactive
aspire describe --apphost /workspace/confirmed/incidental/apphost.cs --format json --non-interactive
aspire stop --apphost /workspace/confirmed/incidental/apphost.cs --non-interactive

The CLI discovered the root file-based AppHost despite the incidental project and solutions. It reported a running AppHost PID and dashboard URL. The dashboard responded with HTTP 200 after its normal login redirect. The complete resource array was empty. Stop completed successfully.

Evidence: logs/confirmed-incidental-runtime.log and logs/confirmed-incidental-runtime/ containing startup JSON, stderr, HTTP status, dashboard HTML, resources JSON, and stop output.

8. Basic new/start/stop smoke

Coverage: CLI creation/runtime regression. Status: PASSED.

Created a separate fresh project with the installed PR version and explicit PR hive:

aspire new aspire-empty --name NewSmoke --output /workspace/confirmed/new-smoke \
  --source /workspace/.aspire/hives/pr-20004/packages \
  --version 13.6.0-pr.20004.gb9ad0621 --language csharp \
  --localhost-tld false --suppress-agent-init --non-interactive

Started the generated AppHost, confirmed dashboard HTTP 200 after its login redirect, asserted an empty resource array, and stopped it successfully.

Evidence: logs/confirmed-new-smoke-runtime.log and logs/confirmed-new-smoke-runtime/.

Initial Setup and Harness Corrections

These were not PR defects; the final scenarios were rerun in fresh directories after resolving them:

  • The minimal runner had neither the .NET SDK nor npm. Solution-based initialization initially failed because it could not launch dotnet. TypeScript scaffolding created files but warned that dependency installation was skipped. The missing prerequisites were then installed into the temporary workspace.
  • The initial Node archive used xz, which the runner lacked. The corresponding official gzip archive was downloaded, its checksum verified, and extracted instead.
  • The first ad-hoc assertions assumed the project template emitted Program.cs; the actual template emits AppHost.cs.
  • The first TypeScript assertion incorrectly required its root package.json to remain byte-identical. Existing brownfield behavior adds delegate scripts. The corrected assertion checks the entire expected merged manifest.
  • The first HTTP assertion expected a direct 200 from /; authenticated dashboards normally redirect to login. The corrected request follows that redirect.

Initial outputs are retained in install.log, init-run.log, prerequisites.log, prerequisites-final.log, scenarios-final.log, and the corresponding initial scenario logs.

Summary

Scenario Status
Incidental root/nested solutions Passed
Malformed incidental solutions Passed
Existing-file/configuration preservation Passed
Omitted flag Passed
Explicit false Passed
TypeScript brownfield layout Passed
Force-empty AppHost runtime Passed
New/start/stop smoke Passed

Overall Result

PR VERIFIED for the exercised Linux arm64 scenarios.

No PR source changes were needed, and the repository working tree remained clean.

Scope and Limitations

  • This run tested the published PR dogfood artifact, not a replacement local build.
  • No Windows or native macOS scenarios were run during this dogfood pass.
  • Interactive language and agent-setup prompts were not exercised; language was explicit and agent setup suppressed.
  • Container certificate trust reported a partial-trust warning. Dashboard requests used curl's -k for the development certificate; host/browser trust was not validated.
  • No dashboard UI code changed, so HTTP readiness, structured resource output, and logs were used rather than browser screenshots.

Artifacts

Paths below are relative to this report:

  • version-help.log: installed version and CLI option help.
  • scenarios-confirmed.log: consolidated successful final run.
  • logs/confirmed-results.tsv: all eight final exit codes.
  • logs/confirmed-*.log: per-scenario command output.
  • logs/confirmed-incidental-runtime/ and logs/confirmed-new-smoke-runtime/: runtime evidence.
  • generated-projects.tar.gz: final generated projects, excluding build caches and node_modules.
  • fixtures/: original inputs.
  • run-init.sh, verify-init.mjs, run-runtime.sh: scenario commands and assertions.

Cleanup

  • Inspection/cleanup: The user was unavailable to choose inspection. The default cleanup was applied: both AppHosts were stopped, no runner container remained, the temporary workspace was deleted, and the dedicated Docker volume aspire-pr-20004-a1def9cc-test was removed. The shared runner image was not removed. All report artifacts listed above remain preserved in session storage.

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.

1 CLI naming issue: the new option name does not accurately distinguish the file-based AppHost mode it selects.

Comment thread src/Aspire.Cli/Commands/InitCommand.cs Resolved
Clarify that the option selects a file-based AppHost rather than bypassing overwrite protection. Update help, localization, documentation, and unit/E2E coverage.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a1def9cc-ebd2-4303-bac9-cbcc1c2c0a97
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 11, 2026 03:02
@mitchdenny Mitch Denny (mitchdenny) changed the title Add --force-empty to aspire init Add --file-based to aspire init Sep 11, 2026
@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.

Copilot review overview

🟢 Approval recommended

The behavior is comprehensively covered; only a minor help-text grammar correction remains.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​Aspire.Cli/​Resources/​InitCommandStrings.resx — Add the missing subject in the option description
Files not reviewed (1)
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file

Regenerate translations and the help snapshot with the corrected description.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a1def9cc-ebd2-4303-bac9-cbcc1c2c0a97
@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.

Copilot review overview

🟢 Approval recommended

The implementation matches the documented behavior and includes focused unit, snapshot, and end-to-end coverage.

Review tier: Balanced
Findings: None

Issues resolved since last review (1)
Severity Finding
Low severity src/​Aspire.Cli/​Resources/​InitCommandStrings.resx — Add the missing subject in the option description View resolved comment
Files not reviewed (1)
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file

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

Consider whether to add more validation to option

Comment thread src/Aspire.Cli/Commands/InitCommand.cs Resolved
Reject non-C# selections before scaffolding or persisting language preferences. Cover explicit, configured, and prompted selections and preserve behavior when the option is false or omitted.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a1def9cc-ebd2-4303-bac9-cbcc1c2c0a97
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot September 11, 2026 05:23
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

2 / 99 PR test projects · 4 PR jobs · 1 advisory-only target, from 21 changed files.

Selected PR test projects (2 / 99)

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

Selected PR jobs (4)

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

Advisory workflow impact (1)

  • deployment-e2e (schedule/dispatch-only)

How these were chosen — grouped by what changed

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

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

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

🧪 tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_FileBased_SkipsSolutionDiscovery.verified.txt (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/TestServices/TestSolutionLocator.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
deployment-e2e affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Commands/InitCommand.cs, src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs, src/Aspire.Cli/Resources/InitCommandStrings.resx, src/Aspire.Cli/Resources/xlf/InitCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/InitCommandStrings.zh-Hant.xlf, tests/Aspire.Cli.EndToEnd.Tests/CSharpInitTests.cs, tests/Aspire.Cli.Tests/Commands/InitCommandTests.cs, tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_FileBased_SkipsSolutionDiscovery.verified.txt, tests/Aspire.Cli.Tests/Snapshots/InitCommandTests.InitCommand_Help_ShowsFileBasedOption.verified.txt, tests/Aspire.Cli.Tests/TestServices/TestSolutionLocator.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 8740145.

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.

Copilot review overview

🟢 Approval recommended

The implementation matches the described behavior and includes focused unit, snapshot, and end-to-end coverage.

Review tier: Balanced
Findings: None

Files not reviewed (1)
  • src/Aspire.Cli/Resources/InitCommandStrings.Designer.cs: Generated file

@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 cc51526 into main Sep 11, 2026
344 of 350 checks passed
@mitchdenny
Mitch Denny (mitchdenny) deleted the mitchdenny-aspire-force-empty branch September 11, 2026 07:02
@github-actions github-actions Bot added this to the 13.6 milestone Sep 11, 2026
aspire-repo-bot Bot added a commit to microsoft/aspire.dev that referenced this pull request Sep 11, 2026
Documents the --file-based flag added in microsoft/aspire#20004, which
bypasses .NET solution discovery to always scaffold a single-file
apphost.cs and requires C#.

Co-authored-by: Copilot <[email protected]>
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #1648

Generated by PR Documentation Check · auto · 62.5 AIC · ⌖ 11 AIC · ⊞ 18.3K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#1648 targeting release/13.6.

Added a documentation update for the new --file-based option on aspire init, triggered by signals cli_command_file_changed, cli_option_added, cli_resource_strings_changed, pr_body_has_cli_flag_mention, and pr_body_has_user_facing_section.

  • Updated src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx:
    • New "Skipping solution discovery with --file-based" subsection describing the behavior and the C#-only requirement.
    • Added --file-based to the Options list.
    • Added a usage example: aspire init --file-based --language csharp.

Note

This draft PR needs human review before merging.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ CI Failure Analysis: Possible Flaky Test(s)

The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests.

Suspected flaky test(s):

  • VS Code extension E2E (Linux, tree-actions) in job Tests / Run VS Code extension E2E tests / VS Code extension E2E (Linux, tree-actions)
    • Error: Process completed with exit code 1.
    • Stack Trace (first frames):
      No TRX test failures were extracted for this run; job logs were unavailable ('Failed to fetch logs for job').
      
    • Why likely flaky: Generic exit code 1 failure with no available logs or TRX failures, on a PR that does not touch VS Code extension code. Consistent with other known flaky VS Code extension E2E shard failures unrelated to PR changes.

Suggested actions:

  • Re-run the failed CI jobs to confirm if the failure is intermittent
  • If the test continues to fail, consider quarantining it using /quarantine-test <test name> <issue URL>
  • Search existing issues to see if this test is already known to be flaky

You can re-run the failed jobs from the workflow run page.

David Pine (IEvangelist) pushed a commit to microsoft/aspire.dev that referenced this pull request Sep 23, 2026
Documents the --file-based flag added in microsoft/aspire#20004, which
bypasses .NET solution discovery to always scaffold a single-file
apphost.cs and requires C#.

Co-authored-by: aspire-repo-bot[bot] <268009190+aspire-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants