Repository navigation
Add first on-build restore coordination - #7431
Conversation
0abc109 to
b3863ca
Compare
|
This PR has been automatically marked as stale because it has no activity for 7 days. It will be closed if no further activity occurs within another 7 days of this comment. If it is closed, you may reopen it anytime when you're ready again, as long as you don't delete the branch. |
Co-authored-by: Copilot <[email protected]>
b3863ca to
caac44d
Compare
Prevent the first on-build restore from waiting indefinitely for project nominations. Reset bulk coordination timeout windows when nomination work makes progress so large solutions are not timed out while advancing. Co-authored-by: Copilot <[email protected]> Copilot-Session: aec7c3b6-424c-4669-9d0f-16d7b8c7dc97
Co-authored-by: Copilot <[email protected]> Copilot-Session: b958dfc0-71dc-4d22-b39e-67763df4f0e8
|
The test failure is just an environment issue and not something related to my change. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Nomination progress is not tracked correctly, and initial nomination timeouts use the wrong telemetry classification.
Get a fresh assessment by requesting another Copilot review.
Review tier: Lite
Findings: 1
Open (1)
What changed in this PR
Coordinates the first Visual Studio on-build restore with solution loading and project nomination readiness.
Changes:
- Adds readiness waiting with timeout and progress tracking.
- Refactors project readiness checks and telemetry.
- Adds tests for readiness, timeout, and progress scenarios.
| File | Summary |
|---|---|
test/NuGet.Clients.Tests/NuGet.SolutionRestoreManager.Test/SolutionRestoreWorkerTests.cs |
Tests readiness, timeout, and progress behavior. |
src/NuGet.Clients/NuGet.SolutionRestoreManager/SolutionRestoreWorker.cs |
Implements on-build readiness coordination and telemetry. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
donnie-msft
left a comment
There was a problem hiding this comment.
Looks good, just a few questions.
donnie-msft
left a comment
There was a problem hiding this comment.
Ready to approve after I make sure I understand the projects ready check and WaitForOnBuildRestoreReadinessAsync steps.
Otherwise just nits
Wait for initial project nominations without also waiting for pending restore-info source updates. Report nomination-specific telemetry and update focused tests. Co-authored-by: Copilot <[email protected]> Copilot-Session: ded16a50-7fb7-4370-8f65-6814854fc818
Keep the project readiness coordination at its only call site and remove the tuple-returning helper. Co-authored-by: Copilot <[email protected]> Copilot-Session: ded16a50-7fb7-4370-8f65-6814854fc818

Bug
Fixes: NuGet/Home#14927
Description
Visual Studio can start its first on-build restore before solution loading and project nomination have finished. Because on-build restore executes directly rather than through the background restore queue, it could run with incomplete restore inputs and fail when a solution is built immediately after opening.
This change coordinates the first on-build restore with the existing restore-readiness signals. It waits for solution loading, all projects to be nominated, and pending project restore-info sources to finish nomination before starting restore.
The readiness wait uses the existing five-minute bulk coordination timeout as an inactivity fallback. The timeout now starts while waiting for initial project nominations, preventing a project that never nominates from delaying build indefinitely. It resets when nomination work makes progress, allowing large solutions to continue beyond five minutes as long as projects are still advancing. The original coordination start time remains fixed for total-duration telemetry.
PR Checklist