Skip to content

Change project-cone-sync to not dump projects outside of the cone.#60465

Merged
CyrusNajmabadi merged 5 commits intodotnet:main-vs-depsfrom
CyrusNajmabadi:projectConeSync
Apr 1, 2022
Merged

Change project-cone-sync to not dump projects outside of the cone.#60465
CyrusNajmabadi merged 5 commits intodotnet:main-vs-depsfrom
CyrusNajmabadi:projectConeSync

Conversation

@CyrusNajmabadi
Copy link
Copy Markdown
Contributor

The prior way we did project-cone syncing was to only include the checksums for the project (and dependents) in the total checksum we sent over. This had the problem that on the OOP side all other projects would get dumped (including all the project trackers and whatnot) losing all that information we had. If another OOP request was made for the full solution, we'd have to go generate those again.

The new approach here works subtly different. When syncing a project-cone, we ensure that we only get the up to date checksum for that project (and it's dependents). For any other projects, instead of dropping them, we include the most recently computed checksum for it so that we keep what we have on the OOP side once sync'ed over.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 29, 2022 21:30
@ghost ghost added the Area-IDE label Mar 29, 2022
@CyrusNajmabadi CyrusNajmabadi marked this pull request as draft March 29, 2022 21:30
Copy link
Copy Markdown
Contributor

@ryzngard ryzngard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't comment on if this is the direction we want to go, but can comment that the code does what is described 👍

Worth another set of eyes

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review March 29, 2022 23:14
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

@jasonmalinowski ready for review.

@allisonchou allisonchou changed the base branch from release/dev17.3 to main-vs-deps March 31, 2022 18:14
@allisonchou
Copy link
Copy Markdown
Contributor

Re-targeting from release/dev17.3 to main-vs-deps so we can delete the release/dev17.3 branch.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 31, 2022 23:40
@CyrusNajmabadi
Copy link
Copy Markdown
Contributor Author

Ping @jasonmalinowski

// if it's a project that's specifically in the sync'ed cone, include this checksum so that
// this project definitely syncs over.
if (t.mustCompute)
return await t.state.GetChecksumAsync(cancellationToken).ConfigureAwait(false);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small allocation nit: you could remove the await here and make the other returns be a Task.FromResult.

Assert.Equal(2, project2SyncedSolution.Projects.Count());
AssertEx.SetEqual(new[] { project2.Name, project3.Name }, project2SyncedSolution.Projects.Select(p => p.Name));

// if we then sync just P1, we should have 3 projects synved over now.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// if we then sync just P1, we should have 3 projects synved over now.
// if we then sync just P1, we should have 3 projects synced over now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants