diff --git a/src/ReleaseHistory.md b/src/ReleaseHistory.md index 56c12b6df..904f1a389 100644 --- a/src/ReleaseHistory.md +++ b/src/ReleaseHistory.md @@ -201,7 +201,7 @@ * Bugfix to result matching algorithm where empty or null previous log sets caused a NullReferenceException. * Bugfix to result matching algorithm where we were incorrectly detecting duplicate data across files, and changed a "NotImplementedException" to the correct "InvalidOperationException". -## **v2.0.0-csd.2.beta.2018.10.10** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.0.0-csd.2.beta.2018.10.10) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.0.0-csd.2.beta.2018.10.10) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.0.0-csd.2.beta.2018.10.10)) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.0.0-csd.2.beta.2018.10.10)) +## **v2.0.0-csd.2.beta.2018-10-10** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.0.0-csd.2.beta.2018-10-10) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.0.0-csd.2.beta.2018-10-10) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.0.0-csd.2.beta.2018-10-10)) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.0.0-csd.2.beta.2018-10-10)) * BREAKING: invocation.workingDirectory is now a FileLocation object (and not a URI expressed as a string) * Add run.externalFiles object to schema. Sync generally to OASIS TC schema. * Add --sarif-version command to driver (to transform SARIF output to v1 format) @@ -218,3 +218,6 @@ * BREAKING: run.automationLogicalId subsumed by run.aggregateIds, an array of 'runAutomationDetails' objects. * BREAKING: Remove threadFlowLocation.step * Add result.occurrenceCount (denotes # of occurrences of an identical results within an analysisRun) + +## **v2.0.0-csd.2.beta.2018-10-10.1** [Sdk](https://www.nuget.org/packages/Sarif.Sdk/2.0.0-csd.2.beta.2018-10-10.1) | [Driver](https://www.nuget.org/packages/Sarif.Driver/2.0.0-csd.2.beta.2018-10-10.1) | [Converters](https://www.nuget.org/packages/Sarif.Converters/2.0.0-csd.2.beta.2018-10-10.1)) | [Multitool](https://www.nuget.org/packages/Sarif.Multitool/2.0.0-csd.2.beta.2018-10-10.1)) +* Persist region information associated with analysis target \ No newline at end of file diff --git a/src/Sarif.UnitTests/Core/StackTests.cs b/src/Sarif.UnitTests/Core/StackTests.cs index e3e3e2886..6315c3ae1 100644 --- a/src/Sarif.UnitTests/Core/StackTests.cs +++ b/src/Sarif.UnitTests/Core/StackTests.cs @@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.Sarif { public class StackTests { - [Fact] + [Fact(Skip = "Broken by new, unexpected framework behavior in StackTrace class. Issue #1163")] public void Stack_CreateFromStackTrace() { var dotNetStack = new StackTrace(); diff --git a/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v1/BasicResult.sarif b/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v1/BasicResult.sarif index f00b82b53..3766ff3d0 100644 --- a/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v1/BasicResult.sarif +++ b/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v1/BasicResult.sarif @@ -36,7 +36,23 @@ "kind": "namespace" } }, - "results": [ + "results": [{ + "ruleId": "C2005", + "message": "Some testing occurred.", + "locations": [ + { + "analysisTarget": { + "uri": "file:///home/buildAgent/src/myFile.cpp", + "region": { + "startLine": 2, + "startColumn": 3, + "endLine": 4, + "endColumn": 5 + } + } + } + ] + }, { "ruleId": "C2001", "formattedRuleMessage": { diff --git a/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v2/BasicResult.sarif b/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v2/BasicResult.sarif index 1934fb6e8..23ec4a02d 100644 --- a/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v2/BasicResult.sarif +++ b/src/Sarif.UnitTests/TestData/SarifVersionOneToCurrentVisitor/v2/BasicResult.sarif @@ -14,12 +14,9 @@ "contents": { "text": "The quick brown fox jumps over the lazy dog" }, - "hashes": [ - { - "value": "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592", - "algorithm": "sha-256" - } - ] + "hashes": { + "sha-256": "d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592" + } } }, "logicalLocations": { @@ -39,6 +36,30 @@ } }, "results": [ + { + "ruleId": "C2005", + "message": { + "text": "Some testing occurred." + }, + "analysisTarget": { + "uri": "file:///home/buildAgent/src/myFile.cpp" + }, + "locations": [ + { + "physicalLocation": { + "fileLocation": { + "uri": "file:///home/buildAgent/src/myFile.cpp" + }, + "region": { + "startLine": 2, + "startColumn": 3, + "endLine": 4, + "endColumn": 5 + } + } + } + ] + }, { "ruleId": "C2001", "level": "error", @@ -104,7 +125,7 @@ } } ], - "suppressionStates": ["suppressedExternally"], + "suppressionStates": [ "suppressedExternally" ], "baselineState": "existing" } ], diff --git a/src/Sarif/SarifUtilities.cs b/src/Sarif/SarifUtilities.cs index 9665d20e6..68e93249c 100644 --- a/src/Sarif/SarifUtilities.cs +++ b/src/Sarif/SarifUtilities.cs @@ -47,7 +47,8 @@ public static string SemanticVersion s_semanticVersion = VersionConstants.AssemblyVersion; if (!string.IsNullOrWhiteSpace(VersionConstants.Prerelease)) { - s_semanticVersion += "-" + VersionConstants.Prerelease; + // Trim the ".1" off the end of the version + s_semanticVersion += "-" + VersionConstants.Prerelease.Substring(0, VersionConstants.Prerelease.Length - 2); } } diff --git a/src/Sarif/VersionConstants.cs b/src/Sarif/VersionConstants.cs index b6b665805..09d5865ac 100644 --- a/src/Sarif/VersionConstants.cs +++ b/src/Sarif/VersionConstants.cs @@ -5,7 +5,7 @@ namespace Microsoft.CodeAnalysis.Sarif { public static class VersionConstants { - public const string Prerelease = "csd.2.beta.2018-10-10"; + public const string Prerelease = "csd.2.beta.2018-10-10.1"; public const string AssemblyVersion = "2.0.0"; public const string FileVersion = AssemblyVersion + ".0"; } diff --git a/src/Sarif/Visitors/SarifVersionOneToCurrentVisitor.cs b/src/Sarif/Visitors/SarifVersionOneToCurrentVisitor.cs index ce7f05463..670d5af1d 100644 --- a/src/Sarif/Visitors/SarifVersionOneToCurrentVisitor.cs +++ b/src/Sarif/Visitors/SarifVersionOneToCurrentVisitor.cs @@ -331,7 +331,7 @@ internal Location CreateLocation(LocationVersionOne v1Location) location = new Location { FullyQualifiedLogicalName = v1Location.LogicalLocationKey ?? v1Location.FullyQualifiedLogicalName, - PhysicalLocation = CreatePhysicalLocation(v1Location.ResultFile), + PhysicalLocation = CreatePhysicalLocation(v1Location.ResultFile ?? v1Location.AnalysisTarget), Properties = v1Location.Properties }; diff --git a/src/build.props b/src/build.props index 6747f522f..6d67cc6dc 100644 --- a/src/build.props +++ b/src/build.props @@ -10,7 +10,7 @@ Microsoft SARIF SDK © Microsoft Corporation. All rights reserved. 2.0.0 - csd.2.beta.2018-10-10 + csd.2.beta.2018-10-10.1 2.0.0 - csd.1.0.3 + csd.2.beta.2018-10-10