Skip to content

[release/9.1] Resolve DistributedApplicationResourceBuilder<ResourceWithConnectionStringSurrogate> correctly in args evaluation#7727

Merged
danmoseley merged 4 commits intorelease/9.1from
backport/pr-7716-to-release/9.1
Feb 21, 2025
Merged

[release/9.1] Resolve DistributedApplicationResourceBuilder<ResourceWithConnectionStringSurrogate> correctly in args evaluation#7727
danmoseley merged 4 commits intorelease/9.1from
backport/pr-7716-to-release/9.1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Feb 21, 2025

Backport of #7716 to release/9.1

/cc @mitchdenny @adamint

Customer Impact

Currently in .NET Aspire we have had inconsistent handling of secret parameters depending on whether it is a connection string or a regular secret parameter. This manifested in the WithArgs(...) extension method incorrectly rendering connection string args as the type name of the resource builder. This was exposed by a recent improvement to the dashboard where we suppress display of secrets.

This PR fixes the underlying issue with secret connection string resources being used as arguments to resources (this was not a regression, but an existing issue that became more obvious with the dashboard improvements).

Testing

Manual testing and added unit tests.

Risk

Low. This wasn't working previously anyway - code change is very targeted.

Regression?

@github-actions github-actions Bot requested a review from mitchdenny as a code owner February 21, 2025 01:16
@mitchdenny mitchdenny added this to the 9.1 milestone Feb 21, 2025
@danmoseley danmoseley added the Servicing-approved Approved for servicing release label Feb 21, 2025
@danmoseley danmoseley requested a review from JamesNK February 21, 2025 02:50
@danmoseley danmoseley enabled auto-merge (squash) February 21, 2025 02:50
@danmoseley
Copy link
Copy Markdown
Member

@JamesNK since you're online could you be the 2nd review?

@danmoseley danmoseley merged commit 9d98476 into release/9.1 Feb 21, 2025
@danmoseley danmoseley deleted the backport/pr-7716-to-release/9.1 branch February 21, 2025 03:58
Copy link
Copy Markdown
Member

@JamesNK JamesNK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change is modest and makes sense.

There's a unit test for resolving the value for a container. I see there is an argument in the code to check whether the resource is a container or not. I assume that has some behavior impact.

Should there be a unit test to check this works for a project/exe?

@github-actions github-actions Bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 10, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants