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
C#: Restore projects and collect dependencies for projects in the same folder sequentially. #16248
C#: Restore projects and collect dependencies for projects in the same folder sequentially. #16248
Conversation
1db31b6
to
e3f130d
Compare
e3f130d
to
181a063
Compare
I think DCA looks acceptable.
It will be interested to see, if the issue fixed in this PR somewhat fixes the nightly alert wobble. Prior to this change, only a single |
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.
Looks good. I added some minor comments.
@@ -16,6 +16,11 @@ internal class Assets | |||
{ | |||
private readonly ILogger logger; | |||
|
|||
/// <summary> | |||
/// Contains the dependencies found in the parsed asset files. |
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.
nit: We're mixing asset
and assets
file in comments. I think it should be assets
.
/// Flatten a list of containers into a single container. | ||
/// </summary> | ||
public static DependencyContainer Flatten(this IEnumerable<DependencyContainer> container) => |
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.
nit: the parameter name should be plural and then the below c
can be renamed to container
.
} | ||
assetFiles.AddRange(res.AssetsFilePaths); | ||
} | ||
lock (sync) |
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.
We're using the sync
object for multiple locking purposes. Maybe you could change the collectedDependencies
to be a ConcurrentBag<>
.
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. One suggestion; feel free to ignore.
/// Flatten a list of containers into a single container. | ||
/// </summary> | ||
public static DependencyContainer Flatten(this IEnumerable<DependencyContainer> container) => |
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.
You could change this to
public static DependencyContainer Flatten(this IEnumerable<DependencyContainer> container, DependencyContainer init) =>
and then replace the new DependencyContainer()
in Aggregate
below with init
.
DCA looks good. |
This is a bugfix.
Prior to this change assets files would overwritten, if multiple projects are restored in the same folder. Now projects in the same folder are restored sequentially and the assets files are parsed immediately.