Github Organization Change

  • ALM - Github
  • CI - Github Actions
  • Automatic Analysis

Private Repo/Project, we recently changed our organization name on GitHub.

Current issue is the “Sonarcloud bot” is no longer posting to the Pull Requests. I can see the analysis is happening on sonarcloud itself, but results are not posted to the PRs. Can you please advise.

You should be able to uninstall the Github application from your organization, and then retrigger the binding process via the global Administration > Organization Settings .

What happens to the existing projects if the GitHub application is removed?

Would any of the depositions that have been done for the likes of security hotspot be lost?

Thanks

I uninstalled the GitHub Application and rebound it as suggested, but it appears to not have fixed the issue.

The automatic analysis is not posting the summary to the GitHub PRs.

Hey there.

Thanks for the update. Can you see if the repository is available to bind to in your project administration?

This is a brand new feature in SonarCloud, so I’m not sure how it interacts with GitHub organization name changes.

1 Like

Hi,

Sure no problem, it currently shows as bound in there.

I also tried toggling the “enable summary comment”, but that seemed to have no affect.

Is there anywhere to get access to some logs to see what is going on?

Hey @sohara

I’m sorry for the delayed response – I was traveling.

I really hoped this feature would address the problem. SonarCloud doesn’t do a good job handling name changes of organizations – and I always attributed this to the project binding becoming corrupt. If the project still shows up as bound correctly, I’m not sure what’s going on.

For most cases like this we usually have to suggest that organizations get recreated from scratch. I’m going to flag this for attention to see if there’s anything I’ve missed (and make sure a bug ticket exists for this)

Hi @sohara,

Now that we looked at the config and it seems ok, we need to get technical to understand what’s the underlying problem is. It could be of 2 sorts:

  • somehow the analysis is messed up and doesn’t report Pull-Request information. However it’s provided (usually automatically), SonarCloud needs the following parameters in the analysis:
sonar.pullrequest.base=master
sonar.pullrequest.branch=feature/my-new-feature
sonar.pullrequest.key=5
  • or there is an issue when SonarCloud reach out to GitHub to do the PR decoration (posting results to the GitHub PR), even though the binding looks ok

Let’s go step by step then.

  1. How do you perform project analysis? Is it automatically made by SonarCloud itself, or you’re using a CI to run that?

  2. If it’s your own CI, can you share logs of an analysis so we can look at what happened here? Ideally in debug mode.

Cheers
Antoine

Hi Antoine,

It’s set as “Automatic Analysis”.

I can see the analysis being performed on SonarCloud itself, the summary posts that used to be posted to the PRs in GitHub are now no longer happening after the organization name change.

image

Hey Stephen,

Alright, thanks for your answer. Could you please share your project key so we can track down internally what happened here? ie. what happened during the automatic code analysis, and also during the processing of the PR decoration.

Thanks

Is there a way to DM that?

As an update here, we understood what problem @sohara was having. Another SonarCloud user have it and we have centralized the root cause (and later improvement actions) in this thread: SonarCloud unable to add decor status on github PR - #20 by Antoine

Cheers

2 Likes

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