Skip to content
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

Mix the source generator version info into the dependent checksum we get for projects #77273

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

CyrusNajmabadi
Copy link
Member

For @dibarbet

David, consider taking this approach and mixing into your current PR around diagnostics + SG.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 19, 2025 09:08
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 19, 2025
Copy link
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Signing off. General curiosity questions don't need to be answered prior to merge.

var transitiveDependencies = solution.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(this.ProjectState.Id);
// Calculate a checksum this project and for each dependent project that could affect semantics for this
// project. We order the projects so that we are resilient to the underlying in-memory graph structure
// changing this arbitrarily. We do not want that to cause us to change our semantic version.. Note: we
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// changing this arbitrarily. We do not want that to cause us to change our semantic version.. Note: we
// changing this arbitrarily. We do not want that to cause us to change our semantic version. Note: we

// changing this arbitrarily. We do not want that to cause us to change our semantic version.. Note: we
// use the project filepath+name as a unique way to reference a project. This matches the logic in our
// persistence-service implementation as to how information is associated with a project.
var transitiveDependencies = solution.SolutionState.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(this.ProjectState.Id);
Copy link
Member

Choose a reason for hiding this comment

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

Asking a general question which doesn't need to impact this PR:

Is there a reason this gets the full transitive list versus just asking the immediate project references and mixing in their checksums, which would themselves depend on their immediate project references...etc? Are we going to be generating extra dependency graph entries here even though we don't need to?

Copy link
Member Author

Choose a reason for hiding this comment

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

i have a followup pr that does that :)

// changing this arbitrarily. We do not want that to cause us to change our semantic version.. Note: we
// use the project filepath+name as a unique way to reference a project. This matches the logic in our
// persistence-service implementation as to how information is associated with a project.
var transitiveDependencies = solution.SolutionState.GetProjectDependencyGraph().GetProjectsThatThisProjectTransitivelyDependsOn(this.ProjectState.Id);
var orderedProjectIds = transitiveDependencies.OrderBy(id =>
Copy link
Member

Choose a reason for hiding this comment

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

Asking a general question which doesn't need to impact this PR:

Why do we sort this way versus just sorting by GUID or something?

Copy link
Member Author

Choose a reason for hiding this comment

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

that would work as well!

@CyrusNajmabadi CyrusNajmabadi marked this pull request as draft February 19, 2025 22:01
dibarbet added a commit that referenced this pull request Feb 20, 2025
#77271)

Fixes an issue where diagnostics would not refresh when source
generators run in balanced mode (e.g. after a save triggers sg re-run,
diagnostics would not update based on the new sg contents).

checksum changes taken from #77273
@dibarbet dibarbet merged commit 68df62a into dotnet:main Feb 20, 2025
25 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Feb 20, 2025
@akhera99 akhera99 modified the milestones: Next, 17.14 P2 Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants