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

Store and display the times when files were generated. #72724

Merged
merged 8 commits into from
Mar 26, 2024

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Mar 25, 2024

Looks like:

image

This will be useful as we allow users to move to a model where generators don't run automatically, letting them when the generator was last run.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Mar 25, 2024
@@ -325,7 +333,8 @@ private partial class CompilationTracker : ICompilationTracker
generatedSource.SyntaxTree.Options,
ProjectState.LanguageServices,
// Compute the checksum on demand from the given source text.
originalSourceTextChecksum: null));
originalSourceTextChecksum: null,
generationDateTime));
Copy link
Member Author

Choose a reason for hiding this comment

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

these are the places in the system where the generation actually happens, and so we record the time it happened as well. From this point on, this just flows outwards to be read and stored and eventually shown in the UI.

@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review March 25, 2024 20:53
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 25, 2024 20:53
@CyrusNajmabadi
Copy link
Member Author

@genlu ptal.

@sharwell
Copy link
Member

Oh man, do we have the ability to put a "re-run now" button in that?

@CyrusNajmabadi
Copy link
Member Author

Oh man, do we have the ability to put a "re-run now" button in that?

We can def do that. I'll do it in the PR where we add 'balanced' mode.

@CyrusNajmabadi
Copy link
Member Author

@dibarbet ptal

@CyrusNajmabadi CyrusNajmabadi merged commit 0ba204a into dotnet:main Mar 26, 2024
27 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the generatedTimes branch March 26, 2024 15:23
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 26, 2024
@@ -281,6 +283,9 @@ private partial class CompilationTracker : ICompilationTracker
}

using var generatedDocumentsBuilder = TemporaryArray<SourceGeneratedDocumentState>.Empty;

// Capture the date now. We want all the generated files to use this date consistently.
var generationDateTime = DateTime.Now;
Copy link
Contributor

Choose a reason for hiding this comment

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

Now

Why not UtcNow?

Copy link
Member Author

Choose a reason for hiding this comment

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

will update in followup.

@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski For review when you get back.

@dibarbet dibarbet modified the milestones: Next, 17.11 P1 Apr 29, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants