"The main branch of this project is empty even" suddenly, was working before

Hi everyone,

Running through a weird issue…
I have been I have been using Sonarcloud for the last year, but for the last couple of weeks, I have a problem for my project, they say “The main branch of this project is empty”, even if it’s not the case.

I can see a sudden drop on the 9th of May

I did nothing crazy this day (no config changes, no version upgrade, no ci changes… Only minor applicative code changes)

But in another hand, everything seems ok: my “staging” branch is well defined as “MAIN BRANCH”, and is it executed without any problem everytime…

Thank’s in advance for your help!

Hey there.

What language(s) make up this project? Do you see Code in the Code tab of your main branch?

Hi Colin,

I’m using mostly Typescript. I have some other projects actually running with Typescript, and working with Sonarcloud, just this one is broken since a couple of weeks ago. Sonarcloud detects no line of code…

Note that if I open one of those files listed, it is there, with some metrics of Sonarcloud…

Thanks. Are you using Automatic Analysis (project-level Administration > Analysis Method) or CI-based analysis?

Hi Colin,

I’m doing a CI-based analysis

Thanks.

It would be great if you could provide DEBUG level logs of the analysis logs (sonar-scanner -X) of a run that results in this behavior. I can also open up a private message channel if you’re more comfortable sharing there.

Hi @Colin ,

Here is the debug file (I skipped the parts where there was redondant info to see thing more clearly)

I can see this line 1060 files ignored because of inclusion/exclusion patterns, but I don’t get why it gets ignored…

Here are my sonar-project.properties:

sonar.sourceEncoding=UTF-8
sonar.typescript.file.suffixes=.ts
sonar.javascript.file.suffixes=.js
sonar.javascript.lcov.reportPaths=coverage/corelcov.info,coverage/mobile1lcov.info,coverage/mobile2lcov.info,coverage/web1lcov.info,coverage/web2lcov.info,coverage/web3lcov.info,coverage/web4lcov.info,coverage/web5lcov.info,coverage/unitlcov.info,coverage/maintenancelcov.info
sonar.exclusions=**/*.test.ts,**/*defaultDashboards.ts
sonar.test.inclusions=**/*.test.ts
sonar.typescript.tsconfigPath=tsconfig.json
sonar.qualitygate.wait=true

(the lcov files are stored correctly from another gitlab ci and passed to this one)

Thanks in advance!

Sonardebug.txt (61.1 KB)

Et voila, two issues.

08:41:42.900 INFO: TypeScript configuration file /builds/optimetriks/spabackend/fieldpro-api/tsconfig.json
08:41:42.967 ERROR: Error: Unknown compiler option 'ignoreDeprecations'.

Which, I think, results in…

08:41:42.973 INFO: Skipped 1034 file(s) because they were not part of any tsconfig.json (enable debug logs to see the full list)
08:41:42.973 DEBUG: File not part of any tsconfig.json: src/web/jobs/timers/utils.unit.test.ts
08:41:42.973 DEBUG: File not part of any tsconfig.json: src/web/uploads/POST_UploadPicture.integ.test.ts
08:41:42.973 DEBUG: File not part of any tsconfig.json: src/web/appusers/apiCalls.ts

ignoreDeprecations was introduced as a part of Typescript 4.9.5… and wouldn’t you know it, our Typescript analyzer currently uses 4.9.4 :exploding_head:

Our goal is to support Typescript 5 with the next release. Even the first PR has been opened.

In the meantime, if you can remove ignoreDeprecations from the tsconfig.json, you’ll probably be back in business.

1 Like

Amazing @Colin ! That was it indeed, thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.