Sonarcloud stoped posting analysis report in Github PR but still posts them in the actions

Hi @jonenst,

This is expected. On SonarCloud side we need to know to which your SonarCloud project maps to on GitHub side to post the status check.

Hi, thanks for your time and your answer. However, the situation is still unclear. From what I see

  • project bound to github repo, using on:push => status checks posted on PR
  • project NOT bound to github repo, using on:push => status checks NOT posted on PR
  • project NOT bound to github repo, using on:pr => status checks posted on PR

are all these expected ?

You said “Therefore we decided to remove the custom logic and to fully rely on the GitHub actions context” but it still works using “on: push” for bound projects, can you please elaborate ?

According to Binding an existing project to Github, it is not possible to bind a project to github after its creation, what are we supposed to do ? I would like to avoid deleting and reimporting projects that have a multiyear history and were created before the github importer existed.

Thanks in advance,
Jon

Also, if the ticket says that binding is not available yet, how do I have my projects bound? If that fixes the problem with notifications on push, I would definitely want them to be bound

From what I see, it also adds some hyperlinks on commit shas, maybe other things ?
To have some one my projects bounds (the small ones), I deleted them and recreated them (lost history…)

@TomVanBraband
I’ve encountered the same problem and use cases as the OP. It was extremely frustrating to not only have this change made without any indication to consumers that this was changing, but to not provide any sort of override or optional solution to use previous behavior.

Aside from providing more opportunity of where and when to put PR comments, I think SonarCloud should also provide regular release notes, if there isn’t a place to view them already.

3 Likes

Wow, I spent few hours wondering why sonarcloudbot messages are gone…

Same, and aside from the unexpectedness of the change, the poor communication/notification of it added some salt to the wound.

I think I follow why the change was made at a high-level, but that doesn’t really obviate the need to work with the folks whose cases would be broken by it at least imo. Or maybe I just missed where messaging about this had been done previously perhaps?

I would still like to have a more precise description of what is expected to happen, because it’s not what has been described in this thread:

“Therefore we decided to remove the custom logic and to fully rely on the GitHub actions context.”

conflicts with my observations (1st one):

"
project bound to github repo, using on:push => status checks posted on PR (is this expected ???)
project NOT bound to github repo, using on:push => status checks NOT posted on PR
project NOT bound to github repo, using on:pr => status checks posted on PR
"

Can you comment on this ? Thanks

I’m also struggling how should it be configured.
I think in past days this configuration was pushing bot message, but right now not. Another update?

on:
  push:
    branches:
      - '**'
  pull_request:
    types: [synchronize]

It’s upsetting that this change was made with no notification, as we previously just ran sonar on branches, and not on PRs, and relied on the comment from that branch analysis on the PR. Now we have to run sonar on both branch and PR, which consumes more actions minutes.

Is there no way this could become a setting of some kind for us to customize?

I understand that we disabled behaviour that you were relying on, and we apologise for the lack of communication on this change.

We’ll start internal discussions on how we can support both usecases, since the logic we disabled was also negatively impacting some of our users.

We’ll consider this option, thanks for the suggestion.

I’ll update this thread once we have more information

1 Like

Can you share wether you are referring to the commit check or PR summary comment when you say ‘status checks’?

When you have a bound project, you should always receive a GitHub check on your commit, wether you use on: push or on: pull_request. With the recent change you should now no longer receive a PR summary comment when using on: push, but you should receive a PR summary comment when using on: pull_request

Hey Tom, hope you are doing great!

Is there anything like this for Azure Pipelines? I need to run the analysis only on push, not on PRs.

Is there a way to stop running the analysis on PRs?

Hi Tom, thanks for you reply, you are right. I was indeed referring to the status check (which blocks merging depending on the settings of the github repo). Also the PR summary comment behaves like you said. So here’s what was removed:

boundproject… | on:push | pr summary comment | before: Y, after N
unboundproject | on:push | pr summary comment | before: Y, after N
unboundproject | on:push | pr status check… … … | before: Y, after N

So for my use case where I block the merge if the status check is not posted, I needed a solution, I decided to delete my sonar projects and recreate them as bound github project (because you can’t bind existing projects) (I lost a bit of sonar history but they were recent repos so not very important). The alternative to restore the status check would have been to switch to on: pr, and this would have additionally restored the PR summary comment.

Thanks !

We are still considering this thread, we should have a solution in the near future.