[release/2.1] Add @(ProjectReference) items for patched projects#29037
[release/2.1] Add @(ProjectReference) items for patched projects#29037dougbu merged 1 commit intorelease/2.1from
@(ProjectReference) items for patched projects#29037Conversation
|
@Tratcher I believe I've confirmed #29023 is a real issue but would appreciate your confirmation. With the current state of this PR, I'd expect some Kestrel tests (for example) to fail but all I see listed in the Tests tab are projects with direct Microsoft.AspNetCore.Http references. Do you agree many more tests should have failed❔ |
|
Lol, you intentionally broke cookies? I would not expect any kestrel tests to fail, kestrel provides values rather than consumes them. However I'm surprised I don't see any failures in Security. |
😏 |
|
🆗 the binary log 💯% confirmed Microsoft.AspNetCore.Http.dll was resolved from the baseline package in every project except test projects containing /fyi @dotnet/aspnet-build |
fb95fbc to
b4f09b3
Compare
b4f09b3 to
b8c2b78
Compare
|
With help from @Forgind and @yuehuang010, this new target is now working. Many thanks❕ I'm going to try out a couple of tweaks locally then back out the first two commits (i.e. don't intentionally break tests) and turn this into a real PR😃 |
|
Note latest iteration failed many more tests than previous ones i.e. transitive references to the project I broke are no longer hiding the break from test projects and samples. |
- #29023 - ensure tests do not use baseline assemblies for projects in current patch
b8c2b78 to
2c68337
Compare
|
/fyi test run with the fix failed 404 tests on Windows and 322 elsewhere while run before fix failed far fewer -- 206 tests on Windows and 103 elsewhere. |
@(ProjectReference) items for patched projects
|
This is |
|
|
||
| <!-- Ignore unreferenced assemblies and directly-referenced projects. --> | ||
| <_ProjectsToAdd Remove="@(_ProjectsToAdd)" /> | ||
| <!-- Condition uses same Filename metadata when evaluating the other two item groups. --> |
There was a problem hiding this comment.
Put another way, the Conditions here and at the end of the target use a corner case of the task batching features. Shared metadata and batching on that metadata are the keys.
| <_ProjectsToAdd Remove="@(_ProjectsToAdd)" /> | ||
| <!-- Condition uses same Filename metadata when evaluating the other two item groups. --> | ||
| <_ProjectsToAdd Include="@(_ProjectsInPatch)" | ||
| Condition=" '%(Filename)' != '' AND |
There was a problem hiding this comment.
What is this condition doing exactly? Add a direct reference to the projects being patched, unless...
There was a problem hiding this comment.
My mental model may be wrong (@Forgind and @yuehuang010, please chime in) but https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-batching?view=vs-2019#item-and-property-mutations contains some of the information
- The
%(Filename)item metadata causes the implicitCreateItemtask to be batched - Use of that metadata also limits the
@(ResolvedCompileFileDefinitions)and@(RuntimeCopyLocalItems)item groups to the item(s) with the same%(Filename)- This part doesn't seem to be explicit in the documentation
- The
ORclause confirms at least one such item exists
At a higher level, this creates a @(_ProjectsToAdd) item group containing those @(_ProjectsInPatch) items that match on filename with one or more @(ResolvedCompileFileDefinitions) or @(RuntimeCopyLocalItems) items, excluding existing @(ProjectReference) items. Another way of looking at it is the created item group contains the projects in the current patch that (a) aren't referenced directly but (b) match assemblies in the current build.
There was a problem hiding this comment.
I see it used in this exampled (https://docs.microsoft.com/en-us/visualstudio/msbuild/item-metadata-in-task-batching?view=vs-2019#divide-several-item-lists-into-batches). So, it is feature name is "Divide several item lists into batches":
<Target Name="ShowMessage">
<Message
Text = "Number: %(Number) -- Items in ExampColl: @(ExampColl) ExampColl2: @(ExampColl2)"/>
</Target>
There was a problem hiding this comment.
Good point @yuehuang010. I'm not sure how many times I read that example without thinking "Oh, this makes intersection / subsetting dead easy"😃
|
@wtgodbe is there a reason the aspnetcore-pr-validation-temp pipeline still exists and is still the one we require for release/2.1 merges❔ Tests failed in the first run since I got rid of the intentional break but only in that pipeline. The same tests ran fine in aspnetcore-ci. |
No, I can remove the validation-temp runs |
Originally was an attempt to demonstrate #29023