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

Merging artifacts during merge command #2285

Merged
merged 4 commits into from
Feb 12, 2021

Conversation

eddynaka
Copy link
Collaborator

@eddynaka eddynaka commented Feb 9, 2021

Fixes #2284

@@ -117,6 +123,39 @@ public bool TryIsSuppressed(out bool isSuppressed)
return true;
}

public void InlineArtifacts(Run run = null)
Copy link
Member

@michaelcfanning michaelcfanning Feb 9, 2021

Choose a reason for hiding this comment

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

InlineArtifacts [](start = 20, length = 15)

Remember that a result has an optional run object on it. And so if we find that, we should use it. Otherwise, this looks good.

We have another inlining problem, which is that a result needs to have a 'flattened' result message in cases where it otherwise has only messge args and an index to the rules table (which actually holds the message string). We have helpers elsewhere that provide this flattening, there's a visitor dedicated to it. Should make sure useful helper exists on Rule. btw - all of this stuff is helpful to enable optionally in the rewrite command. #Closed

@eddynaka eddynaka changed the title Inlining artifacts Merging artifacts Feb 10, 2021
@eddynaka eddynaka marked this pull request as ready for review February 10, 2021 14:30
public bool ShouldSerializeLevel() { return this.Level != FailureLevel.Warning; }
public bool ShouldSerializeLevel()
{
return this.Level != FailureLevel.Warning;
Copy link
Member

@michaelcfanning michaelcfanning Feb 10, 2021

Choose a reason for hiding this comment

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

FailureLevel.Warning [](start = 33, length = 20)

This is wrong, we should only set this if level doesn't correspond to the default rule level. Also, this value relates to kind! So, if this isn't a failure result, level == 0. #2077

}

if (!_ruleIdToResultsMap[key].Contains(result))
{
_ruleIdToResultsMap[key].Add(result);
splitRun.Results.Add(result);
_ruleIdToMergeVisitorsMap[key].CurrentRun = result.Run;
Copy link
Member

Choose a reason for hiding this comment

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

ruleIdToMergeVisitorsMap[key] [](start = 37, length = 29)

use a variable (of RunMergingVisitor type) for this.

"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
"version": "2.1.0",
Copy link
Member

Choose a reason for hiding this comment

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

version [](start = 3, length = 7)

Looks good! Please get some example PREfast files and let's test them explicitly.

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:

@eddynaka eddynaka changed the title Merging artifacts Merging artifacts during merge command Feb 10, 2021
@michaelcfanning michaelcfanning merged commit 4d66c78 into main Feb 12, 2021
@michaelcfanning michaelcfanning deleted the users/ednakamu/inline-artifacts-merge branch February 12, 2021 20:28
@eddynaka eddynaka linked an issue Feb 16, 2021 that may be closed by this pull request
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.

Merge operations are zapping artifact data review artifacts after merge command
2 participants