-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GetArgumentListAsync
to resource extentions
#6646
base: main
Are you sure you want to change the base?
Conversation
/// </remarks> | ||
/// <param name="resource">The resource to get the arguments from.</param> | ||
/// <returns>The arguments retrieved from the resource.</returns> | ||
public static async ValueTask<IReadOnlyList<string>> GetArgumentListAsync(this IResourceWithArgs resource) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there any places in the current code that can be using this new API now? I see a bunch of places where we already have this logic. Especially in tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there are. Do you want me to update those codes that use this new API or can I do this in another PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do it here. It adds extra validation to the API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution, @Alirexaa.
@mitchdenny @davidfowl - any concerns?
Yea I think we need to unify these methods (this and GetEnvironmentVariables async) with what happens at runtime. I'm guessing you're using this for testing, but it is missing some critical functionality that we added in 9.
|
@davidfowl @eerhardt |
Description
This pull request introduces a new method to retrieve arguments from resources asynchronously and includes updates to the public API and tests to support this new functionality.
New Method for Argument Retrieval:
GetArgumentListAsync
method toResourceExtensions
to retrieve arguments from resources asynchronously. This method handles different types of arguments, including those provided byIValueProvider
. (src/Aspire.Hosting/ApplicationModel/ResourceExtensions.cs
)Public API Update:
PublicAPI.Unshipped.txt
to include the newGetArgumentListAsync
method in the public API. (src/Aspire.Hosting/PublicAPI.Unshipped.txt
)Unit Tests:
GetArgumentListAsyncReturnCorrectArguments
to verify thatGetArgumentListAsync
returns the correct arguments. (tests/Aspire.Hosting.Tests/ResourceExtensionsTests.cs
)DummyResource
class implementingIResourceWithArgs
for testing purposes. (tests/Aspire.Hosting.Tests/ResourceExtensionsTests.cs
)Fixes #6644 6644
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):Microsoft Reviewers: Open in CodeFlow