Repository navigation
Graduate connection-string physical-name metadata - #22161
Maddy Montaquila (maddymontaquila) merged 1 commit into
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 22161Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 22161" |
There was a problem hiding this comment.
🔵 Needs a closer look
Public API graduation still requires maintainer confirmation of alias-projection compatibility and independently mutable init/with record-copy properties as long-term commitments.
No open issues 🎉
What changed in this PR
This draft proposes stabilizing Aspire’s connection-string physical-name metadata APIs introduced in #19729, without changing their public shape or runtime behavior. Compatibility and record-mutability contracts remain subject to maintainer review.
Changes:
- Removes experimental markers from
ConnectionStringEnvironmentVariableNamesandConnectionStringReference.EnvironmentVariableNames. - Removes related warning suppressions from consumers and existing tests.
- Documents diagnostic retirement and independent property initialization in record copies.
| File | Description |
|---|---|
| tests/Aspire.Hosting.Tests/WithReferenceTests.cs | Removes suppression around standalone-reference metadata assertions. |
| tests/Aspire.Hosting.Qdrant.Tests/AddQdrantTests.cs | Removes suppression around connection-name metadata assertions. |
| tests/Aspire.Hosting.Foundry.Tests/HostedAgentExtensionTests.cs | Removes suppression from reference-resolution coverage. |
| src/Aspire.Hosting/ResourceBuilderExtensions.cs | Removes the retired diagnostic suppression. |
| src/Aspire.Hosting/ApplicationModel/ConnectionStringReference.cs | Removes the property’s experimental marker and related suppression. |
| src/Aspire.Hosting/ApplicationModel/ConnectionStringEnvironmentVariableNames.cs | Removes the type’s experimental marker and documents record-copy behavior. |
| src/Aspire.Hosting.Radius/Publishing/RadiusInfrastructureBuilder.cs | Removes the metadata diagnostic suppression. |
| src/Aspire.Hosting.Qdrant/QdrantBuilderExtensions.cs | Removes the metadata diagnostic suppression. |
| src/Aspire.Hosting.Kubernetes/KubernetesResource.cs | Removes the metadata diagnostic suppression. |
| src/Aspire.Hosting.Foundry/HostedAgent/AzureHostedAgentResource.cs | Removes the metadata diagnostic suppression. |
| src/Aspire.Hosting.EntityFrameworkCore/EFMigrationResourceBuilderExtensions.cs | Removes the metadata diagnostic suppression. |
| src/Aspire.Hosting.Azure.AppService/AzureAppServiceWebsiteContext.cs | Removes the metadata diagnostic suppression. |
| docs/specs/connection-properties.md | Documents stable metadata APIs and record-copy semantics. |
| docs/list-of-diagnostics.md | Documents retirement of ASPIRECONNECTIONSTRINGS001. |
Review effort: Balanced
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
db05c2a to
2d33e4c
Compare
Tests selector52 / 101 PR test projects · 4 PR jobs, from 12 changed files. Selected PR test projects (52 / 101)
Selected PR jobs (4)
How these were chosen — grouped by what changed
🔧 show 36
🔧 🔧 🧪 📦 affected project 📦 affected project 🔧 🔧 🔧 🔧 🧪 🧪 Job reasons
Selection computed for commit |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
fd82cd8
into
release/17.0
|
Pull request created: #2167
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#2167 targeting Updated Note This draft PR needs human review before merging. |
Description
Consumers and publishers can use connection-string physical-name metadata without suppressing
ASPIRECONNECTIONSTRINGS001. This draft proposes graduating onlyConnectionStringEnvironmentVariableNamesandConnectionStringReference.EnvironmentVariableNames, preserving their functionality and public shape.Removes the two Experimental attributes and their directly related source/test suppressions. Documents diagnostic retirement and the existing record-copy behavior. No injection, normalization, collision, precedence, or publisher-projection code changes; no generated
api/*.csbaseline edits.Contract review required before marking ready
The user explicitly requested proposing both existing contracts as stable in a draft and flagging them for review. This is not a claim of maintainer API approval or upstream GA.
initaccessors andwithcopies can independently change names without recomputing the other properties. The constructor remains internal;Createderives consistent names.Both contracts are included in this proposal, so no replacement experimental diagnostic is introduced. If review decides a portion should remain unstable, split that portion under a focused diagnostic before marking this PR ready rather than changing injection behavior to remove a warning.
User-facing usage
For an existing
IResourceWithConnectionStringresource, no experimental-warning suppression is needed:This still yields
ConnectionStrings__my-dbandConnectionStrings__my_db. Consumers of generated references can readreference.EnvironmentVariableNames; standalone two-argument references still return null metadata.Original API attribution
cc Sébastien Ros (@sebastienros): the source introducing commit eefbb6d47d adds both APIs in #19729. Source history and the GitHub commit author identity agree on this login; this is a mention, not a reviewer assignment. No attribution uncertainty identified.
Release branch replay
Replayed only the original stabilization commit
db05c2a75dee758f01fa671c67f0ba9820881ac6, using its verified main fork point793dfe6e254fe050af24cb7bcfba214066dcaab8, ontorelease/17.0at9a97ab889bfb731de74ead0280be279ffdd000bf. The new head is2d33e4cb5aef87bbb76e69b85478b75af454d1a7: one intended commit, 14 changed files, 13 insertions and 25 deletions. No conflicts or release-specific code adaptations were needed;git range-diffconfirms the patch is unchanged. Unrelated main history is excluded.Validation — release/17.0
The following commands were rerun against the release-based head on macOS arm64 with the existing installed .NET SDK; quarantined and outerloop tests were excluded. Existing tests compile without this diagnostic's suppressions.
dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class '*WithReferenceTests*' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed, 65 tests.dotnet test --project tests/Aspire.Hosting.Qdrant.Tests/Aspire.Hosting.Qdrant.Tests.csproj --no-launch-profile -- --filter-method '*.QdrantClientAppWithReferenceContainsConnectionStrings' --filter-method '*.WithReferenceDispatchesQdrantReference' --filter-method '*.WithReferenceRejectsPrimaryAndHttpAliasCollision' --filter-method '*.RepeatedReferencesPreserveDistinctConnectionExpressions' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed, 5 tests on sequential retry.dotnet test --project tests/Aspire.Hosting.Foundry.Tests/Aspire.Hosting.Foundry.Tests.csproj --no-launch-profile -- --filter-method '*.GetResolvedEnvironmentVariables_*' --filter-not-trait 'quarantined=true' --filter-not-trait 'outerloop=true'— passed, 6 tests on sequential retry.git diff --check origin/release/17.0...HEAD— passed.git range-diff db05c2a75dee758f01fa671c67f0ba9820881ac6^..db05c2a75dee758f01fa671c67f0ba9820881ac6 origin/release/17.0..HEAD— passed; one unchanged patch.Initial concurrent Qdrant and Foundry attempts failed during NuGet restore with generated
.nuget.g.propsfiles already existing. Both commands passed when rerun individually after the hosting run completed; no source workaround was needed.Historical main validation (original head
db05c2a75dee758f01fa671c67f0ba9820881ac6): the same three test commands previously passed 65, 5 and 6 tests respectively, andgit diff --checkpassed. Those earlier results are not substituted for the release results above.Full repository build and live deployment tests were not run; runtime behavior is unchanged.
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?