Skip to content

Conversation

@Alirexaa
Copy link
Contributor

@Alirexaa Alirexaa commented Aug 2, 2024

Contributes to #2649 and #5047

Microsoft Reviewers: Open in CodeFlow

@radical
Copy link
Member

radical commented Aug 7, 2024

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@Zombach Zombach left a comment

Choose a reason for hiding this comment

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

@Alirexaa
Copy link
Contributor Author

Alirexaa commented Aug 7, 2024

Missing check in constructor

https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.NodeJs/NodeAppResource.cs

ExecutableResource has check for that.

@Zombach
Copy link
Contributor

Zombach commented Aug 7, 2024

Missing check in constructor
https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.NodeJs/NodeAppResource.cs

ExecutableResource has check for that.

Yes, I know, there was just a case message when the name of a parameter differed from the name of the parameter being checked in the ExecutableResource.
And it turns out that if someone makes changes to the code and changes the name, or starts using parameters in the NodeAppResource class, an error will occur.
I'm certainly not sure. But I would cover all public APIs with this check,
when it's not entirely transparent. Not everyone knows that the check for 'null' is found internally in the ExecutableResource.
But this is just my opinion, I don’t know what others will say about this

@sebastienros sebastienros force-pushed the validate-arguments-of-public-methods#aspire-hosting-nodejs branch from bba4495 to 53d7217 Compare August 9, 2024 22:01
}

[Fact]
public void AddNpmAppShouldThrowWhenScriptNameIsNull()
Copy link
Member

Choose a reason for hiding this comment

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

@Alirexaa you missed this one. It has a default value but it doesn't mean we still can't call it with a null value.

Copy link
Member

Choose a reason for hiding this comment

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

Also I had to force push to revert the changes in the .sln file.

@sebastienros sebastienros enabled auto-merge (squash) August 9, 2024 22:02
@sebastienros sebastienros merged commit 4dd110b into dotnet:main Aug 14, 2024
@Alirexaa Alirexaa deleted the validate-arguments-of-public-methods#aspire-hosting-nodejs branch August 14, 2024 11:33
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages 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.

4 participants