-
Notifications
You must be signed in to change notification settings - Fork 88
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
Implement the Visual Studio build log converter #1533
Conversation
@@ -294,7 +294,7 @@ public void CompleteRun() | |||
|
|||
SerializeIfNotNull(_run.Tags, "tags"); | |||
SerializeIfNotNull(_run.Conversion, "conversion"); | |||
SerializeIfNotNull(_run.Language, "language"); | |||
SerializeIfNotDefault(_run.Language, "language", "en-US"); |
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.
SerializeIfNotDefault [](start = 12, length = 21)
This is the fix for #1524, "ResultLogJsonWriter emits language 'en-US'". Note that I hard-coded the default -- this string appears in several places and I chose not to make today the day I DRY it out. #Resolved
@@ -188,24 +188,26 @@ protected static string GenerateDiffCommand(string suiteName, string expected, s | |||
|
|||
public static bool AreEquivalent<T>(string actualSarif, string expectedSarif, IContractResolver contractResolver = null) | |||
{ | |||
if (actualSarif.Equals(expectedSarif)) { return true; } | |||
expectedSarif = expectedSarif ?? "{}"; |
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.
expectedSarif [](start = 12, length = 13)
The changes in this method are the fix for #1525, "FileDiffingUnitTests don't notice spurious default-valued properties".
@@ -16,12 +16,12 @@ namespace Microsoft.CodeAnalysis.Sarif | |||
/// See https://xunit.github.io/docs/shared-context for more information about xUnit class fixtures. | |||
/// | |||
/// This particular fixture deletes any existing test output files that may have been produced | |||
/// by a previous run. It is designed for use on test classes that derive from FileDiffingTests. |
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.
FileDiffingTests [](start = 83, length = 16)
Wrong class name. #Resolved
src/ReleaseHistory.md
Outdated
* BUGFIX: Add `Result.Level` (and remove `Result.Rank`) for Fortify Converter based on MicroFocus feedback. | ||
* API NON-BREAKING: Provider a SARIF converter for Visual Studio log files. |
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.
Provider [](start = 20, length = 8)
s/be 'Provide' #Resolved
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.
have you tested your converter in all three viewers? vs. vs code, and ado results explorer? |
Will send you results in email. In reply to: 501906158 [](ancestors = 501906158) |
@harleenkohli is added to the review. #Closed |
very NIT: could a better place for this readme be inside the "Inputs" folder? #ByDesign Refers to: src/Test.UnitTests.Sarif.Converters/TestData/VisualStudioBuildLogConverter/README.md:1 in 2caebcf. [](commit_id = 2caebcf, deletion_comment = False) |
(cool trick for getting the gitignore issue out of the way) In reply to: 502849560 [](ancestors = 502849560) Refers to: src/Test.UnitTests.Sarif.Converters/TestData/VisualStudioBuildLogConverter/README.md:1 in 2caebcf. [](commit_id = 2caebcf, deletion_comment = False) |
src/ReleaseHistory.md
Outdated
@@ -382,7 +382,7 @@ | |||
* BUGFIX: Multitool crashes on launch: Can't find CommandLine.dll. https://github.com/microsoft/sarif-sdk/issues/1487 | |||
|
|||
## **v2.1.2** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.1.2) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.1.2) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.1.2) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.1.2) | |||
* API BREAKING: Change location.logicalLocation to logicalLocations array. https://github.com/oasis-tcs/sarif-spec/issues/414 | |||
* API BREAKING: Change result.logicalLocation to logicalLocations array. https://github.com/oasis-tcs/sarif-spec/issues/414 | |||
|
|||
## **v2.1.3** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.1.3) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.1.3) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.1.3) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.1.3) |
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.
/Sarif.Sdk/2.1.3) [](start = 50, length = 17)
Should we call out that its MSBuild log file ? (VS logs could mean something more generic?) #Pending
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.
sigh I did struggle with the naming. I supposed MSBuild is better. Even that's not perfect because any tool or script that produces error lines in this standard format will work. I'll merge this but will ask for a call from Michael.
In reply to: 294517116 [](ancestors = 294517116)
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.
I put the file here because this is the folder that contains the affected files. My usual "scope reduction" approach :) In reply to: 502849825 [](ancestors = 502849825,502849560) Refers to: src/Test.UnitTests.Sarif.Converters/TestData/VisualStudioBuildLogConverter/README.md:1 in 2caebcf. [](commit_id = 2caebcf, deletion_comment = False) |
Compare the test file SomeErrors.txt (the input) to SomeErrors.sarif (the output) to see the implementation choices I made. In particular, I did not segregate those lines that mentioned a build tool (such as "LINK") into separate run objects. IMO the entire log represents a single "run" -- the build.
It is not at all clear what to put in
run.tool.name
. It's not even necessarily true that the log was produced by Visual Studio or even MSBuild. Any script that ran the underlying tools (csc, link, rc, ...) would produce error messages in the same format. Suggestions welcome.