Skip to content

Rename "packages" to "integrations" in aspire.config.json with backward compatibility#15633

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/rename-packages-to-integrations
Draft

Rename "packages" to "integrations" in aspire.config.json with backward compatibility#15633
Copilot wants to merge 3 commits intomainfrom
copilot/rename-packages-to-integrations

Conversation

Copy link
Contributor

Copilot AI commented Mar 26, 2026

Description

Renames the "packages" JSON key to "integrations" in aspire.config.json while maintaining full backward compatibility. The system reads both "packages" (legacy) and "integrations" (new) keys, but always writes "integrations" in new or saved files.

Changes

  • AspireConfigFile.cs: Changed [JsonPropertyName("packages")][JsonPropertyName("integrations")] on the Packages property. Added a LegacyPackages property with [JsonPropertyName("packages")] for backward-compatible reading, with MergeLegacyPackages() to merge legacy entries into Packages after deserialization. When both keys exist, "integrations" takes precedence. LegacyPackages is nulled after merge and excluded from serialization via WhenWritingNull.
  • extension/src/utils/cliTypes.ts: Added integrations? to AspireConfigFile interface; kept packages? with @deprecated marker for backward compatibility.
  • extension/schemas/aspire-config.schema.json: Added "integrations" property and kept "packages" as deprecated for backward compatibility.
  • 149 playground aspire.config.json files: Updated key from "packages" to "integrations".
  • Tests: Updated ProjectReferenceTests.cs and ConfigMigrationTests.cs to use "integrations". Added 5 new backward-compatibility tests in AspireConfigFileTests.cs covering: reading legacy "packages" key, reading new "integrations" key, merging both keys, precedence when both exist, and verifying only "integrations" is written on save.

Before / After:

// Before (still readable for backward compat)
{
  "packages": { "Aspire.Hosting.Redis": "9.2.0" }
}

// After (always written in new files)
{
  "integrations": { "Aspire.Hosting.Redis": "9.2.0" }
}

Note: The legacy .aspire/settings.json format (AspireJsonConfiguration) retains its "packages" key unchanged — that format is migrated into aspire.config.json on first use.

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
  • Does the change require an update in our Aspire docs?

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/991be4bf-31eb-490c-8c07-a1cebce5a01a

Co-authored-by: maddymontaquila <12660687+maddymontaquila@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix rename packages to integrations in aspire.config.json Rename "packages" to "integrations" in aspire.config.json Mar 26, 2026
Copilot AI requested a review from maddymontaquila March 26, 2026 23:56
@davidfowl
Copy link
Contributor

@copilot This needs to be backwards compatible. We need to support both now for reading (both packages and integrations) but write integrations in anything new.

… write only integrations

Agent-Logs-Url: https://github.com/microsoft/aspire/sessions/1581ecd1-3d79-4a46-bdd8-030eea387877

Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 27, 2026

@copilot This needs to be backwards compatible. We need to support both now for reading (both packages and integrations) but write integrations in anything new.

Added backward compatibility in a25121c. Now:

  • Reading: Both "packages" (legacy) and "integrations" (new) keys are supported. A LegacyPackages property reads "packages", and MergeLegacyPackages() merges entries into Packages after deserialization. When both exist, "integrations" takes precedence.
  • Writing: Always writes "integrations"LegacyPackages is nulled after merge and excluded via WhenWritingNull.
  • JSON schema and TypeScript interface both accept either key.
  • 5 new tests cover: reading legacy key, reading new key, merging both, precedence, and verifying only "integrations" is written.

Copilot AI changed the title Rename "packages" to "integrations" in aspire.config.json Rename "packages" to "integrations" in aspire.config.json with backward compatibility Mar 27, 2026
Copilot AI requested a review from davidfowl March 27, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants