Versions used
- SonarQube:
6.0
- Azure DevOps tasks:
- Prepare Analysis Configuration:
4.4.1
- Run Code Analysis:
4.4.1
- Publish Quality Gate Result:
4.3.0
- Prepare Analysis Configuration:
Error observed
On the Run Code Analysis
task, I see the following warning for every AssemblyInfo.cs
file in the repository:
17:56:25.563 WARN: Missing blame information for the following files:
17:56:25.563 WARN: * G:/a/ppe1a1/w/15/s/ProjectPath/Properties/AssemblyInfo.cs
17:56:25.563 WARN: This may lead to missing/broken features in SonarQube
Steps to reproduce
Our build is running in Azure DevOps with the following tasks, in this order:
- Version Assemblies (
1.42.2
) - Prepare Analysis Configuration (
1.4.1
) - Visual Studio Build (
1.126.0
) - Visual Studio Test (
2.141.9
) - Run Code Analysis (
4.4.1
) - Publish Quality Gate Result (
4.3.0
)
On every build, we get Missing blame information files: … AssemblyInfo.cs warnings for every AssemblyInfo.cs
in the repository on the Run Code Analysis
task. I believe it’s because the Version Assemblies
task is updating all of the AssemblyInfo.cs
files in the repository, and the Run Code Analysis
task is confused by the unstaged changes in Git.
Potential workaround
Two options:
- Disable the
Version Assemblies
task. - Run the build twice
Visual Studio Build
task twice like so:
a. Prepare Analysis Configuration
b. Visual Studio Build
c. Visual Studio Test
d. Run Code Analysis
e. Publish Quality Gate Result
f. Version Assemblies
g. Visual Studio Build
Neither are ideal: we lose assembly versioning with the first option, and our build times increase with the second.