I have setup Monorepo projects (backend and frontend microservice folders on Bitbucket) in my Sonar Cloud organisation. I can see that the widget is working as expected on Bitbucket when I view my repo and can visibly see the statistics for my monorepo projects both frontend and backend.
I looked at your repo and setup (thanks for the links and details, very useful!). I confirm that your expectation is correct, on the PR you should see two widgets (for frontend and backend), just like on the main branch, and it’s not happening for some reason. So indeed something’s wrong.
The toggle you mentioned in your UPDATE is not an issue, that’s for Azure only. It’s not clear to me what is wrong, I need more time to investigate, and possibly help from my colleagues on Monday. So please stay tuned, keep the PR, the repo, and your setup there so that we can investigate, and I’ll get back to you next week.
Ok, so by the time I got a chance to take a closer look at the problem, it seems to be gone now: the 2 widgets are correctly displayed on your PR now. We haven’t changed anything related at our side. Have you changed anything? Do you have another PR with the issue?
I will continue internal discussions to see if this is a known bug.
Hi @janos , yes I did check it 2 days ago. I can see the widgets showing, however, on our private organisation projects, the widgets are not showing. Is this issue related to Bitbucket Cloud and Sonar Cloud?
The pipeline and sonar cloud setup is similar, however, the repos and projects on Sonar Cloud are private.
From my end, I did not change anything. the only thing I changed was the formatting of my pipeline YAML (you can see from my PR commit history), which I doubt would’ve been the cause for the issue to be fixed, correct?
Any other ideas on how to make it work on my private organisation?
Hi @janos , curious to know if when we create a our monorepo projects, do we need to follow the standards mention in the UI. For example, if my organisation name is jeiman and my repo name is sampleRepo, do I need to follow the pre-filled project names defined by the UI? A photo example below:
Nope, you don’t need to. The formatting of these names that you can freely enter on the UI cannot cause this issue.
That depends on how you created your project on SonarCloud. If you created the same way as you did the public project in your first post, then setting is not used (and not useful).
There is an important difference between the widget showing “Not analyzed on SonarCloud yet…”, as in your first post, and not having a widget at all. Basically if you have the widget at all, that’s good, because it shows that the binding to SonarCloud is correct. Another indicator of correct binding is seeing the Code Reports box on the right. Can you please confirm? At this point, I’m not sure if the issue with your private projects is the same as with the public one.
At least in the case of the public project, I suspect that this was probably happening when the widget content was missing. I did not have time to investigate further, I’m trying to make time soon.
If you configured the private repo the same way as the public one, and the symptoms are the same (widget is there but empty), then since the problem resolved by itself there without a change in configuration, you could try to trigger a new analysis of the main branch and then the PR, by pushing a commit to each. That’s really a shot in the dark though. Or in the worst case, and if it’s possible for you, you could try to reimport the project, in monorepo setup, as I suppose you did the public project. Or you could wait until I find and understand the bug at our side.
Yes, the integration between Sonar Cloud and Bitbucket Cloud is working as expected. The widget is showing up on our repo page, showcasing all of our monorepo projects. SC analysis is working well as expected.
Only problem is with the PRs. The widget is enabled on the PR, however, it keeps showing “Not analyzed on SonarCloud yet…” on every PR raised (similar to my first post).
Right so for the public repo, I followed the naming convention as pre-filled by the UI for the monorepo project creation and enabled that PR provider option to point to BB cloud.
However, on our private organisation repo, we followed our own naming convention for the monorepo project creation. So we’re unsure if we need to enable that or not. However, you did mention that this will not cause the issue that we’re facing.
Not a problem. Please do investigate it from your end. If you can get back to us sooner, we would highly appreciate it. As I mention above, it keeps showing "Pull Request not found", so could be something from Sonar Cloud’s end that it is not linking the PRs correctly to the Sonar Cloud project. However, I can see the PR analysis on Sonar Cloud.
Hopefully we can resolve this soon. Thank you again for assisting us.