-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Emit eval props if requested by any sink #10243
Emit eval props if requested by any sink #10243
Conversation
Does this result in big duplication for the console/text loggers at diag? That's the biggest concern off the top of my head right now. |
This should be identical. Console loggers already have it: msbuild/src/Build/Logging/BaseConsoleLogger.cs Lines 953 to 957 in a9efffc
Plus they pull data from BUT - I now see that So we now have 2 options:
|
I thought this was determining whether the properties and items are logged at ProjectEvaluationFinished vs. legacy ProjectStarted. Some legacy loggers (like Azure DevOps pipelines distributed logger) expected them to be on ProjectStarted, and crashed with NullReferenceException when they didn't find them. I don't think they're ever on ProjectEvaluationStarted. |
I remember MuxLogger had these as false but somehow this was never the problem. I think something else is going on. Also as an option we can keep this PR, and just ensure that ProjectStartedEventArgs has empty arrays for properties and items, instead of null. I regret not having done this in the first place. |
But overall I don't think this is a safe change to make. This is pretty much equivalent to always turning it on (it's as if there's always an imaginary logger present that requests it). |
This one describes what was going on - it's basically the inverse of this PR: |
See related: |
I cannot wrap my head around how would that work. Perhaps viewer used to get the props from
I added ensuring non-null values. There is still a risk that some existing logger relies on specific properties being always available in |
I like this change - I should have done that long ago. We should debug why we don't get eval in VS - want to be absolutely sure it's because of a bad logger present. I clearly remember looking at this and MuxLogger wasn't the issue, but I might have been mistaken. |
I think this was my investigation: |
See also: |
See also: |
Experimental VS insertion: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/558711 |
Tested with VS with this PR inserted (installers: https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=9745016&view=ms.vss-build-web.run-extensions-tab) tl;dr;: The issue is present and resolved with this PR note: For each scenario it's important to start fresh (killing msbuild nodes, or at least change code and rebuild) - to prevent the results to be served from cache! This PR as is
Issue is not present: Opt-out props after eval
Issue is present (by design - as data is explicitly opted out): ChangeWave opt-out
FYI: @olgaark, @yuehuang010 |
Or there is another - more conservative - approach: send props on ProjectStartedEventArgs if all loggers are legacy, send them on ProjectEvaluationFinishedEventArgs if all loggers are enlightened and in the mixture case send the props on both events. I'll work on this (+ measure) in 2 weeks |
A page I wrote to document the whole business around enlightening loggers: |
38ed72a
to
f8f062d
Compare
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
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.
I have left couple of questions to understand the reasoning of tests changes but overall no questions.
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.
Let's revert the change and investigate later per:
https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/2173921
Sorry wrong PR :) |
Fixes #10225,
#1976Context
The eval props/items were not attached to
ProjectEvaluationFinishedEventargs
if any logger didn't requestIncludeEvaluationPropertiesAndItems
In case of VS - the
MuxLogger
is attached as well. So in case that one doesn't set the property (it might be a recent change in VS - I'm not sure) - the values are not being sent neither to binary logger.Changes Made
Make sure the values are emitted and attached if any logger requests them
Testing
Manual (VS with injected Msbuild)
Experimental VS insertion: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/558711
Experimental VS insertion for the version which can add properties on both event types: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/565788 (yet another: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/566698)
Notes
The change was introduced long ago - 794abcb - and it mentiones possible regression concerns if applied to all loggers. I might not have understood it properly - but it seems the concern is more about
ProjectEvaluationStartedEventArgs
- which do not attach the props/items anymore. Having extra data inProjectEvaluationFinishedEventargs
even for loggers do not requesting it feels like very low opportunity for breakage (somebody would need to explicitly break on non-null data).FYI @KirillOsenkov - in case my thinking is flawed