-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Don't emit duplicate src files to binlog in CodeTaskFactory #11965
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
Don't emit duplicate src files to binlog in CodeTaskFactory #11965
Conversation
JanProvaznik
left a comment
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.
- please make PRs with titles that indicate what the PR does, so we can orient in PR list view, not just issue reference (e.g. copy issue title/description "Fix duplicate logging of code from CodeTaskFactories")
- the original issue asks to fix RoslynCodeTaskFactory too, please add that
- I added comments about the implementation
a8883f4 to
be1eca0
Compare
|
Hi @JanProvaznik , about the RoslynCodeTaskFactory, its already implement the logic for use the compile code from the cache, so we no need to implement in RoslynCodeTaskFactory |
add logic to generate file even when it compile error Add unit test for new code changes Add unit test for the code changes Remove unused code Add unit test for code change
8304e82 to
d2edc20
Compare
AR-May
left a comment
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
|
Thank you! |
Fixes #
Fix the issue: Don't emit duplicate generated files into the binlog #11884
Context
The CodeTaskFactory was generating multiple .tmp files in the binlog for each invocation of a task, even when the task used the same source code. The goal is to emit only one .tmp file per unique task source code after its first successful compilation.
Changes Made
Added a HashSet _loggedCodeFiles to track task specifications already logged to the binlog.
Updated the logic to check _loggedCodeFiles before emitting a .tmp file, ensuring only one file is logged per unique FullTaskSpecification
Testing
Created a test project that invokes CustomTask multiple times with parameters (InputParameter="Foo" and InputParameter="Bar") via Another.proj and directly.
Verified that only one .tmp file is generated in the binlog for tasks sharing the same source code (from Import.targets), confirming duplicate suppression.
Created an additional project (Another1.proj) with a different source code (Import1.targets) to confirm two .tmp files are generated when source codes differ, validating that unique FullTaskSpecification instances produce separate files.
Notes