It’s really weird because in an MR pipeline run around April 3, 2025 at 11:25:10 AM MDT, the Sonar service was working fine and then a subsequent MR run with minimal file changes at around April 3, 2025 at 12:18:33 PM MDT resulted in the failed message.
Anyone has any insight on what could possibly caused this?
For additional context, I tested out with different scenarios:
Scenario 1: ReadMe.md Changes
Quality Gate succeeded (although presumably because there were no code file changes)
Still logged the error: Could not resolve 40 file paths in [/builds/<company>/<project>/coverage/lcov.info]
Scenario 2: Minimal Code Changes
Quality Gate Failed reporting a low code coverage
We inspected the coverage of the code files modified and can attest that the coverage is 100% (when you run the unit test on the file with --coverage parameter.
Note that Scenario 2 is happening on different MRs we have at the moment, with different branches being targeted.
Updates:
I have also tested by disabling sections of code from being scanned.
The code base has the following sonar-project.properties file with the entries:
I added the tag @SONAR_STOP@ and @SONAR_START@ on sections of the code where I want to ignore for code coverage but the same are not being taken into consideration.
This indicates that the paths in the coverage report don’t match the paths analysis is seeing. Let’s start with assetsTransformer.js. Where in the project is it located? And where is that, relative to where analysis kicks off?
This is an issues exclusion (hence the issue in the property name). So it’s not going to work at all for coverage.
I have been able to resolve the missing file paths in this instance. This was due to some exclusions made for files that we do not need for Sonar to scan.
This is an issues exclusion (hence the issue in the property name). So it’s not going to work at all for coverage.
Is there a mechanism to exclude portions of code from sonar cloud code coverage / quality scanning?