-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Compare detection strategies per chunk/detector #2922
base: main
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Yea, that's my mistake. I should have a fix for that tonight. Thanks for the reminder. |
d845167
to
809cdcf
Compare
ffecb81
to
e835036
Compare
ef30b7c
to
6457ae4
Compare
6457ae4
to
c6f7138
Compare
6cd8337
to
479c463
Compare
479c463
to
c85c7cb
Compare
c85c7cb
to
727bf58
Compare
@@ -1094,14 +1126,24 @@ func (e *Engine) detectChunk(ctx context.Context, data detectableChunk) { | |||
results = e.filterResults(ctx, data.detector, results) | |||
} | |||
|
|||
HandleResults: | |||
results = e.filterResults(ctx, data.detector, results) |
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.
Idk if this line is still necessary.
if (!e.compareScanStrategies) || (e.compareScanStrategies && !scanEntireChunk) { | ||
data.wgDoneFn() | ||
} |
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.
This is a bit brittle. It might be better if moved to detectorWorker
.
727bf58
to
184d3a0
Compare
184d3a0
to
60b5791
Compare
Description:
This is an alternative implementation to #2918, with two main advantages:
Note: Anything I deleted wasn't necessarily because I didn't think it was useful, it was just the easiest way to implement this.
Example
Compare per chunk/detector
When testing #2894 against a known true positive, it provides immediate and unambiguous feedback that there's a discrepancy.
Compare per scan
Information is only logged at the end, and doesn't provide any insight to which chunk(s) or detector(s) were affected.
Checklist:
make test-community
)?make lint
this requires golangci-lint)?