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

Provide messages for SARIF2003.ProvideVersionControlProvenance. #1970

Merged
1 commit merged into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/Producing effective SARIF.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,14 @@ In result messages, use the 'message.id' and 'message.arguments' properties rath

#### Description

Provide 'versionControlProvenance' to record which version of the code was analyzed, and to enable paths to be expressed relative to the root of the repository.

#### Messages

##### `Default`: note

This run does not provide 'versionControlProvenance'. As a result, it is not possible to determine which version of code was analyzed, nor to map relative paths to their locations within the repository.

---

### Rule `SARIF2004.OptimizeFileSize`
Expand Down
Binary file modified docs/Rule factoring.xlsx
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Sarif.Multitool/Rules/RuleResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Sarif.Multitool/Rules/RuleResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ Many tools follow a conventional format for the 'reportingDescriptor.id' propert
<value>{0}: The 'message' property of this result contains a 'text' property. Consider replacing it with 'id' and 'arguments' properties. This potentially reduces the log file size, allows the message text to be improved without modifying the log file, and enables localization.</value>
</data>
<data name="SARIF2003_ProvideVersionControlProvenance_FullDescription_Text" xml:space="preserve">
<value>Placeholder_SARIF2003_ProvideVersionControlProvenance_FullDescription_Text</value>
<value>Provide 'versionControlProvenance' to record which version of the code was analyzed, and to enable paths to be expressed relative to the root of the repository.</value>
</data>
<data name="SARIF2003_ProvideVersionControlProvenance_Note_Default_Text" xml:space="preserve">
<value>{0}: Placeholder</value>
<value>{0}: This run does not provide 'versionControlProvenance'. As a result, it is not possible to determine which version of code was analyzed, nor to map relative paths to their locations within the repository.</value>
</data>
<data name="SARIF2004_OptimizeFileSize_Warning_EliminateIdOnlyRules_Text" xml:space="preserve">
<value>Placeholder_SARIF2004_OptimizeFileSize_Warning_EliminateIdOnlyRules_Text</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public class ProvideVersionControlProvenance : SarifValidationSkimmerBase
public override string Id => RuleId.ProvideVersionControlProvenance;

/// <summary>
/// Placeholder
/// Provide 'versionControlProvenance' to record which version of the code was analyzed,
/// and to enable paths to be expressed relative to the root of the repository.
/// </summary>
public override MultiformatMessageString FullDescription => new MultiformatMessageString { Text = RuleResources.SARIF2003_ProvideVersionControlProvenance_FullDescription_Text };

Expand All @@ -27,7 +28,9 @@ protected override void Analyze(Run run, string runPointer)
{
if (run.VersionControlProvenance == null || run.VersionControlProvenance.Count == 0)
{
// {0}: Placeholder
// {0}: This run does not provide 'versionControlProvenance'. As a result, it is
// not possible to determine which version of code was analyzed, nor to map
// relative paths to their locations within the repository.
LogResult(
runPointer,
nameof(RuleResources.SARIF2003_ProvideVersionControlProvenance_Note_Default_Text));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
"id": "SARIF2003",
"name": "ProvideVersionControlProvenance",
"shortDescription": {
"text": "Placeholder_SARIF2003_ProvideVersionControlProvenance_FullDescription_Text."
"text": "Provide 'versionControlProvenance' to record which version of the code was analyzed, and to enable paths to be expressed relative to the root of the repository."
},
"fullDescription": {
"text": "Placeholder_SARIF2003_ProvideVersionControlProvenance_FullDescription_Text"
"text": "Provide 'versionControlProvenance' to record which version of the code was analyzed, and to enable paths to be expressed relative to the root of the repository."
},
"messageStrings": {
"Note_Default": {
"text": "{0}: Placeholder"
"text": "{0}: This run does not provide 'versionControlProvenance'. As a result, it is not possible to determine which version of code was analyzed, nor to map relative paths to their locations within the repository."
}
},
"helpUri": "http://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html"
Expand Down