Skip to content

Add ability to set a help link for errors/warnings - #5488

Merged
Forgind merged 10 commits into
dotnet:masterfrom
rr-wfm:feature/help-uri
Jul 28, 2020
Merged

Forgind merged 10 commits into
dotnet:masterfrom
rr-wfm:feature/help-uri

Conversation

@jmezach

@jmezach jmezach commented Jul 6, 2020

Copy link
Copy Markdown
Contributor

As discussed in #4029 (see this comment) I've added the ability to set a help link for both the Error and Warning tasks. This would allow authors of MSBuild targets to issue warnings and/or errors and point users to some page describing more details about the error/warning. Obviously these would need to show up in the IDE somewhere, but I'm hoping that @davkean can take care of that. I think I've done everything that needs to be done on the MSBuild side of things, but this is my first PR here so I'm not entirely sure.

@jmezach

jmezach commented Jul 6, 2020

Copy link
Copy Markdown
Contributor Author

Looks like the macOS build on Mono is failing due to a single test failure. Looking at the test it doesn't seem related to my changes, so not sure what's going on there. The Windows Full Release build seems to be failing due to mismatches with the reference assemblies, which makes sense since I've expanded the existing API. What would be the right course of action here though? Should we also changes the reference assemblies?

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the contribution! This looks good overall but I have some feedback.

Comment thread src/Tasks/Error.cs Resolved
Comment thread src/Framework/BuildErrorEventArgs.cs Resolved
Comment thread src/Shared/TaskLoggingHelper.cs Resolved
Comment thread src/Tasks/Warning.cs Resolved
Comment thread src/Framework/BuildErrorEventArgs.cs Resolved
@rainersigwald

Copy link
Copy Markdown
Member

The Windows Full Release build seems to be failing due to mismatches with the reference assemblies, which makes sense since I've expanded the existing API. What would be the right course of action here though? Should we also changes the reference assemblies?

If you do a build locally, it should update the reference source with the additions you've made. Add those to your PR.

@jmezach

jmezach commented Jul 8, 2020 •

Copy link
Copy Markdown
Contributor Author

I did a local build, but I'm not seeing any local changes after that. Could it be that this only works on Windows perhaps? I'm no a Mac. I do have an Azure VM ready to go though, so I'll give it a shot there.

Looks like the reference assemblies are only updated when building on Windows. Fixed that now. Hopefully that will fix the build.

@jmezach

jmezach commented Jul 8, 2020

Copy link
Copy Markdown
Contributor Author

Looks like the build still breaks, although I'm not sure it is actually related to my changes. Any idea what's going on here?

@rainersigwald

Copy link
Copy Markdown
Member

Looks like the reference assemblies are only updated when building on Windows.

Sorry, I thought we had fixed that! Thanks for switching OSes :)

Looks like the build still breaks, although I'm not sure it is actually related to my changes. Any idea what's going on here?

Assert.Equal() Failure\nExpected: Success\nActual: Failure
   at Microsoft.Build.UnitTests.BackEnd.BuildManager_Tests.OutOfProcProjectInstanceBasedBuildDoesNotReloadFromDisk(Boolean shouldSerializeEntireState) in /home/vsts/work/1/s/src/Build.UnitTests/BackEnd/BuildManager_Tests.cs:line 3847

With the build log

Build started.
Project "tmpN9NolS.tmp" (Foo target(s)):
Building with tools version "Current".
Target "Foo" in file "/tmp/h345wyeo.ceo/Temporaryd7adbbaa40ea4788bbecc7aa53d1c216/import" from project "/tmp/h345wyeo.ceo/tmpN9NolS.tmp" (entry point):
Using "Message" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
Task "Message"
Bar
Done executing task "Message".
Done building target "Foo" in project "tmpN9NolS.tmp".
Done building project "tmpN9NolS.tmp".
Build succeeded.
Build started.
(0,0):  error MSB4223: A node of the required type OutOfProc could not be created.
Build succeeded.

Should definitely not be you. I'm rerunning that leg. @Forgind, recognize this?

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jmezach

jmezach commented Jul 8, 2020

Copy link
Copy Markdown
Contributor Author

Added the tests as instructed.

@jmezach

jmezach commented Jul 13, 2020

Copy link
Copy Markdown
Contributor Author

Is there anything I can do to move this along?

@Forgind

Forgind commented Jul 13, 2020

Copy link
Copy Markdown
Contributor

Is there anything I can do to move this along?

I think we're currently waiting for @terrajobst to chime in. I can ping him offline.

@jmezach

jmezach commented Jul 27, 2020

Copy link
Copy Markdown
Contributor Author

Is this still waiting for an API review from @terrajobst?

@jmezach

jmezach commented Jul 28, 2020 •

Copy link
Copy Markdown
Contributor Author

I think this is ready to go now, but feel free to review it again. Seems like the build isn't triggering again. Not sure why that is ;). Never mind, just when I posted this it started ;).

@Forgind Forgind left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

Comment thread src/Framework/BuildErrorEventArgs.cs Resolved
@jmezach

jmezach commented Jul 28, 2020

Copy link
Copy Markdown
Contributor Author

Are we ready to merge this?

@rainersigwald rainersigwald left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@Forgind
Forgind merged commit 8343d63 into dotnet:master Jul 28, 2020
@jmezach
jmezach deleted the feature/help-uri branch July 29, 2020 06:40
@davkean

davkean commented Jul 29, 2020

Copy link
Copy Markdown
Member

It looks like BuildMessageEventArgs/CriticalBuildMessageEventArgs didn't get a HelpLink. Was that intentional?

@jmezach

jmezach commented Jul 29, 2020

Copy link
Copy Markdown
Contributor Author

@davkean Not really. I just approached it from the Error and Warning tasks and took things from there. What are those types used for exactly? I did think of adding an Info or Information task so that you could issues those messages from MSBuild targets as well, but I thought it would be better to do that as a separate PR if there's interest in such a thing.

@davkean

davkean commented Jul 29, 2020

Copy link
Copy Markdown
Member

@jmezach Critical Messages can be logged inside a task without needing a specific Info task. We treat error/warning/messages the same for HelpKeyword, and had to handle HelpLink differently because its not on the base.

@jmezach

jmezach commented Jul 30, 2020

Copy link
Copy Markdown
Contributor Author

@davkean I don't mind moving things to a base class, but as far as I can see the only common base class for all those types (BuildWarningEventArgs, BuildErrorEventArgs, BuildMessageEventArgs and CriticalBuildMessageEventArgs) is LazyFormattedBuildEventArgs. Should we add the HelpLink there?

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.

5 participants