PR Checks Submitted But Results Not Returning


(Ken Jenney) #1

I’m using CircleCI to run unit tests and submit SonarQube results. The tests all complete and results are available on SonarCloud - however they never show up in my GitHub PR’s. All I’m getting with the PR is:

SonarCloud Expected — Waiting for status to be reported

How can I get SonarCloud to report back to GitHub?


(Janos Gyerik) #3

Thanks for reporting this, I will investigate.


(Janos Gyerik) #4

Hi @kjenney and sorry for the late reply.

I suspect you probably already figured out the answer, here it is anyway for the record. The Expected status can happen if the admin of a GitHub repo configured a check to be required. In this case “SonarCloud” appears to be required. However, we changed the way we decorate, and the new mechanism uses a different name “SonarCloud Code Analysis”.

The fix is for the GitHub user with admin rights on the repo to change the required check, dropping the old one and adding the new.


(Markus Rechtien) #6

Hi!

We just integrated SonarQube in our Gradle build using plugin “org.sonarqube” version “2.7”.
Our project is hosted on GitHub with sonarqube app installed and privileges granted on our project.
While sonarcloud.io is reporting all builds correctly with findings and green/red status GitHub is randomly not updated when the build finishes but keeps showing “SonarCloud Code Analysis Expected — Waiting for status to be reported”.
Sonarcloud and Github are linked correctly (i.e. the organisation, for a paid plan).

The sonarqube gradle task finishes as follows:
> Task :sonarqube
> 1012 files had no CPD blocks
> Calculating CPD for 1898 files
> SCM writing changed lines
> SCM writing changed lines (done) | time=49ms
> Analysis report generated in 279ms, dir size=3 MB
> Analysis report compressed in 1170ms, zip size=2 MB
> Analysis report uploaded in 1219ms
> ANALYSIS SUCCESSFUL, you can browse https://sonarcloud.io/project/issues?id=XXX&pullRequest=215&resolved=false
> Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
> More about the report processing at https://sonarcloud.io/api/ce/task?id=xxxxx
> Analysis total time: 3:54.203 s
> :sonarqube (Thread[Execution worker for ‘:’ Thread 2,5,main]) completed. Took 4 mins 20.742 secs.

How can we dig deeper to find the cause of the intermittent status update failures?

Thanks in advance,
Markus


(Janos Gyerik) #9

And when this happens, if you trigger the same build without any changes, does it get the status update? I’m asking to make sure it’s really an intermittent failure, and not specific to the content of the PR. Can you please confirm?


(Markus Rechtien) #10

Retriggering doesn’t help - did so multiple times with and w/o new commits.
The output is saying everything is fine (as shown above) and SonarQube portal shows green build without warnings or error. Following details also do not reflect any obvious issues afaiks:

{
"task":{"id":"AWoGoVjL8FPh9JKrfuuj","type":"REPORT", "componentId":"AxxxIPbZ-4oYCt1y8t",
 "componentKey":"XXX","componentName":"core","componentQualifier":"TRK",
"analysisId":"AWoGoxxxfpfrZMde073","status":"SUCCESS",
"submittedAt":"2019-04-10T11:43:18+0200","submitterLogin":"xxx@xxx",
"startedAt":"2019-04-10T11:43:18+0200", "executedAt":"2019-04-10T11:43:23+0200", 
"executionTimeMs":5044, "logs":false, "hasScannerContext":true, 
"organization":"xxx","pullRequest":"235", "warningCount":0,"warnings":[]}
}

Is there flags we can add to get more information or do you see any issues in the above status?
Looking at our currently open PRs none actually got updated by SonarQube. Did something change? A few days ago at least some got updated…

Maybe one additional note: we had issues linking SonarCloud and GitHub and tried it multiple with different accounts until it finally succeeded - not sure if that has any impact…