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

Adding PerFingerprint strategy in SarifWorkItemFiler #2293

Merged
merged 5 commits into from
Feb 24, 2021

Conversation

eddynaka
Copy link
Collaborator

No description provided.

@eddynaka eddynaka changed the title Improving PerRunPerFingerprint splitting visitor Adding PerFingerprint strategy in SarifWorkItemFiler Feb 23, 2021
@@ -232,6 +232,11 @@ public virtual IReadOnlyList<SarifLog> SplitLogFile(SarifLog sarifLog)
partitionFunction = (result) => result.ShouldBeFiled() ? result.GetPerRepositoryFingerprintSplittingStrategyId() : null;
break;
}
case SplittingStrategy.PerFingerprint:
{
partitionFunction = (result) => result.ShouldBeFiled() ? result.Fingerprints.Count == 0 ? null : result.Fingerprints.First().Value : null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

First() [](start = 145, length = 7)

I'm fixating on "First" here. In this splitting strategy, if there are multiple results with the same fingerprint, the rest after the first will be discarded, right? Is that desired?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i didn't want to hard code a specific key...its why i added first. i could also add a parameter being the fingerprint name.


In reply to: 581473453 [](ancestors = 581473453)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have no strong preference so long as we're preserving all the intended information :)


In reply to: 581474839 [](ancestors = 581474839,581473453)

Copy link
Member

@michaelcfanning michaelcfanning left a comment

Choose a reason for hiding this comment

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

:shipit:

options.SplittingStrategy == SplittingStrategy.PerPropertyBagProperty) &&
string.IsNullOrEmpty(options.PropertyName))
{
valid &= false;
Copy link
Member

Choose a reason for hiding this comment

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

valid &= false [](start = 16, length = 14)

You can do this, but valid = false is also fine. :)

@eddynaka eddynaka merged commit 9c24de0 into main Feb 24, 2021
@eddynaka eddynaka deleted the users/ednakamu/improving-perrun-perfingerprint-split branch February 24, 2021 02:38
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.

3 participants