Skip to content
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 XML Docs for WithArgs() #1308

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Add XML Docs for WithArgs() #1308

merged 2 commits into from
Dec 12, 2023

Conversation

ericmutta
Copy link
Contributor

The wording in the XML docs is based on my cursory review of issue 177 and PR 1121.

I should add that I only started reviewing Aspire a few hours ago, so apologies if the XML docs aren't accurate - I just figured the best way to get started contributing is to jump right in (CC: @danmoseley, @DamianEdwards).

#Fixes #1294

The wording in the XML docs is based on my cursory review of [issue 177](dotnet#177) and [PR 1121](dotnet#1121).

I should add that I only started reviewing Aspire a few hours ago, so apologies if the XML docs aren't accurate - I just figured the best way to get started contributing is to jump right in (CC: @danmoseley).

#Fixes dotnet#1294
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-codeflow for labeling automated codeflow. intentionally a different color! label Dec 8, 2023
@@ -81,6 +81,13 @@ public static IResourceBuilder<ContainerResource> AddContainer(this IDistributed
return builder.WithAnnotation(annotation);
}

/// <summary>
/// Adds the arguments to be passed to a container resource when the container is started.
Copy link
Member

Choose a reason for hiding this comment

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

This extension method isn't currently constrained to ContainerResource (see line 91 below) so I'm not sure what it does when used with other resource types. We'll likely need to check that and update the doc comments appropriately.
@eerhardt @davidfowl

Copy link
Member

Choose a reason for hiding this comment

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

I had a look through the implementation. It is definitely container specific.

Copy link
Member

Choose a reason for hiding this comment

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

It's not specific right now. It also works for executables.

Copy link
Member

Choose a reason for hiding this comment

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

@mitchdenny @davidfowl so, which is it? Constraining this method to where T : ContainerResource seems wrong if this indeed works for executables too.

Copy link
Member

Choose a reason for hiding this comment

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

It's both executables and containers.

Copy link
Member

Choose a reason for hiding this comment

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

OK so for now we should just ensure the doc comments here reflect what it does in both cases.

Copy link
Member

@mitchdenny mitchdenny Dec 11, 2023

Choose a reason for hiding this comment

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

Actually I don't think that WithArgs is fully baked. I am wondering if it was actually intended to be private. @BrennanConroy even though it is in ContainerResourceExtensions I can't see where it ends up being used for container initialization.

Copy link
Member

Choose a reason for hiding this comment

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

if (modelContainerResource.TryGetAnnotationsOfType<ExecutableArgsCallbackAnnotation>(out var argsCallback))
{
dcpContainerResource.Spec.Args ??= [];
foreach (var callback in argsCallback)
{
callback.Callback(dcpContainerResource.Spec.Args);
}
}

Copy link
Member

Choose a reason for hiding this comment

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

OK find references in VS might be having an issue ;)

Copy link
Member

Choose a reason for hiding this comment

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

Oooh. Its differentiating between the constructor and the type when I find all references :P

@DamianEdwards DamianEdwards removed the area-codeflow for labeling automated codeflow. intentionally a different color! label Dec 11, 2023
@joperezr joperezr added the community-contribution Indicates that the PR has been added by a community member label Dec 11, 2023
@davidfowl
Copy link
Member

@mitchdenny can you take this and backport it once it's in?

@mitchdenny mitchdenny merged commit 734c3dc into dotnet:main Dec 12, 2023
8 checks passed
@mitchdenny
Copy link
Member

/backport to release/8.0-preview2

Copy link
Contributor

Started backporting to release/8.0-preview2: https://github.com/dotnet/aspire/actions/runs/7180898900

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WithArgs method is missing XML doc comments
5 participants