Skip to content

Commit

Permalink
v1 transformer analysis target region persistence fix. (#1238)
Browse files Browse the repository at this point in the history
* v1 transformer analysis target region persistence fix.

* Build changes
  • Loading branch information
michaelcfanning authored Jan 29, 2019
1 parent 633f510 commit 0a5292c
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 15 deletions.
5 changes: 4 additions & 1 deletion src/ReleaseHistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
2 changes: 1 addition & 1 deletion src/Sarif.UnitTests/Core/StackTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down Expand Up @@ -104,7 +125,7 @@
}
}
],
"suppressionStates": ["suppressedExternally"],
"suppressionStates": [ "suppressedExternally" ],
"baselineState": "existing"
}
],
Expand Down
3 changes: 2 additions & 1 deletion src/Sarif/SarifUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Sarif/VersionConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sarif/Visitors/SarifVersionOneToCurrentVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
4 changes: 2 additions & 2 deletions src/build.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<Product Condition=" '$(Product)' == '' ">Microsoft SARIF SDK</Product>
<Copyright Condition=" '$(Copyright)' == '' ">© Microsoft Corporation. All rights reserved.</Copyright>
<VersionPrefix Condition=" '$(VersionPrefix)' == ''">2.0.0</VersionPrefix>
<VersionSuffix Condition=" '$(VersionSuffix)' == ''">csd.2.beta.2018-10-10</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' == ''">csd.2.beta.2018-10-10.1</VersionSuffix>

<!--
Whenever you increment VersionPrefix or VersionSuffix, copy the old value(s)
Expand All @@ -23,7 +23,7 @@
hides the previous package versions on nuget.org.
-->
<PreviousVersionPrefix>2.0.0</PreviousVersionPrefix>
<PreviousVersionSuffix>csd.1.0.3</PreviousVersionSuffix>
<PreviousVersionSuffix>csd.2.beta.2018-10-10</PreviousVersionSuffix>
</PropertyGroup>

<PropertyGroup Label="Build">
Expand Down

0 comments on commit 0a5292c

Please sign in to comment.