Skip to content

Write aspire.config.json with the OS line endings and a final newline - #21252

Merged
David Pine (IEvangelist) merged 7 commits into
mainfrom
ievangelist-aspire-config-lf-endings
Oct 27, 2026
Merged

David Pine (IEvangelist) merged 7 commits into
mainfrom
ievangelist-aspire-config-lf-endings

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Description

The CLI wrote aspire.config.json with whatever line break and final newline the command, the OS and the template happened to produce. System.Text.Json indents with Environment.NewLine and writes no trailing newline, and several templates are embedded and copied as-is, so they carried the line breaks of the checkout that built the CLI. The same scaffold therefore differed between aspire new and aspire init, and between CLI builds.

This writes the JSON config files the CLI manages (aspire.config.json, apphost.run.json, and the settings and MCP client config files it updates) with the OS line break (Environment.NewLine: CRLF on Windows, LF on Linux and macOS) and exactly one final newline (UTF-8, no BOM). Serialized configs already get the OS line break from System.Text.Json, so the CLI only appends the final newline it never writes. The embedded aspire.config.json and apphost.run.json templates are normalized as they are copied to disk, so they match what the CLI serializes.

An earlier revision forced LF on every OS and pinned the embedded templates with .gitattributes. Following James Newton-King (@JamesNK)'s review, files now use the OS line break instead: it matches what an editor produces on that OS, lets git normalize the files like any other text file, and avoids inconsistent line breaks when people edit the file by hand. Also following his review, line breaks are normalized only where an embedded template is copied, because text the serializer produces already uses the OS line break.

Fixes #21249

What changed

  • ConfigurationHelper.EnsureFinalNewline adds the OS newline that System.Text.Json never writes, unless the text already ends with a line break (LF or CRLF), so it never produces a second final newline. Every JSON config writer uses it on the serializer output, without normalizing line breaks: AspireConfigFile.Save, both writes in aspire init (aspire.config.json and apphost.run.json), ConfigurationHelper.WriteSettingsFile and WriteSettingsFileAsync (aspire config set and delete, the settings key-normalization rewrite, and the MCP client configs written by aspire agent init), WriteSettingsFileAtomicallyAsync (below), and the TypeScript AppHost migration.
  • ConfigurationHelper.WriteSettingsFileAtomicallyAsync, added to main by Implement project-bound Git configuration sources for Aspire CLI #20805, is what a Git configuration source uses to apply its settings to the project's aspire.config.json, so it needed the same contract. It now serializes to text, passes it through EnsureFinalNewline and writes it as UTF-8 without a BOM. It also writes the source cache's check.json, which gains the final newline as a side effect. The cache's other files (the compact snapshot aspire.config.json, metadata.json and the current pointer) are internal to the CLI and unchanged.
  • ConfigurationHelper.NormalizeJsonFileContent rewrites CRLF and LF to the OS line break and ends the text with exactly one newline. It is used only for the embedded templates below, whose text carries the line breaks of the checkout that built the CLI. It rewrites only CRLF and LF instead of calling ReplaceLineEndings, which would also rewrite U+0085, U+2028 and U+2029, all legal raw characters inside a JSON string. The overload that takes the line break lets tests cover both styles on any OS.
  • CliTemplateFactory.CopyTemplateTreeToDiskAsync applies it to the embedded aspire.config.json and apphost.run.json only. Other template files are copied unchanged, which matters for mvnw and gradlew that must stay LF. The method is now internal so a test can call it.
  • There is no .gitattributes change: the eol=lf pins and the embedded-resource guard test from the first revision are gone.
  • Tests: one per writer (for the atomic writer, WriteSettingsFileAtomically_WritesOsLineBreaksAndSingleFinalNewline, which writes a new file and replaces an existing one that has the other line break and no final newline), a copy-path test for the embedded config files of every template that has one (CliTemplateFactoryConfigLineEndingTests), tests that EnsureFinalNewline adds one OS newline to serializer output and keeps an existing final LF or CRLF, and a shared LineEndingAssert helper. The copy-path and NormalizeJsonFileContent tests feed the line break that is not the OS one, and the EnsureFinalNewline theory feeds both LF and CRLF, so they fail on every OS if the conversion or the guard is missing.

Reviewer notes

  • OS line break, not always LF and not preserve-existing. A file with the other style is rewritten with the OS style the next time the CLI rewrites it. That is invisible when git normalizes line endings (core.autocrlf=true, text=auto).
  • MCP client configs change too. The shared settings writer also serves aspire agent init, so those files now end with a newline. That is 20 AgentInitClientSelectionTests snapshots with one added newline each: the 14 .verified.json snapshots lose their \ No newline at end of file marker, and in the 6 .verified.txt snapshots, which print each file's text followed by a line break, it shows as a blank line before the closing }. They are LF and Verify normalizes line endings, so they match on Windows too. Narrowing the change to aspire.config.json only is small if you prefer it.
  • Five more snapshots gain a final newline. They belong to tests main added, which compare what the writers produce: four ConfigSourceServiceTests snapshots of the project's aspire.config.json after a Git configuration source is materialized or updated (written by the atomic writer), and one ConfigurationHelperTests snapshot of a settings file after key normalization (written by WriteSettingsFile). Each differs only by that final newline, and Verify normalizes line endings, so they match on Windows too.
  • Merged main. The two upstream changes that overlap this PR are Implement project-bound Git configuration sources for Aspire CLI #20805 (project-bound Git configuration sources, which added WriteSettingsFileAtomicallyAsync) and Add directory and Git template engine support to aspire new #21263 (directory and Git template engine support in aspire new). The merge had one conflict, in ConfigurationHelperTests.cs, resolved by keeping the tests from both sides. The merge commit (f1ce547379) holds only that resolution, and the atomic writer change is the separate commit after it (7fd42afa5e).
  • Out of scope: other template files (apphost.ts, package.json and so on) and apphost.cs keep the line breaks of the build checkout. ScaffoldingService, which writes the scaffold files of a TypeScript or other guest AppHost (such as package.json) as the language support produces them, is not touched.

Validation

Windows, core.autocrlf=true, on the PR head 7fd42afa5e (which includes main at f990a9017d), with DOTNET_ROOT set to the repo's .dotnet and first on PATH.

  • Full project run: dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -p:SkipNativeBuild=true -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" -> 8576 tests: 8485 passed, 1 failed, 90 skipped (9m 11s). The failure is not a line-ending assertion:
    • TemporaryWorkspaceTests.RunGitAsync_Timeout_StopsProcessAndReportsPartialOutput: its git alias runs sleep 60 and the bash bundled with git on this machine has no sleep (exit code 127), so it fails the same way when run alone.
  • Negative controls, each run with the same dotnet test form and --filter-class. The first is on 7fd42afa5e; the other three are on b17f81c16c, before main was merged, so their counts do not include the tests main added:
    • With the change to WriteSettingsFileAtomicallyAsync reverted, both cases of WriteSettingsFileAtomically_WritesOsLineBreaksAndSingleFinalNewline (new file and existing file) fail. They pass with it restored.
    • With the copy-time normalization disabled (the template file-name check made never to match), all 6 cases of CliTemplateFactoryConfigLineEndingTests fail. They pass with it restored.
    • With EnsureFinalNewline returning its input unchanged, 24 tests fail: 4 of the 34 ConfigurationHelperTests (EnsureFinalNewline_AddsOneOsNewLineToSerializedJson, TryNormalizeSettingsFile_RewritesNonOsLineBreaksWithOsLineBreaks, and both WriteSettingsFile tests) and 20 AgentInitClientSelectionTests snapshot cases, including the OpenCode global / existing opencode.json one. They pass with it restored.
    • With the EndsWith('\n') guard removed (it always appends), exactly the 2 EnsureFinalNewline_KeepsExistingFinalNewline cases fail (LF and CRLF) and the other 32 of the 34 ConfigurationHelperTests pass.
  • Real CLI (aspire.dll built from this branch at 7fd42afa5e), checked byte by byte for line breaks, final newline and BOM. The aspire init and aspire new runs pass --use-config-source false, the option from main that declines the Git configuration source those commands propose:
    • aspire config set channel staging on an existing config with no final newline -> CRLF only, one final newline, no BOM.
    • aspire agent init --agents opencode --scope project --skills none --mcp --non-interactive, in a fresh workspace (which now writes opencode.jsonc) and in one with an existing opencode.json (updated in place) -> CRLF only, exactly one final newline, no BOM.
    • aspire init --language csharp --file-based (aspire.config.json and apphost.run.json) and aspire init --language typescript (aspire.config.json) -> CRLF only, one final newline, no BOM.
    • aspire new aspire-empty --version 13.5.0 --language csharp, which has no --channel, so the copied files are not re-saved by the serializer. The embedded templates in this checkout are LF (aspire.config.json has 5 LF, apphost.run.json has 30), and the generated aspire.config.json and apphost.run.json came out CRLF only (5 and 30 CRLF), one final newline, no BOM.
  • Not run locally: Linux and macOS (the tests use Environment.NewLine, so CI covers them); the other aspire new templates end to end, because a dev-build CLI cannot resolve a template version without a package feed (the copy-path test covers their embedded config files); the end-to-end test project.

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

System.Text.Json indents with Environment.NewLine and writes no final
newline, so the same aspire.config.json came out CRLF on Windows and LF
on Linux and macOS, and never ended with a newline. Some templates are also
embedded and copied byte for byte, so their line endings followed the
checkout instead of the product.

Normalize at the source:
- Add ConfigurationHelper.NormalizeJsonFileContent (CRLF to LF, exactly one
  final newline) and use it in every writer: AspireConfigFile.Save,
  aspire init (aspire.config.json and apphost.run.json), the shared
  settings writers (aspire config set/delete, aspire agent init MCP client
  configs) and the TypeScript AppHost migration.
- Pin the embedded template aspire.config.json and apphost.run.json files
  to eol=lf in .gitattributes.

Add tests for each writer, a guard over the embedded template resources,
and update the agent init snapshots for the final newline.

Fixes #21249

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c8717a87-0ee5-4296-a6fd-ea6e2d91a57e
@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 -- 21252

Or

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

@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

The formatting changes are narrowly scoped, have focused regression coverage, and have no identified blocking issues.

No open issues 🎉

What changed in this PR

Standardizes CLI-written JSON configuration files across operating systems, addressing #21249.

Changes:

  • Normalizes serialized configs to LF with exactly one final newline.
  • Pins embedded template configs to LF.
  • Adds regression coverage and updates MCP configuration snapshots.
File Description
tests/​Aspire.Cli.Tests/​Utils/​LineEndingAssert.cs Adds shared newline assertions.
tests/​Aspire.Cli.Tests/​Templating/​EmbeddedTemplateConfigTests.cs Checks embedded config formatting.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=project_partialOverride=True.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=project_partialOverride=False.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=global_partialOverride=True.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=global_partialOverride=False.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeJsonc_PreservesExistingSettingsWhenAddingServer_scopeName=project.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeJsonc_PreservesExistingSettingsWhenAddingServer_scopeName=global.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=project_jsonExists=True_jsoncExists=True.verified.txt Reflects config’s final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=project_jsonExists=True_jsoncExists=False.verified.txt Reflects config’s final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=project_jsonExists=False_jsoncExists=False.verified.txt Reflects config’s final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=global_jsonExists=True_jsoncExists=True.verified.txt Reflects config’s final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=global_jsonExists=True_jsoncExists=False.verified.txt Reflects config’s final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=global_jsonExists=False_jsoncExists=False.verified.txt Reflects config’s final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=opencode_scopeName=project.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=opencode_scopeName=global.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=copilot_scopeName=project.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=copilot_scopeName=global.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=claude_scopeName=project.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=claude_scopeName=global.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_AliasedMcpDestinations_ConfigureEachSelectedServerContainer_pinned=True.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Snapshots/​AgentInitClientSelectionTests.AgentInit_AliasedMcpDestinations_ConfigureEachSelectedServerContainer_pinned=False.verified.json Adds expected final newline.
tests/​Aspire.Cli.Tests/​Migrations/​TypeScriptAppHostMigrationTests.cs Checks migrated config formatting.
tests/​Aspire.Cli.Tests/​Configuration/​ConfigurationServiceTests.cs Tests CRLF normalization during set/delete.
tests/​Aspire.Cli.Tests/​Configuration/​ConfigurationHelperTests.cs Tests normalization and settings writers.
tests/​Aspire.Cli.Tests/​Configuration/​AspireConfigFileTests.cs Checks saved config formatting.
tests/​Aspire.Cli.Tests/​Commands/​NewCommandTemplateConfigPersistenceTests.cs Checks scaffolded config formatting.
tests/​Aspire.Cli.Tests/​Commands/​InitCommandTests.cs Checks new and merged config formatting.
src/​Aspire.Cli/​Utils/​ConfigurationHelper.cs Centralizes normalization for settings writers.
src/​Aspire.Cli/​Migrations/​TypeScriptAppHostMigration.cs Normalizes migrated config output.
src/​Aspire.Cli/​Configuration/​AspireConfigFile.cs Normalizes saved config output.
src/​Aspire.Cli/​Commands/​InitCommand.cs Normalizes both generated JSON configs.
.gitattributes Pins embedded JSON configs to LF.

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.

@JamesNK

James Newton-King (JamesNK) commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Isn't writing CRLF on WIndows correct? And then rely on git normalizing line endings correctly for the OS on checkout.

If aspire.config.json uses LF on Windows then people could get inconsistent line endings when they manually edit it.

@JamesNK

Copy link
Copy Markdown
Member

Isn't writing CRLF on WIndows correct? And then rely on git normalizing line endings correctly for the OS on checkout.

If aspire.config.json uses LF on Windows then people could get inconsistent line endings when they manually edit it.

Ah, the problem is the JSON file is embedded in the CLI, and copies the file to the local filesystem.

What about normalizing the JSON file line endings to the local system's when the embedded file is copied to the local filesystem?

Address review feedback on #21252: instead of forcing LF, write aspire.config.json and the other JSON config files the CLI produces with the OS line break and exactly one final newline.

- ConfigurationHelper.NormalizeJsonFileContent emits Environment.NewLine (CRLF on Windows, LF elsewhere) plus a single final newline. Only CRLF and LF are rewritten, so U+0085, U+2028 and U+2029 inside JSON strings are untouched.
- CliTemplateFactory normalizes the embedded aspire.config.json and apphost.run.json as they are copied to disk, so a CLI built from a checkout with different line endings still writes the OS line break.
- Drop the .gitattributes eol=lf pins and the embedded-resource guard test; the copy-time normalization replaces them and avoids the all-tests CI trigger.
- Tests assert the OS line break and feed the opposite style, so they discriminate on every OS. A copy-path test covers every embedded config template.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 38b1d961-84a4-42b6-be1a-e5479116ecbd
@aspire-repo-bot
aspire-repo-bot Bot requested a balanced review from Copilot October 22, 2026 11:43
@IEvangelist David Pine (IEvangelist) changed the title Write aspire.config.json with LF and a final newline on every OS Write aspire.config.json with the OS line endings and a final newline Oct 22, 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.

🟢 Approval recommended

The narrowly scoped formatting changes preserve JSON values, have focused regression coverage, and leave no unresolved blocking issues.

No open issues 🎉

Review effort: Balanced

System.Text.Json already indents with Environment.NewLine, so text it serializes needs no line break normalization and only lacks the trailing newline. AspireConfigFile.Save, both writes in aspire init, the settings file writers and the TypeScript AppHost migration now append the final newline through ConfigurationHelper.AppendFinalNewline instead of normalizing line breaks. Normalization stays only where an embedded template is copied to disk, because that text carries the line breaks of the checkout that built the CLI and some templates have no final newline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 38b1d961-84a4-42b6-be1a-e5479116ecbd
@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

The changes are limited to configuration formatting, preserve JSON values, and include focused regression coverage with no unresolved blocking issues.

No open issues 🎉

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.

Only append the OS newline when the text does not already end with a line break (LF or CRLF), so the helper never writes a second final newline. This follows the review suggestion to check for an existing final newline instead of always appending one.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 38b1d961-84a4-42b6-be1a-e5479116ecbd
@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

The changes are narrowly scoped, match the revised newline policy, and have focused regression coverage with no unresolved blocking issues.

No open issues 🎉

Review effort: Balanced

The only conflict was in tests/Aspire.Cli.Tests/Configuration/ConfigurationHelperTests.cs, where this branch and upstream both added tests at the same spot. Both sets of tests are kept.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 38b1d961-84a4-42b6-be1a-e5479116ecbd
main added ConfigurationHelper.WriteSettingsFileAtomicallyAsync in #20805. aspire uses it to apply a Git configuration source to the project aspire.config.json, and it serialized straight to the stream, so the file ended without the newline that the other settings writers add.

Serialize to text, run it through EnsureFinalNewline, and write the UTF-8 bytes without a byte order mark. System.Text.Json already indents with the OS line break.

Add a test for a new file and for replacing an existing file that uses the other line break style and has no final newline. Four ConfigSourceServiceTests snapshots and one ConfigurationHelperTests snapshot gain the final newline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 38b1d961-84a4-42b6-be1a-e5479116ecbd
@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

The formatting changes are narrowly scoped, preserve configuration values, and have focused regression coverage with no unresolved blocking findings.

No open issues 🎉

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.

@IEvangelist
David Pine (IEvangelist) enabled auto-merge (squash) October 26, 2026 13:54
@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

Tests selector

2 / 100 PR test projects · 4 PR jobs, from 38 changed files.

Selected PR test projects (2 / 100)

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/InitCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

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

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

🧪 tests/Aspire.Cli.Tests/Configuration/ConfigurationHelperTests.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/Migrations/TypeScriptAppHostMigrationTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_AliasedMcpDestinations_ConfigureEachSelectedServerContainer_pinned=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_AliasedMcpDestinations_ConfigureEachSelectedServerContainer_pinned=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=claude_scopeName=global.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=claude_scopeName=project.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=copilot_scopeName=global.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=copilot_scopeName=project.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=opencode_scopeName=global.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_DeprecatedMcpCommand_RepairsSelectedConfigurationWithoutReplacingOtherSettings_clientId=opencode_scopeName=project.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=global_jsonExists=False_jsoncExists=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=global_jsonExists=True_jsoncExists=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=global_jsonExists=True_jsoncExists=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=project_jsonExists=False_jsoncExists=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=project_jsonExists=True_jsoncExists=False.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeConfiguration_UsesExistingFormatAndPrecedence_scopeName=project_jsonExists=True_jsoncExists=True.verified.txt (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeJsonc_PreservesExistingSettingsWhenAddingServer_scopeName=global.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeJsonc_PreservesExistingSettingsWhenAddingServer_scopeName=project.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=global_partialOverride=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=global_partialOverride=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=project_partialOverride=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/AgentInitClientSelectionTests.AgentInit_OpenCodeSiblingJson_RepairsInheritedDeprecatedCommand_scopeName=project_partialOverride=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

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

🧪 tests/Aspire.Cli.Tests/Snapshots/ConfigSourceServiceTests.Update_PreservesNestedLiteralKeys_flattenedSource=False.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Snapshots/ConfigSourceServiceTests.Update_PreservesNestedLiteralKeys_flattenedSource=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

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

🧪 tests/Aspire.Cli.Tests/Snapshots/ConfigurationHelperTests.RegisterSettingsFiles_NormalizesCompletePathsAcrossCaseEquivalentSections_persistNormalization=True.verified.json (changed test)
→ 1 directly: Aspire.Cli.Tests

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

🧪 tests/Aspire.Cli.Tests/Utils/LineEndingAssert.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/InitCommand.cs, src/Aspire.Cli/Configuration/AspireConfigFile.cs, src/Aspire.Cli/Migrations/TypeScriptAppHostMigration.cs, src/Aspire.Cli/Templating/CliTemplateFactory.cs, src/Aspire.Cli/Utils/ConfigurationHelper.cs
• affected project Aspire.Cli
polyglot affected project Aspire.Cli
typescript-api-compat affected project Aspire.Cli

Selection computed for commit d14b691.

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

The changes are localized to configuration formatting, have focused regression coverage, and leave no identified blocking issues.

No open issues 🎉

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.

@IEvangelist
David Pine (IEvangelist) merged commit cd6c70f into main Oct 27, 2026
583 of 591 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 27, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

Skipped: proven false positive.

  • Triggered signals: cli_command_file_changed (src/Aspire.Cli/Commands/InitCommand.cs) and pr_body_has_cli_flag_mention (the hint is only the --no-launch-profile flag in the PR's test command, not a new CLI flag).
  • The PR adds no commands, options, flags, config keys or strings. It only changes whitespace in files the CLI writes: the OS line break and exactly one final newline in aspire.config.json, apphost.run.json and related JSON configs.
  • The aspire.dev docs have no page that describes line endings or final newlines in these files (grep for "line ending", "final newline", "trailing newline" and "CRLF" under src/frontend/src/content/docs returned no matches). There is no documented behavior to update.

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.

aspire.config.json line endings and final newline differ by command and platform

3 participants