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

BUGFIX: Transformation from SARIF 1.0 to 2.x throws Argument-Out-of-Range exception if result.locations is an empty array #1527

Merged
merged 7 commits into from
Jun 10, 2019

Conversation

harleenkohli
Copy link
Contributor

@harleenkohli harleenkohli changed the title V1 result locations out of range bug BUGFIX: Transformation from SARIF 1.0 to 2.x throws Argument-Out-of-Range exception if result.locations is an empty array Jun 10, 2019
* API BREAKING: The `Init` methods in the Autogenerated SARIF object model classes are now `protected virtual`. This enables derived classes to add additional properties without having to copy the entire code of the `Init` method.
* BUGFIX: Transformation from SARIF 1.0 to 2.x throws Argument-Out-of-Range exception if `result.locations` is an empty array. https://github.com/microsoft/sarif-sdk/issues/1526
Copy link

@ghost ghost Jun 10, 2019

Choose a reason for hiding this comment

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

Argument-Out-of-Range exceptio [](start = 54, length = 30)

May as well just say the type name ArgumentOutOfRangeException. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i agree! why didnt i!


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

"results": [
{
"ruleId": "WS099",
"level": "error",
Copy link
Contributor Author

@harleenkohli harleenkohli Jun 10, 2019

Choose a reason for hiding this comment

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

"level": "error", [](start = 9, length = 18)

Question: ok, i manually edited this before uploading the file. The version which was sent to us had this value as "5". This failed for me when i plugged it as a unit test case. I just want to understand how this works for our customers? where does the enum conversion happen? #WontFix

@@ -50,9 +50,11 @@
<None Remove="TestData\SarifVersionOneToCurrentVisitor\ExpectedOutputs\MinimumWithLanguage.sarif" />
<None Remove="TestData\SarifVersionOneToCurrentVisitor\ExpectedOutputs\NestedInnerExceptionsInNotifications.sarif" />
<None Remove="TestData\SarifVersionOneToCurrentVisitor\ExpectedOutputs\OneRunWithAllReportingDescriptors.sarif" />
<None Remove="TestData\SarifVersionOneToCurrentVisitor\ExpectedOutputs\WebScout.sarif" />
Copy link

@ghost ghost Jun 10, 2019

Choose a reason for hiding this comment

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

WebScout [](start = 75, length = 8)

This is an internal tool. I suggest:

  1. Rename it to something like V1ZeroLengthLocationsArray.sarif
  2. Strip it down to the absolute minimum file that demonstrates the problem. One result, no optional properties... just what you need to trigger the bug. #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok! will update!


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

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

:shipit:

@harleenkohli harleenkohli merged commit b8c2f40 into master Jun 10, 2019
@ghost ghost deleted the v1-result-locations-out-of-range-bug branch September 10, 2019 17:19
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.

1 participant