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

Target analysis completed #2637

Merged
merged 14 commits into from
Mar 7, 2023
Merged

Target analysis completed #2637

merged 14 commits into from
Mar 7, 2023

Conversation

michaelcfanning
Copy link
Member

@michaelcfanning michaelcfanning commented Mar 7, 2023

The primary point of this PR is to restore callbacks to IAnalysisLogger.AnalyzingTarget implementations (removed in recent pipeline rewrite). While the hood is up, added a new IAnalysisLogger.TargetAnalyzed callback.

AnalyzingTarget is called from the target enumeration thread. Strictly speaking, this isn't when analysis begins. The scan threads do not have a pointer to the global context logger, however, so changing this would require more thought.

TargetAnalyzed is called from the logging thread and so synchronization is required again on the global context object.

As part of this change, I noticed some console logger messages that never fired (because the callback wasn't executed) tracking the start of analysis. This is verbose logging, so I put it behind a new trace flag (and added analogous handling in the target analyzed callback).

@eddynaka @suvamM @shaopeng-gh @easyrhino-gh @cfaucon

var context = new TestAnalysisContext
{
Logger = logger,
MaxFileSizeInKilobytes = long.MaxValue,
Copy link
Member Author

Choose a reason for hiding this comment

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

MaxValue

Set the max value so that we don't skip any files on enumerating the current working directory.

@@ -242,7 +242,7 @@ public virtual TContext InitializeContextFromOptions(TOptions options, ref TCont
context.ResultKinds = options.ResultKinds;
context.FailureLevels = options.FailureLevels;
context.OutputFileOptions = options.OutputFileOptions.ToFlags();
context.MaxFileSizeInKilobytes = options.MaxFileSizeInKilobytes;
context.MaxFileSizeInKilobytes = options.MaxFileSizeInKilobytes != null ? options.MaxFileSizeInKilobytes.Value : context.MaxFileSizeInKilobytes;
Copy link
Member Author

Choose a reason for hiding this comment

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

MaxFileSizeInKilobytes

This pattern is required in order to permit a combination of options- and context-specified configuration. We need to make a general scrub for this pattern I've implemented for max file size only.

@michaelcfanning michaelcfanning marked this pull request as ready for review March 7, 2023 21:30
@michaelcfanning michaelcfanning enabled auto-merge (squash) March 7, 2023 21:55
@michaelcfanning michaelcfanning merged commit 420fe9c into main Mar 7, 2023
@michaelcfanning michaelcfanning deleted the target-analysis-completed branch March 7, 2023 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants