-
Notifications
You must be signed in to change notification settings - Fork 696
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
Refactor RestoreCommand.ExecuteAsync() #6162
base: dev
Are you sure you want to change the base?
Conversation
I think your rebase removed 0029325, which is why your tests are failing. |
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.
Generally looks good.
My feedback is primarily stylistic, but then again, refactoring is mostly that, style changes.
} | ||
} | ||
|
||
return null; |
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.
When is the cache file null?
Feels like it shouldn't be.
Worth double checking.
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.
The return null
was added to ensure the method covers all possible code paths with a return statement. I modified the ExecuteAsync
method to handle scenarios where this method returns null
, allowing such cases to be ignored.
Previous ExecuteAsync
{
// EvaluateNoOpAsync method logic
}
Updated ExecuteAsync
{
if (EvaluateNoOpAsync() is null)
{
continue;
}
else
{
return noOpResult;
}
}
EvaluateNoOpAsync
EvaluateNoOpAsync()
{
// Same logic
// Ensure all paths return
return null;
}
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
private async Task<IEnumerable<RestoreTargetGraph>> GenerateRestoreGraphsAsync(TelemetryActivity telemetry, RemoteWalkContext contextForProject, CancellationToken token) | ||
{ | ||
IEnumerable<RestoreTargetGraph> graphs = null; | ||
|
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: extra line
Bug
Fixes: NuGet/Home#13960
Description
The
RestoreCommand.ExecuteAsync()
method is long and complicated to read. This PR refactors it into multiple methods.PR Checklist