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

Tolerate plugins with warnings #437

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Tolerate plugins with warnings #437

wants to merge 1 commit into from

Conversation

Frassle
Copy link
Member

@Frassle Frassle commented Dec 20, 2024

Found this while on my adventures with dotnet plugins. If your plugin project has any warnings it's unusable in shimless mode (i.e. RunPlugin) because msbuild would first print the warning then start the plugin and print the port number. This lead to errors like:

error:  plugin [E:\VisualStudio\Projects\pulumi\jsonschema\Provider\pulumi-resource-Provider] wrote an invalid port to stdout: could not parse port: strconv.Atoi: parsing "E:\\VisualStudio\\Projects\\pulumi\\jsonschema\\Provider\\Provider.fsproj : warning NU1903: Package 'System.Text.Json' 6.0.2 has a known high severity vulnerability, https://github.com/advisories/GHSA-8g4q-xg66-9fp4": invalid syntax

When running shimless these warnings don't really matter. So this PR rewrites RunPlugin to do the build separately, and then invoke dotnet run with the --no-build flag. I would have preferred to just use dotnet run but there doesn't seem to be anyway to pass it flags to silence the msbuild output from it.

This is tested by adding a warning to the testprovider project that always triggers. As we use the testprovider project in shimless mode in the integration tests this shows that a project with warnings can still be used.

@Frassle Frassle marked this pull request as ready for review December 20, 2024 22:27
@Frassle Frassle requested a review from a team as a code owner December 20, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant