If HDF CodeDesc is empty, use Desc as Message - #2635
Conversation
|
Michael C. Fanning (@michaelcfanning) how does this PR look? I'm eager to get this merged and see the improvement in a release :-) |
| Message = new Message | ||
| { | ||
| Text = AppendPeriod(controlResult.CodeDesc), | ||
| Text = AppendPeriod(string.IsNullOrWhiteSpace(controlResult.CodeDesc) ? execJsonControl.Desc : controlResult.CodeDesc), |
There was a problem hiding this comment.
are you sure this logic is what you want? I think you have the arguments reversed maybe?
I think this is right.
If controlResult.CodeDesc is null or whitespace, then use execJsonControl.Desc, otherwise use controlResult.CodeDesc
There was a problem hiding this comment.
Um, yes. :) Haven't had my coffee yet. The good news is my mistake squeezed a release note improvement out of you. :)
| @@ -1,5 +1,6 @@ | |||
| # SARIF Package Release History (SDK, Driver, Converters, and Multitool) | |||
| ## **v4.1.0** UNRELEASED | |||
| * BUG: If HDF `code_desc` is empty, use `desc` as the SARIF `message`. [#2632](https://github.com/microsoft/sarif-sdk/pull/2632) | |||
There was a problem hiding this comment.
I've made that update - how's it look now?
There was a problem hiding this comment.
Looks great! I'm going to ship this right now for you via NuGet.
Sometimes, the HDF CodeDesc is empty. Currently, that results in the SARIF Message being set to "." which isn't good. To fix that issue, if CodeDesc is empty, use the Desc.
b476302 to
a3b0f64
Compare
Michael C. Fanning (michaelcfanning)
left a comment
There was a problem hiding this comment.
![]()
|
Your changes are published to NuGet. Thanks for the contribution! Come back again. :) |
Sometimes, the HDF CodeDesc is empty. Currently, that results in the SARIF Message being set to "." which isn't good.
To fix that issue, if CodeDesc is empty, use the Desc.
I've reported one case where the HDF
code_descis set to the empty string at mitre/saf#1163