Impact: this check is mandatory for PR to be merged to main trunk. If this check fails, PR get can not be merged and hence dev flow is blocked.
In the failed github check, we see messages as (screeshot attached):
SonarCloud / SonarCloud Code Analysis
cancelled 7 days ago in 3m 43s
SonarCloud analysis failed
Please retry analysis of this Pull-Request directly on SonarCloud
at the same time:
PR decoration is available on PR
PR analysis on SonarCloud shows passed
Two questions:
why is it failing? background task logs are showing:
Error Message
Validation of project failed:
o Date of analysis cannot be older than the date of the last known analysis on this project. Value: "2021-09-27T16:40:22+0000". Latest analysis: "2021-09-27T16:41:00+0000". It's only possible to rebuild the past in a chronological order.
How to trigger analysis from sonarcloud as suggested in the github check?
Seeing the logs and the error message you get, is it sometimes happening that 2 builds / analysis gets triggered for the same commit ? If yes, you might want to have one SC analysis being finished before proceeding to another build, otherwise you don’t know when which analysis comes first, and that lead to those kind of messages.
I’ll have to find out what is causing back to back analysis requests. As of now, two events can trigger this build in github actions: ON PUSH and ON PULL_REQUEST.
Any pointers for second question? How to trigger analysis from sonarcloud as suggested in the github check?
I think this one is misleading, i’m gonna check with my colleagues whether this is still making sense. For now, i would suggest to trigger the build from GH actions instead.
Hey, @mickaelcaro, I’d like to share my experience with this problem. I was having the exact same error, and it seems that the LOC limit was reached, but the message on github says nothing about it. And in multiple scans, nothings clear was said on SonarCloud too. The misleading message lead us to keep trying, thinking that some config was wrong. Fixing that to provide a clear message would be very appreciated! Thank you
The error message is still the same, and there is no way of restarting the analysis from GH Actions. Under Pull request checks in GH Actions there is just a text saying “Please retry analysis of this Pull-Request directly on SonarCloud”, but it’s not apparent how in SonarCloud.