Repository navigation
Limit configuration sources to project-local settings - #21679
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21679Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21679" |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🟡 Changes recommended
The tests use a global fixture disconnected from the service, leaving advisory checks and forced refresh without coverage that would catch reintroduced processing of the real global settings file.
1 open issue
1 file not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated file
What changed in this PR
This PR limits Aspire CLI configuration-source checks and refreshes to the selected project's nearest local configuration file, preventing global bindings from triggering Git access or configuration changes.
Changes:
- Removes global-binding discovery and multi-binding processing from
ConfigSourceService. - Simplifies shared check metadata to one nullable applied version, with legacy metadata revalidation.
- Updates regression tests, command help, generated localization resources, and specifications.
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/TestServices/TestConfigSourceServices.cs | Removes global-settings injection from the service helper. |
| tests/Aspire.Cli.Tests/Configuration/ConfigSourceServiceTests.cs | Revises local-only, shared-cache, and legacy-metadata tests. |
| tests/Aspire.Cli.Tests/Commands/ConfigSourceCommandTests.cs | Verifies explicit refresh ignores a global binding. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hant.xlf | Updates generated Traditional Chinese help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.zh-Hans.xlf | Updates generated Simplified Chinese help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.tr.xlf | Updates generated Turkish help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ru.xlf | Updates generated Russian help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pt-BR.xlf | Updates generated Brazilian Portuguese help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.pl.xlf | Updates generated Polish help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ko.xlf | Updates generated Korean help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.ja.xlf | Updates generated Japanese help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.it.xlf | Updates generated Italian help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.fr.xlf | Updates generated French help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.es.xlf | Updates generated Spanish help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.de.xlf | Updates generated German help resource. |
| src/Aspire.Cli/Resources/xlf/ConfigSourceStrings.cs.xlf | Updates generated Czech help resource. |
| src/Aspire.Cli/Resources/ConfigSourceStrings.resx | Describes refresh as nearest-local only. |
| src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs | Aligns the resource accessor's documentation with the help text. |
| src/Aspire.Cli/Configuration/ConfigSourceService.cs | Processes only the nearest local binding and simplifies cache comparisons. |
| src/Aspire.Cli/Configuration/ConfigSource.cs | Replaces the compared-version array with a nullable string. |
| docs/specs/cli-config-sources.md | Documents local-only behavior and revised coverage requirements. |
| docs/specs/cli-config-sources-1p-scenarios.md | Clarifies that global bindings have no effect. |
Review effort: Balanced
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the project-local configuration-source changes.
No open issues 🎉
1 resolved since last review
1 file not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated file
Review effort: Balanced
Preserve project-local-only configuration-source checks alongside adoption and explicit project opt-outs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests selector3 / 100 PR test projects · 4 PR jobs, from 20 changed files. Selected PR test projects (3 / 100)
Selected PR jobs (4)
How these were chosen — grouped by what changed📦 affected project 🔧 🧪 🧪 🧪 Job reasons
Selection computed for commit |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes limiting configuration-source processing to the nearest local configuration file.
No open issues 🎉
1 file not reviewed
src/Aspire.Cli/Resources/ConfigSourceStrings.Designer.cs: Generated file
Review effort: Balanced
|
Pull request created: #2025
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2025 targeting Documented Note This draft PR needs human review before merging. |

Description
Configuration sources belong to projects, but the CLI currently also checks and refreshes
configSourcebindings found in global configuration. This can cause unexpected Git access and changes to global settings. Ignore global bindings so adding one has no effect.ConfigSourceService.comparedAppliedVersionin check metadata instead of an array. Older metadata is revalidated once when its observation does not match the project's applied version.Other global settings, including named
templateSources, retain their existing behavior.User-facing usage
Keep the source binding in the project's
aspire.config.json, then refresh it with:Only the nearest local binding is refreshed. If only global configuration contains a binding, this command succeeds with the existing no-source notice and performs no Git acquisition or configuration writes.
Relevant generated help:
Validation
Final config-source service and command regression tests: passed, 221 succeeded, 0 failed, 0 skipped.
Localization regeneration: passed, 0 warnings and 0 errors.
dotnet build src\Aspire.Cli\Aspire.Cli.csproj /t:UpdateXlfCommitted diff whitespace validation: passed.
The full repository suite was not run.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?