Repository navigation
Rename "packages" to "integrations" in aspire.config.json with backward compatibility - #15633
Maddy Montaquila (maddymontaquila) with Copilot wants to merge 11 commits into
Conversation
|
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 <[email protected]>
Added backward compatibility in a25121c. Now:
|
There was a problem hiding this comment.
Pull request overview
This PR migrates aspire.config.json from the legacy "packages" key to the new "integrations" key while preserving backward-compatible reads, and updates the VS Code extension types/schema plus the playground fixtures accordingly.
Changes:
- Updated
AspireConfigFileJSON serialization to write"integrations"and added a legacy"packages"read path merged post-deserialization. - Updated CLI/extension types and JSON schema to recognize
"integrations"(keeping"packages"for backward compat). - Updated tests and playground
aspire.config.jsonfiles to use"integrations".
Reviewed changes
Copilot reviewed 155 out of 155 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Aspire.Cli/Configuration/AspireConfigFile.cs | Writes "integrations" via [JsonPropertyName], reads legacy "packages" into LegacyPackages and merges on load/save. |
| tests/Aspire.Cli.Tests/Configuration/AspireConfigFileTests.cs | Adds unit tests covering legacy read, new key read, merge behavior, precedence, and save output key. |
| tests/Aspire.Cli.EndToEnd.Tests/ProjectReferenceTests.cs | Updates E2E test mutation logic to write integrations in the config JSON. |
| tests/Aspire.Cli.EndToEnd.Tests/ConfigMigrationTests.cs | Updates E2E CLI command usage from packages to integrations. |
| extension/src/utils/cliTypes.ts | Extends AspireConfigFile TS type with integrations? and keeps packages? as deprecated. |
| extension/schemas/aspire-config.schema.json | Adds "integrations" schema property and retains "packages" with deprecated wording. |
| playground/**/aspire.config.json | Renames "packages" → "integrations" across the playground configs. |
Comments suppressed due to low confidence (1)
extension/schemas/aspire-config.schema.json:207
- The schema describes
packagesas deprecated, but VS Code’s JSON schema support won’t typically surface that as a deprecation warning based on the description alone. If the intent is to guide users away frompackages, consider adding a VS Code-recognized deprecation marker (e.g.,deprecationMessage) to thepackagesproperty while keeping it in the schema for backward compatibility.
"packages": {
"description": "Deprecated: use \"integrations\" instead. Legacy key for integration references, kept for backward compatibility.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
|
Copilot address the feedback |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15633Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15633" |
Addressed all three review items in aa4e505:
|
| "path": "AppHost.java", | ||
| "language": "java" | ||
| }, | ||
| "features": { | ||
| "experimentalPolyglot:java": true | ||
| }, | ||
| "integrations": { | ||
| "Aspire.Hosting.SqlServer": "" | ||
| }, |
…et/delete/read Address PR #15633 Opus review feedback: - Normalize legacy "packages" key to "integrations" on config set/delete (migrating the file in place to avoid dual-key files) and on directory-scoped and process-wide read paths so aspire config list/get/set/delete behave consistently for legacy files. - Restore AzureFunctionsSample/RpsArena playground aspire.config.json to contain only the intended packages->integrations rename (revert unrelated sdk/channel/profiles/path edits; appHost.path points to the existing apphost.mts). Co-authored-by: Copilot <[email protected]>
Address post-fix review feedback on PR #15633: - Restore corrupted polyglot test fixtures: each changed tests/PolyglotAppHosts/*/{Python,TypeScript}/aspire.config.json is reset to main content with only the "packages" -> "integrations" rename. Fixes broken appHost.path targets (Python pointed at a non-existent ValidationAppHost/apphost.py; SqlServer TypeScript pointed at AppHost.java instead of apphost.mts) and restores dropped features/environmentVariables. - Remove the legacy "packages" property from the bundled extension schema (extension/schemas/aspire-config.schema.json) so it matches the runtime schema, which hides the legacy key (SettingsSchemaBuilder.BuildConfigFileSchema). - Rename "packages" -> "integrations" in the go/py/java/ts starter template aspire.config.json files so generated projects emit the new key directly. - Delete 51 orphaned playground/polyglot/ files that were re-added but are absent from main. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
extension/schemas/aspire-config.schema.json:200
- The schema has
"additionalProperties": falseat the root level (line 238) but the deprecated"packages"property was removed rather than kept alongside"integrations". This means any existingaspire.config.jsonfile that still uses the legacy"packages"key will show a schema validation error in VS Code (or any editor using this schema), breaking the stated backward-compatibility goal. A deprecated"packages"entry should be added to the schema'spropertiesso older files validate without errors.
"integrations": {
"description": "Integration references for non-first-class languages. Key is package name, value is version. A value ending in \".csproj\" is treated as a project reference.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- Files reviewed: 114/114 changed files
- Comments generated: 0 new
Co-authored-by: Copilot <[email protected]>
Ensure deploy-target pipeline execution runs deployment prerequisites before build and push prerequisite dependents so resource annotation mutation cannot race annotation enumeration. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
extension/schemas/aspire-config.schema.json:200
- The JSON schema has
"additionalProperties": falseat the root level but no longer includes"packages"as a defined property. This means existingaspire.config.jsonfiles that still use the legacy"packages"key will fail schema validation (e.g., red squiggles in VS Code) because the schema treats unknown keys as disallowed. Since the PR's goal is backward compatibility for reading files with the old key, the schema should still define"packages"(perhaps with a deprecation notice in its description) so validation doesn't break for users who haven't yet been auto-migrated.
"integrations": {
"description": "Integration references for non-first-class languages. Key is package name, value is version. A value ending in \".csproj\" is treated as a project reference.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
- Files reviewed: 117/117 changed files
- Comments generated: 1
The packages-to-integrations rename PR should only carry config migration/back-compat changes. Restore the prior target-step dependency filtering behavior and remove the deploy-prereq ordering tests introduced by the unrelated pipeline fix. Co-authored-by: Copilot <[email protected]>
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
The static VS Code schema looks like it dropped the legacy packages property even though this PR keeps CLI read support for it. Since the root schema has additionalProperties: false and package.json binds this schema to aspire.config.json, existing files that still use packages will now show IDE validation errors despite being supported by the CLI. Could we keep packages in this schema as deprecated, matching the backward-compat story?
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
I think the static VS Code schema still needs to allow the old packages property. The CLI remains backward-compatible, but extension/schemas/aspire-config.schema.json now has additionalProperties: false and no packages, and package.json wires that schema to aspire.config.json. Existing configs will get IDE validation errors even though the CLI accepts them.
Could we keep packages in the schema as a deprecated alias, matching the runtime compatibility?
|
❓ CLI E2E Tests unknown — 115 passed, 0 failed, 2 unknown (commit View all recordings
📹 Recordings uploaded automatically from CI run #27428799832 |
Adam Ratzman (adamint)
left a comment
There was a problem hiding this comment.
One more consistency thing on the latest head: the fixture migration is mixed. All Go and Java polyglot fixtures under tests/PolyglotAppHosts/**/aspire.config.json still use packages, and a handful of Python/TypeScript fixtures do too, while the rest were moved to integrations.
Runtime back-compat means this is not a correctness blocker, but it means Java/Go do not exercise the new key in those fixture paths, and contributors copying one of those configs will keep seeing the legacy spelling. Could we either migrate the rest, or call out that the remaining packages fixtures are intentionally kept as legacy-key coverage?
| "integrations": { | ||
| "description": "Integration references for non-first-class languages. Key is package name, value is version. A value ending in \".csproj\" is treated as a project reference.", |
|
We need to:
|
Description
Renames the
"packages"JSON key to"integrations"inaspire.config.jsonwhile 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 thePackagesproperty. Added aLegacyPackagesproperty with[JsonPropertyName("packages")]and a[Description]marking it as deprecated, for backward-compatible reading.MergeLegacyPackages()merges legacy entries intoPackagesafter deserialization. When both keys exist,"integrations"takes precedence.LegacyPackagesis nulled after merge and excluded from serialization viaWhenWritingNull.extension/src/utils/cliTypes.ts: Addedintegrations?toAspireConfigFileinterface; keptpackages?with@deprecatedmarker for backward compatibility.extension/schemas/aspire-config.schema.json: Added"integrations"property and kept"packages"as deprecated for backward compatibility.aspire.config.jsonfiles: Updated key from"packages"to"integrations".ProjectReferenceTests.cs(renamedpackagesvariable tointegrationsfor clarity) andConfigMigrationTests.csto use"integrations". Added 5 new backward-compatibility tests inAspireConfigFileTests.cscovering: 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:
Checklist
<remarks />and<code />elements on your triple slash comments?aspire.devissue:🔒 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.