Skip to content

Split StaticAnalysis exception files into separate files per module #6298

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

Merged
merged 5 commits into from
May 30, 2018
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
25 changes: 16 additions & 9 deletions documentation/Debugging-StaticAnalysis-Errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ d:\workspace\powershell\build.proj(511,5): error MSB3073: The command "d:\worksp
## Where to find StaticAnalysis reports

The StaticAnalysis reports could show up in two different places in the CI build:
- On the status page in Jenkins, under the Build Artifacts: the relevant files are BreakingChangeIssues.csv, SignatureIssues.csv, and/or HelpIssues.csv.
- On the status page in Jenkins, click Build Artifacts then navigate to src/Package. You will see BreakingChangeIssues.csv, SignatureIssues.csv, and/or HelpIssues.csv.
- On the status page in Jenkins, under the Build Artifacts: the relevant files are `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`.
- On the status page in Jenkins, click Build Artifacts then navigate to src/Package. You will see `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`.

Locally, the StaticAnalysis report will show up under Azure-PowerShell/src/Package. You will see BreakingChangeIssues.csv, SignatureIssues.csv, and/or HelpIssues.csv. You can generate these files by running
Locally, the StaticAnalysis report will show up under Azure-PowerShell/src/Package. You will see `BreakingChangeIssues.csv`, `SignatureIssues.csv`, and/or `HelpIssues.csv`. You can generate these files by running
```
msbuild build.proj
```
Expand All @@ -30,18 +30,25 @@ msbuild build.proj
The three most common Static Analysis errors are breaking changes, signature issues, and help issues. To figure out which type of error is causing the build failure, open each of the relevant .csv files (if the .csv file does not exist, there is no violation detected). Any issue marked with severity 0 or 1 must be resolved in order for the build to pass.

### Breaking Changes
If you make a change that could cause a breaking change, it will be listed in BreakingChangeIssues.csv. Please look at each of these errors, and if they do indeed introduce a breaking change in a non-breaking change release, please revert the change that caused this violation. Sometimes the error listed in the .csv file can be a false positive (for example, if you change a parameter attribute to span all parameter sets rather than individual parameter sets). Please read the error thoroughly and examine the relevant code before deciding that an error is a false positive, and contact the Azure PowerShell team if you have questions. If you are releasing a preview module, are releasing during a breaking change release, or have determined that the error is a false positive, please follow these instructions:
- Copy each of the errors you would like to suppress directly from the BreakingChangeIssues.csv file output in the Jenkins build
- Paste each of these error into the [BreakingChangeIssues.csv file](https://github.com/Azure/azure-powershell/blob/preview/tools/StaticAnalysis/Exceptions/BreakingChangeIssues.csv) in our GitHub repo. Note that you will need to edit this file in a text editor rather than Excel to prevent parsing errors.
- Push the changes to the .csv file and ensure the errors no longer show up in the BreakingChangeIssues.csv file output from the Jenkins build.
If you make a change that could cause a breaking change, it will be listed in `BreakingChangeIssues.csv`. Please look at each of these errors in this file, and if they do indeed introduce a breaking change in a non-breaking change release, please revert the change that caused this violation.

_Note_: Sometimes the error listed in the .csv file can be a false positive (for example, if you change a parameter attribute to span all parameter sets rather than individual parameter sets). Please read the error thoroughly and examine the relevant code before deciding that an error is a false positive, and contact the Azure PowerShell team if you have questions. If you are releasing a preview module, are releasing during a breaking change release, or have determined that the error is a false positive, please follow these instructions to suppress the errors:

- Download the `BreakingChangeIssues.csv` file from the Jenkins build
- Open the file using a text editor (such as VS Code) and copy each of the errors you'd like to suppress
- Paste each of these errors into the `BreakingChangeIssues.csv` file found in their respective [module folder](../tools/StaticAnalysis/Exceptions) (_e.g._, if a breaking change is being suppressed for Compute, then you would paste the corresponding line(s) in the `tools/StaticAnalysis/Exceptions/AzureRM.Compute/BreakingChangeIssues.csv` file) using the same text editor
- Push the changes to the .csv file and ensure the errors no longer show up in the `BreakingChangeIssues.csv` file output from the Jenkins build.

We take breaking changes very seriously, so please be mindful about the violations that you suppress in our repo.

### Signature Issues
Signature issues occur when your cmdlets do not follow PowerShell standards. Please check [this page](https://github.com/Azure/azure-powershell/wiki/PowerShell-Cmdlet-Design-Guidelines) to ensure you are following PowerShell guidelines. Issues with severity 0 or 1 must be addressed, while issues with severity 2 are advisory. If you have an issue with severity 0 or 1 that has been approved by the Azure PowerShell team, you can suppress them following these steps:

- Download the `SignatureIssues.csv` file from the Jenkins build
- Open the file using a text editor (such as VS Code) and copy each of the errors you'd like to suppress
- Paste each of these errors into the `SignatureIssues.csv` file found in their respective [module folder](../tools/StaticAnalysis/Exceptions) (_e.g.,_ if a signature issue is being suppressed for Sql, then you would paste the corresponding line(s) in the `tools/StaticAnalysis/Exceptions/AzureRM.Sql/SignatureIssues.csv` file) using the same text editor
- Copy each of the errors you would like to suppress directly from the SignatureIssues.csv file output in the Jenkins build
- Paste each of these error into the [SignatureIssues.csv file](https://github.com/Azure/azure-powershell/blob/preview/tools/StaticAnalysis/Exceptions/SignatureIssues.csv) in our GitHub repo. Note that you will need to edit this file in a text editor rather than Excel to prevent parsing errors.
- Push the changes to the .csv file and ensure the errors no longer show up in the SignatureIssues.csv file output from the Jenkins build.
- Push the changes to the .csv file and ensure the errors no longer show up in the `SignatureIssues.csv` file output from the Jenkins build.

### Help Issues
Most help issues that cause StaticAnalysis to fail occur when help has not been added for a particular cmdlet. If you have not generated help for your new cmdlets, please follow the instructions [here](https://github.com/Azure/azure-powershell/blob/preview/documentation/help-generation.md). If this is not the issue, follow the steps listed under "Remediation" for each violation listed in HelpIssues.csv.
17 changes: 0 additions & 17 deletions tools/StaticAnalysis/Exceptions/AssemblyVersionConflict.csv

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Directory","AssemblyName","Expected Version","Actual Version","Parent Assembly","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Directory","AssemblyName","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Assembly","HelpFile","Target","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Directory","Assembly Name","Assembly Version","Referencing Assembly","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"Directory","AssemblyName","Expected Version","Actual Version","Parent Assembly","Severity","ProblemId","Description","Remediation"
"src\Package\Debug\Storage\Azure.Storage","Newtonsoft.Json","6.0.0.0","10.0.0.0","Hyak.Common","1","1010","Assembly Newtonsoft.Json version 6.0.0.0 referenced from Hyak.Common.dll does not match assembly version on disk: 10.0.0.0","Update any references to version 6.0.0.0 of assembly Newtonsoft.Json"
"src\Package\Debug\Storage\Azure.Storage","Newtonsoft.Json","6.0.0.0","10.0.0.0","Microsoft.Azure.Commands.Common.Authentication.Abstractions","1","1010","Assembly Newtonsoft.Json version 6.0.0.0 referenced from Microsoft.Azure.Commands.Common.Authentication.Abstractions.dll does not match assembly version on disk: 10.0.0.0","Update any references to version 6.0.0.0 of assembly Newtonsoft.Json"
"src\Package\Debug\Storage\Azure.Storage","Newtonsoft.Json","6.0.0.0","10.0.0.0","Microsoft.Rest.ClientRuntime.Azure","1","1010","Assembly Newtonsoft.Json version 6.0.0.0 referenced from Microsoft.Rest.ClientRuntime.Azure.dll does not match assembly version on disk: 10.0.0.0","Update any references to version 6.0.0.0 of assembly Newtonsoft.Json"
"src\Package\Debug\Storage\Azure.Storage","Newtonsoft.Json","6.0.0.0","10.0.0.0","Microsoft.Rest.ClientRuntime","1","1010","Assembly Newtonsoft.Json version 6.0.0.0 referenced from Microsoft.Rest.ClientRuntime.dll does not match assembly version on disk: 10.0.0.0","Update any references to version 6.0.0.0 of assembly Newtonsoft.Json"
"src\Package\Debug\Storage\Azure.Storage","Newtonsoft.Json","6.0.0.0","10.0.0.0","Microsoft.WindowsAzure.Commands.Common","1","1010","Assembly Newtonsoft.Json version 6.0.0.0 referenced from Microsoft.WindowsAzure.Commands.Common.dll does not match assembly version on disk: 10.0.0.0","Update any references to version 6.0.0.0 of assembly Newtonsoft.Json"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"AssemblyFileName","ClassName","Target","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Directory","AssemblyName","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Assembly","HelpFile","Target","Severity","ProblemId","Description","Remediation"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"Directory","Assembly Name","Assembly Version","Referencing Assembly","Severity","ProblemId","Description","Remediation"
Loading