My question is a continuation of this question. Basically I’d link to know whether it’s possible to “bind” a project to Github after it has been created manually.
Context: In the SonarCloud UI one can create a new project by selecting a Github repository. One can subsequently manually publish an analysis using the generated project key of the form OrganizationName_ProjectName. Such projects are marked as “bound to Github”. We have now set up our build pipeline to publish projects using the OrganizationName_ProjectName project key format. However, new projects published this way (i.e., before manually creating the associated project through the UI) are not marked as “bound to Github”. I cannot find a way to establish this link; does anybody know how to do it?
This is currently not possible. The only way to establish this link is by importing a new project.
In your case this would mean deleting the manually created project and importing a new one.
Can I ask what made you create the projects manually first? And what made you change towards importing the repositories from your GitHub organization?
Thanks for your answer. It was actually the other way around: I first found the button to import a repository from Github, then identified the project key pattern used, and subsequently encoded that in our CI pipeline. This way, given a shared SONAR_TOKEN, any team can create a new project in SonarCloud, without any manual intervention. The downside then is that SonarCloud doesn’t recognize that the new projects have a direct relationship with one of the Github repositories in our organization, even though (a) the default project key format is used and (b) the sonar-maven-plugin also sends an SCM link referencing the associated Github repository. So in that sense there’s enough information to make this work, at least in theory. Is such automated linking somewhere on the SonarCloud roadmap?
The ability to bind the the unbound repositories or to migrate the unbound repositories to bound ones is in our roadmap. Unfortunately I cannot commit to any timeline.